-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* implement rotate wrapper * formatbot: Automatically format code * Implement Rotate wrapper * formatbot: Automatically format code --------- Co-authored-by: tscircuitbot <tscircuitbot@users.noreply.github.com>
- Loading branch information
1 parent
cf94e19
commit 4eb556a
Showing
7 changed files
with
56 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Polygon } from "../lib" | ||
import { JsCadFixture } from "../lib/components/jscad-fixture" | ||
import { Rotate } from "../lib/jscad-fns" | ||
|
||
export default () => ( | ||
<JsCadFixture> | ||
<Rotate angles={[0, 0, Math.PI]}> | ||
<Polygon | ||
points={[ | ||
[-2, -1], | ||
[2, -1], | ||
[2.5, 2], | ||
[1, 1], | ||
[0, 2], | ||
[-1, 1], | ||
[-2, 2], | ||
]} | ||
/> | ||
</Rotate> | ||
</JsCadFixture> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import type { Point3 } from "./translate" | ||
|
||
export type RotateProps = { | ||
angles: Point3 | ||
children: React.ReactNode | ||
} | ||
|
||
export function Rotate({ angles, children }: RotateProps) { | ||
if (!Array.isArray(angles)) { | ||
angles = [angles.x, angles.y, angles.z] | ||
} | ||
return <rotate angles={angles}>{children}</rotate> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.