Skip to content

Shapemetry API


Shapemetry API / Compound

Class: Compound

Defined in: nurbsBrep/topo/Compound.ts:17

A topological compound: a group of solids.

Compounds allow treating multiple disjoint solids as a single modelling entity (e.g. the result of a boolean split).

Constructors

Constructor

new Compound(solids): Compound

Defined in: nurbsBrep/topo/Compound.ts:22

Parameters

solids

Solid[]

Returns

Compound

Properties

index

readonly index: number

Defined in: nurbsBrep/topo/Compound.ts:18


solids

solids: Solid[]

Defined in: nurbsBrep/topo/Compound.ts:20

The solids contained in this compound.

Accessors

solidCount

Get Signature

get solidCount(): number

Defined in: nurbsBrep/topo/Compound.ts:52

Number of solids in this compound.

Returns

number

Methods

fromStep()

static fromStep(content): Compound

Defined in: nurbsBrep/topo/Compound.ts:32

Read every solid body of a STEP AP203 file into one compound — the loss-free way to import a multi-body assembly (where Solid.fromStep reads a single body and rejects multi-body files).

Parameters

content

string

Returns

Compound


toStep()

toStep(): string

Defined in: nurbsBrep/topo/Compound.ts:37

Serialize every body of this compound into one multi-body STEP document.

Returns

string


equals()

equals(other): boolean

Defined in: nurbsBrep/topo/Compound.ts:42

Identity comparison (two handles refer to the same compound).

Parameters

other

Compound

Returns

boolean


explode()

explode(): Solid[]

Defined in: nurbsBrep/topo/Compound.ts:47

Return a shallow copy of the solids array.

Returns

Solid[]


boundingBox()

boundingBox(): BoundingBox

Defined in: nurbsBrep/topo/Compound.ts:57

Compute the union of all solid bounding boxes.

Returns

BoundingBox


fuseAll()

fuseAll(): Solid

Defined in: nurbsBrep/topo/Compound.ts:80

Fuse (union) all solids into a single solid. Only disjoint solids are supported: merges their shells into one multi-lump solid. Overlapping solids require the boolean module (not available); call solid.union() directly.

Returns

Solid