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_cuboid [2020/11/28 02:14] JSCAD Editor |
en:design_guide_cuboid [2022/04/12 08:07] (current) rozek |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ==== Cuboid ==== | ==== Cuboid ==== | ||
| - | A three dimensional shape created from six retangular faces, each at right angles to another, and opposite faces are equal. The **cube** is a special case of the a cuboid in which all six faces are squares. | + | A three dimensional shape created from six retangular faces, each at right angles to another, and opposite faces are equal. |
| - | {{ : | + | {{ : |
| // | // | ||
| - | Cubes can be created at a requested center. | + | The '' |
| Defaults: | Defaults: | ||
| - | * size : 1 or [1,1,1] | + | * size : [2, 2, 2] |
| - | * center : [0,0,0] | + | * center : [0, 0, 0] |
| - | * radius : 0 | + | |
| - | * round: false | + | |
| <code javascript> | <code javascript> | ||
| - | cube({size: 1}) | + | const { cuboid |
| - | cube({size: [1,2,3]}) | + | |
| - | cube({size: 1, center: true}) // default center: | + | const myshape = cuboid({size: [1, 2, 3]}) |
| - | cube({size: 1, center: [false,false, | + | const myshape = cuboid({size: |
| - | cube({size: [1,2,3], round: true}) | + | |
| </ | </ | ||
| - | Also, the CSG library functions can be used directly. //NOTE Deprecated in the V2 API// | + | === Cube === |
| + | |||
| + | {{ : | ||
| + | |||
| + | The **cube** is a special case of the cuboid in which all six faces are squares. | ||
| + | |||
| + | Defaults: | ||
| + | * size : 2 | ||
| + | * center : [0, 0, 0] | ||
| <code javascript> | <code javascript> | ||
| - | CSG.cube({ | + | const { cube } = require(' |
| - | center: [0, 0, 0], | + | |
| - | radius: [1, 1, 1] | + | |
| - | }) | + | |
| - | CSG.cube({ | + | const myshape = cube({size: 3}) |
| - | | + | const myshape = cube({size: 3, center: [4, 5, 6]}) |
| - | corner2: [5, 4, 2] | + | |
| - | }) | + | |
| </ | </ | ||
| - | Rounded | + | === Rounded |
| + | |||
| + | {{ : | ||
| + | |||
| + | Rounded cuboids can be created by specifying a '' | ||
| + | |||
| + | Defaults: | ||
| + | * size : [2, 2, 2] | ||
| + | * center : [0, 0, 0] | ||
| + | * roundRadius : 0.2 | ||
| + | * segments : 32 | ||
| <code javascript> | <code javascript> | ||
| - | CSG.roundedCube({ // rounded cube | + | const { roundedCuboid } = require(' |
| - | | + | |
| - | | + | const myshape = roundedCuboid({size: [1, 2, 3], roundRadius: |
| - | roundradius: 0.9, | + | const myshape = roundedCuboid({size: [1, 2, 3], roundRadius: 0.25, center: [4, 5, 6], segments: 32}) |
| - | resolution: 8, | + | |
| - | }); | + | |
| </ | </ | ||