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/01 03:54] JSCAD Editor |
en:design_guide_rectangle [2022/04/13 07:16] (current) rozek included "require" statements, corrected mistakes |
||
|---|---|---|---|
| Line 3: | Line 3: | ||
| A two dimensional shape made with four straight sides where all interior angles are right angles (90°). | A two dimensional shape made with four straight sides where all interior angles are right angles (90°). | ||
| - | {{ : | + | {{ : |
| // | // | ||
| - | 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: | ||
| </ | </ | ||
| + | === Square === | ||
| + | {{ : | ||
| + | |||
| + | The specialized square primitive also exists, but requires only one number value for all sides. | ||
| + | |||
| + | Defaults: | ||
| + | * size : 2 | ||
| + | * center : [0, 0] | ||
| + | |||
| + | <code javascript> | ||
| + | const { square } = require(' | ||
| + | |||
| + | const myshape = square({size: | ||
| + | const myshape = square({size: | ||
| + | </ | ||
| + | |||
| + | === Rounded Rectangle === | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Rounded rectangles can be created by specifying a '' | ||
| + | |||
| + | Defaults: | ||
| + | * size : [2, 2] | ||
| + | * center : [0, 0] | ||
| + | * roundedRadius: | ||
| + | * segments: 32 | ||
| + | |||
| + | <code javascript> | ||
| + | const { roundedRectangle } = require(' | ||
| + | |||
| + | const myshape = roundedRectangle({size: | ||
| + | const myshape = roundedRectangle({size: | ||
| + | </ | ||