Skip to content

Commit

Permalink
Merge pull request #59 from tscircuit/wrap-extrude-rotate
Browse files Browse the repository at this point in the history
Wrap ExtrudeRotate
  • Loading branch information
Slaviiiii authored Aug 4, 2024
2 parents 0a18997 + dd09606 commit c6fbcc0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
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))

0 comments on commit c6fbcc0

Please sign in to comment.