Iterates over child shapes of a B-Rep shape or shape-based body.
The iterator supports two usage scenarios:
To retrieve direct children of a shape, ShapeIterator should be used as follows:
To retrieve subshapes of a particular type, ShapeIterator should be used by specifying a type of interest as follows:
When using the latter approach, exploration is performed by traversing the graph of subshapes in a depth-first manner. Each subshape will be found as many times as it is registered in the parent subshape.
The order of returned subshapes is deterministic and corresponds to the order in which the subshapes were added during construction.
When constructed from a MeshBody, the iterator is empty because mesh bodies do not expose B-Rep shapes.
Iterable<Shape>new ShapeIterator(
shape,type?):ShapeIterator
Creates an iterator over a shape.
Parent B-Rep shape.
Type of iterated shapes.
ShapeIterator
new ShapeIterator(
body,shapeType?):ShapeIterator
Creates an iterator over a body.
Parent body.
Type of iterated shape.
ShapeIterator
BaseObject.constructor
get id():
bigint
Returns the unique identifier of the object.
bigint
Returns the iterator itself.
Iterable.[iterator]
Returns the next iterated shape.