Cube shape options object that extends OBJ_Generic3All and OBJ_FigurePrimitive
By default, a cube will be constructed around the origin, with the xyz axes being normal to the cube faces.
side
number
1
center
[0, 0]
lines
boolean
true
false
To test examples, append them to the boilerplate
figure.add({ make: 'cube', side: 0.5, color: [1, 0, 0, 1],}); Copy
figure.add({ make: 'cube', side: 0.5, color: [1, 0, 0, 1],});
// 3x3 grid of cubesfigure.add({ make: 'cube', side: 0.2, color: [1, 0, 0, 1], copy: [ { along: 'x', num: 2, step: 0.22 }, { along: 'y', num: 2, step: 0.22 }, { along: 'z', num: 2, step: 0.22 }, ],}); Copy
// 3x3 grid of cubesfigure.add({ make: 'cube', side: 0.2, color: [1, 0, 0, 1], copy: [ { along: 'x', num: 2, step: 0.22 }, { along: 'y', num: 2, step: 0.22 }, { along: 'z', num: 2, step: 0.22 }, ],});
// Wire mesh cubefigure.add({ make: 'cube', side: 0.5, lines: true, color: [1, 0, 0, 1],});@interface Copy
// Wire mesh cubefigure.add({ make: 'cube', side: 0.5, lines: true, color: [1, 0, 0, 1],});@interface
Cube shape options object that extends OBJ_Generic3All and OBJ_FigurePrimitive
By default, a cube will be constructed around the origin, with the xyz axes being normal to the cube faces.
sidenumber— side length (1)centerTypeParsablePoint — center point ([0, 0]) points of cubelinesboolean— iftruethen points representing the 12 edges of the cube will be returned. Iffalse, then points representing two triangles per face (12 triangles, 36 points) and an associated normal for each point will be returned. (false)See
To test examples, append them to the boilerplate
Example
Example
Example