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.

Source:
Example
const { snap } = require('@jscad/modeling').modifiers

Methods

(static) generalize(options) → {Object|Array}

Source:

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

Parameters:
Name Type Description
options Object

options for modifications

Properties
Name Type Attributes Default Description
snap Boolean <optional>
false

the geometries should be snapped to epsilons

simplify Boolean <optional>
false

the geometries should be simplified

triangulate Boolean <optional>
false

the geometries should be triangulated

repair Boolean <optional>
false

the geometries should be repaired

Returns:

the modified geometry, or a list of modified geometries

Type
Object | Array

(static) snap(…geometries) → {Object|Array}

Source:
See:
  • measurements.measureEpsilon()

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

Parameters:
Name Type Attributes Description
geometries Object <repeatable>

the geometries to snap

Returns:

the snapped geometry, or a list of snapped geometries

Type
Object | Array