Skip to main content

write_step

Function write_step 

Source
pub fn write_step(
    ir: &CadIr,
    w: &mut (impl Write + ?Sized),
    opts: &StepWriteOptions,
) -> Result<ExportReport, StepError>
Expand description

Serializes an IR document as an ISO 10303-21 STEP Part 21 file for the schema selected by StepWriteOptions::schema.

The output declares that schema and a millimetre length unit. Coordinate values are not rescaled. The IR linear tolerance becomes the representation context’s uncertainty value.

Geometry conversion completes before this function writes the header. Under StepUnsupportedPolicy::Reject, unsupported content returns StepError::Unsupported before any output byte is written. Otherwise the function streams the header, DATA instances, and closing records to w. An I/O error can therefore leave a partial file and returns no report.

On success, the report contains DATA entity counts and loss notes for reductions that the selected schema cannot carry.