Skip to main content

Module write

Module write 

Source
Expand description

Writing STEP: the document’s products, assemblies, colours, B-rep and construction geometry.

The mirror of the reader, and deliberately written against the same vocabulary: every entity this writer emits is one the reader parses, so writing what was read and reading it back is the honest round-trip test. AP214’s schema name goes in the header; the entities used are the common AP203/AP214/AP242 core.

Geometry is written in world coordinates: every face, edge and vertex is transformed through its occurrence’s own placement chain before it is serialized, and shared nodes are deduplicated per placement: a prism’s bottom and top edge are one node at two locations, and the file needs both. Surfaces the format has no analytic name for (extrusions, revolutions) go out as their exact rational B-spline patches, so nothing is fitted on the way out.

An edge’s pcurves go out with it, as the PCURVEs of a SURFACE_CURVE (a SEAM_CURVE where one face’s surface meets itself along it), wherever the file’s parameterizations are this kernel’s own: the curve and the surface written analytically or as the same spline, in right-handed frames, under a placement that neither scales nor mirrors, and the pcurve a line, a forward conic or a spline, restated over the curve’s parameter where the edge keeps it over a range of its own. Elsewhere the edge carries its curve alone and a reader derives the pcurves.

Functions§

write_step
Write a document as a STEP exchange file.