Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap ExtrudeRotate #59

Merged
merged 2 commits into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion examples/extrude-rotate.fixture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import { Polygon } from "../lib/jscad-fns/polygon"

export default () => (
<JsCadFixture>
<ExtrudeRotate angle={Math.PI} segments={24}>
<ExtrudeRotate
angle={Math.PI}
segments={24}
color="aqua"
center={[0, 4, 4]}
>
<Polygon
points={[
[-2, -1],
Expand Down
9 changes: 7 additions & 2 deletions lib/jscad-fns/extrude-rotate.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
import { withColorProp } from "lib/wrappers/with-color-prop"
import { withOffsetProp } from "lib/wrappers/with-offset-prop"

export type ExtrudeRotateProps = {
angle: number
startAngle?: number
segments?: number
children: any
}

export function ExtrudeRotate({
const ExtrudeRotateBase = ({
angle,
startAngle,
segments,
children,
}: ExtrudeRotateProps) {
}: ExtrudeRotateProps) => {
return (
<extrudeRotate angle={angle} startAngle={startAngle} segments={segments}>
{children}
</extrudeRotate>
)
}

export const ExtrudeRotate = withOffsetProp(withColorProp(ExtrudeRotateBase))
Loading