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 [2021/05/12 08:13] JSCAD Editor |
en:design_guide_rectangle [2022/04/13 07:16] (current) rozek included "require" statements, corrected mistakes |
||
|---|---|---|---|
| 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> | ||
| + | const { roundedRectangle } = require(' | ||
| + | |||
| const myshape = roundedRectangle({size: | const myshape = roundedRectangle({size: | ||
| const myshape = roundedRectangle({size: | const myshape = roundedRectangle({size: | ||
| </ | </ | ||