Quiddity.Part (ExQuiddity v0.1.2)

Copy Markdown View Source

A STEP part, read once and asked about as often as you like.

The struct holds the engine's handle — the parsed B-rep lives in Rust, and the handle is a reference to it — plus the summary that came with it. Nothing here is a copy of the geometry: a Part is a capability to answer questions about one file.

A B-rep is immutable once read, so one handle serves every process on the node at once; that is the sharing the BEAM is built for, and the reason a handle rather than a term is what Quiddity.open/1 answers.

Summary

Functions

The part's bounding box, as {min, max} in millimetres.

The centre of the bounding box, in millimetres.

The part's diagonal, in millimetres: the scale a tolerant question uses.

The extent of the part along each axis, in millimetres.

How many faces the B-rep has — the numbers Quiddity.face/2 takes.

Whether the part is a shell with no solid behind it.

Faces the kernel could not resolve; a ray may pass through one.

Types

t()

@type t() :: %Quiddity.Part{path: Path.t(), ref: reference(), summary: map()}

Functions

bounds(part)

@spec bounds(t()) :: {[float()], [float()]}

The part's bounding box, as {min, max} in millimetres.

centre(part)

@spec centre(t()) :: [float()]

The centre of the bounding box, in millimetres.

diagonal(part)

@spec diagonal(t()) :: float()

The part's diagonal, in millimetres: the scale a tolerant question uses.

extent(part)

@spec extent(t()) :: [float()]

The extent of the part along each axis, in millimetres.

face_count(part)

@spec face_count(t()) :: non_neg_integer()

How many faces the B-rep has — the numbers Quiddity.face/2 takes.

shell?(part)

@spec shell?(t()) :: boolean()

Whether the part is a shell with no solid behind it.

Geometry questions still answer, but "inside" and "outside" do not: a shell has no authority to say which side is material, so a ray's first hit is the only hit that means anything.

unresolved_faces(part)

@spec unresolved_faces(t()) :: [non_neg_integer()]

Faces the kernel could not resolve; a ray may pass through one.