3D Line options object that extends OBJ_Generic3All and OBJ_FigurePrimitive
A 3D line is a cylinder with optional arrows on the end. Unlike a 2D line, the arrow profiles can only be simple triangles.
To test examples, append them to the boilerplate
// Simple linefigure.add({ make: 'line3', p1: [0, 0, 0], p2: [0, 1, 0], color: [1, 0, 0, 1],}); Copy
// Simple linefigure.add({ make: 'line3', p1: [0, 0, 0], p2: [0, 1, 0], color: [1, 0, 0, 1],});
// Thick line with arrows on both endsfigure.add({ make: 'line3', p1: [0, 0, 0], p2: [0, 1, 0], arrow: { ends: 'all', width: 0.1, length: 0.1 }, sides: 30, width: 0.05, color: [1, 0, 0, 1],}); Copy
// Thick line with arrows on both endsfigure.add({ make: 'line3', p1: [0, 0, 0], p2: [0, 1, 0], arrow: { ends: 'all', width: 0.1, length: 0.1 }, sides: 30, width: 0.05, color: [1, 0, 0, 1],});
// Wire mesh line with arrowfigure.add({ make: 'line3', p1: [0, 0, 0], p2: [0, 1, 0], arrow: { ends: 'end' }, color: [1, 0, 0, 1], lines: true,}); Copy
// Wire mesh line with arrowfigure.add({ make: 'line3', p1: [0, 0, 0], p2: [0, 1, 0], arrow: { ends: 'end' }, color: [1, 0, 0, 1], lines: true,});
// Ball of arrowsfigure.add( { make: 'line3', p1: [0, 0, 0], p2: [0, 0.4, 0], color: [1, 0, 0, 1], width: 0.01, arrow: { end: 'end', width: 0.02 }, copy: [ { along: 'rotation', num: 20, step: Math.PI * 2 / 20 }, { along: 'rotation', axis: [0, 1, 0], num: 20, step: Math.PI * 2 / 20 }, ], },);@interface Copy
// Ball of arrowsfigure.add( { make: 'line3', p1: [0, 0, 0], p2: [0, 0.4, 0], color: [1, 0, 0, 1], width: 0.01, arrow: { end: 'end', width: 0.02 }, copy: [ { along: 'rotation', num: 20, step: Math.PI * 2 / 20 }, { along: 'rotation', axis: [0, 1, 0], num: 20, step: Math.PI * 2 / 20 }, ], },);@interface
3D Line options object that extends OBJ_Generic3All and OBJ_FigurePrimitive
A 3D line is a cylinder with optional arrows on the end. Unlike a 2D line, the arrow profiles can only be simple triangles.
See
To test examples, append them to the boilerplate
Example
Example
Example
Example