Skip to main content

modifiers

modeling/modifiers

All shapes (primitives or the results of operations) can be modified to correct issues, etc. In all cases, these functions returns the results, and never changes the original geometry.

Example

const { generalize, snap, retessellate } = require('@jscad/modeling').modifiers

modeling/modifiers.generalize(options, ...geometries)

Apply various modifications in proper order to produce a generalized geometry.

Kind: static method of modeling/modifiers
Returns: ObjectArray - the modified geometry, or a list of modified geometries

ParamTypeDefaultDescription
optionsObjectoptions for modifications
[options.snap]Booleanfalsethe geometries should be snapped to epsilons
[options.simplify]Booleanfalsethe geometries should be simplified
[options.triangulate]Booleanfalsethe geometries should be triangulated
...geometriesObjectthe geometries to generalize

modeling/modifiers.snap(...geometries)

Snap the given geometries to the precision (calculated epsilon) of the geometry.

Kind: static method of modeling/modifiers
Returns: ObjectArray - the snapped geometry, or a list of snapped geometries
See: measurements.measureEpsilon()

ParamTypeDescription
...geometriesObjectthe geometries to snap