meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
en:design_guide_rotate [2020/12/08 06:51] JSCAD Project |
en:design_guide_rotate [2022/04/16 04:23] (current) Andreas Rozek included "require" statements, corrected mistakes |
||
---|---|---|---|
Line 9: | Line 9: | ||
<code javascript> | <code javascript> | ||
+ | const { cuboid } = require(' | ||
+ | const { rotate } = require(' | ||
+ | |||
const myshape = cuboid({size: | const myshape = cuboid({size: | ||
const newshape = rotate([(Math.PI * 2 / 4), (Math.PI * 2 / 24), (Math.PI * 2 / 12)], myshape) | const newshape = rotate([(Math.PI * 2 / 4), (Math.PI * 2 / 24), (Math.PI * 2 / 12)], myshape) | ||
Line 16: | Line 19: | ||
<code javascript> | <code javascript> | ||
+ | const { cuboid } = require(' | ||
+ | const { rotateX, | ||
+ | |||
const myshape = cuboid({size: | const myshape = cuboid({size: | ||
let newshape = rotateX((Math.PI * 2 / 4), myshape) | let newshape = rotateX((Math.PI * 2 / 4), myshape) | ||
Line 25: | Line 31: | ||
<code javascript> | <code javascript> | ||
- | const newshape = rotate([degreeToRad(90), degreeToRad(15), degreeToRad(30)], myshape) | + | const { cuboid } = require(' |
- | const newshape = rotateX(degreeToRad(90), myshape) | + | const { rotateX, |
+ | const { degToRad } = require(' | ||
+ | |||
+ | const myshape = cuboid({size: | ||
+ | const newshape = rotate([degToRad(90), degToRad(15), degToRad(30)], myshape) | ||
+ | const newshape = rotateX(degToRad(90), myshape) | ||
</ | </ | ||