meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:design_guide_rectangle [2020/12/02 07:14] JSCAD Editor |
en:design_guide_rectangle [2022/04/13 07:16] (current) rozek included "require" statements, corrected mistakes |
||
---|---|---|---|
Line 7: | Line 7: | ||
// | // | ||
- | The '' | + | The '' |
Defaults: | Defaults: | ||
Line 14: | Line 14: | ||
<code javascript> | <code javascript> | ||
- | const myshape = rectangle({size: | + | const { rectangle } = require(' |
- | const myshape = rectangle({size: | + | |
+ | const myshape = rectangle({size: | ||
+ | const myshape = rectangle({size: | ||
</ | </ | ||
Line 23: | Line 25: | ||
The specialized square primitive also exists, but requires only one number value for all sides. | The specialized square primitive also exists, but requires only one number value for all sides. | ||
+ | |||
+ | Defaults: | ||
+ | * size : 2 | ||
+ | * center : [0, 0] | ||
<code javascript> | <code javascript> | ||
- | const myshape = square({size: | + | const { square } = require(' |
- | const myshape = square({size: | + | |
+ | const myshape = square({size: | ||
+ | const myshape = square({size: | ||
</ | </ | ||
Line 34: | Line 42: | ||
Rounded rectangles can be created by specifying a '' | Rounded rectangles can be created by specifying a '' | ||
+ | |||
+ | Defaults: | ||
+ | * size : [2, 2] | ||
+ | * center : [0, 0] | ||
+ | * roundedRadius: | ||
+ | * segments: 32 | ||
<code javascript> | <code javascript> | ||
- | let myshape = roundedRectangle({size: | + | const { roundedRectangle } = require(' |
- | let myshape = roundedRectangle({size: | + | |
+ | const myshape = roundedRectangle({size: | ||
+ | const myshape = roundedRectangle({size: | ||
</ | </ |