Skip to main content

Module body

Module body 

Source
Expand description

One body of a STEP file — a solid or a sheet — as a BodySpec the kernel builds.

A STEP B-rep and a geop one differ in three ways, and reading one is mostly bridging them:

  • Periodic surfaces. STEP parametrizes a cylinder, cone, sphere or torus all the way round, so a face that wraps around its axis either runs along a seam — one edge its loop uses twice — or is bounded by loops that each go once round. A geop face lies on a NURBS patch that does not wrap: its loops close in the patch’s (u, v). So a wrapping face loses its seam and is cut along meridians into sectors, each on a patch of its own (see [Builder::cut_wrapping_face]); one going round a torus’ tube — a pipe bend’s — is cut along parallels instead ([Builder::cut_tube_wrapping_face]), and a whole torus into bands round its axis first ([Builder::cut_whole_torus]). A face turning about its axis more than once without going round it — a thread’s flank — is cut along meridians too ([Builder::cut_helical_face]).
  • Closed edges. A STEP edge may start and end at one vertex — a whole circle. A geop edge may not, so one is split in two.
  • Tolerance. A STEP file’s vertices, curves and surfaces agree only to within the file’s accuracy. A geop vertex is an enclosure, so each is the union of every place the file says it is: its point, the ends of its edges’ curves, and its foot points on its faces’ surfaces (see AGENTS.md on combining enclosures of one value with union). An edge is widened until it reaches the midpoints of its pcurve’s points on each of its faces. What lies further apart than the kernel’s accuracy is rebuilt from the surfaces, which a B-rep is defined by: a vertex where its faces’ surfaces meet, an edge along where they meet — and where the surfaces themselves contradict each other, the smallest faces there from their edges (see [heal]). The file’s uncertainty bounds it: what is rebuilt lies on its surfaces to within it, and what cannot be is refused, naming the entities and saying how far. What was rebuilt, and how far it moved, is reported (Healing).

Every surface is built as an exact NURBS patch covering its face — or, for a B-spline, taken as it is — oriented so its normal points out of the material, and every pcurve is fitted by projecting the edge onto it (NurbSurface::fit_pcurve), as the kernel fits all its pcurves.

Structs§

Healing
What [heal] rebuilt of a body where its file disagrees with itself further than the kernel can carry, and how far it moved.
ImportedBody
A body read from a file, ready to build: its description, and the name of every entity in it — the arguments a step’s names are made of, as ["f3", "q1"] for the second sector of the file’s fourth face. It serializes exactly, as its body does: what a file read as is kept (geop_core_program::cache).

Functions§

read_body
The body item of the file, as a description to build.