module:extras/pathtomesh
### module:extras/pathtomesh()
The extras/pathtomesh.js
module.
To import all symbols in this module, either of the following can be used:
import * from "extras/pathtomesh.js"; // -- or -- import * as CustomModuleName from "extras/pathtomesh.js";
Methods
- toExtrudedMeshBuffer
Generates a mesh buffer consisting of “walls” that follow this graphics path approximately, and, optionally, a base and top. - toLineMeshBuffer
Generates a mesh buffer consisting of the approximate line segments that make up this graphics path. - toMeshBuffer
Decomposes this path into triangles and generates a mesh buffer with those triangles.
### (static) module:extras/pathtomesh.toExtrudedMeshBuffer(zStart, zEnd, [flatness], [closed])
Generates a mesh buffer consisting of “walls” that follow this graphics path approximately, and, optionally, a base and top.
Parameters
zStart
(Type: number)
Starting z-coordinate of the mesh buffer’s “walls”.zEnd
(Type: number)
Ending z-coordinate of the mesh buffer’s “walls”.flatness
(Type: number) (optional)
When curves and arcs are decomposed to line segments, the segments will be close to the true path of the curve by this value, given in units. If null, undefined, or omitted, default is 1.closed
(Type: boolean) (optional)
If true, the generated mesh buffer will include a base and top. If null, undefined, or omitted, the default is false.
Return Value
The resulting mesh buffer. (Type: *)
### (static) module:extras/pathtomesh.toLineMeshBuffer([z], [flatness])
Generates a mesh buffer consisting of the approximate line segments that make up this graphics path.
Parameters
z
(Type: number) (optional)
The z-coordinate for each line segment. If null, undefined, or omitted, the default is 0.flatness
(Type: number) (optional)
When curves and arcs are decomposed to line segments, the segments will be close to the true path of the curve by this value, given in units. If null, undefined, or omitted, default is 1.
Return Value
The resulting mesh buffer. (Type: *)
### (static) module:extras/pathtomesh.toMeshBuffer([z], [flatness])
Decomposes this path into triangles and generates a mesh buffer with those triangles. Each triangle’s normal will point toward the z-axis, and each triangle vertex’s texture coordinates will be the same as that vertex’s position.
Parameters
z
(Type: number) (optional)
The z-coordinate of each triangle generated. If null, undefined, or omitted, default is 0.flatness
(Type: number) (optional)
When curves and arcs are decomposed to line segments, the segments will be close to the true path of the curve by this value, given in units. If null, undefined, or omitted, default is 1.
Return Value
The resulting mesh buffer. (Type: *)