File I/O

Two means are provided to read data from files either via the function load or via file specific functions.

Note

To use the unifying function load, the package FileIO is needed.

Step files

To read .step and .stp files containing B-spline surfaces and/or NURBS surfaces the load function and the readStep function is provided.

Note

So far only reading B-spline surfaces (called B_SPLINE_SURFACE_WITH_KNOTS in .step and .stp) and NURBS surfaces (as a BOUNDED_SURFACE() in .step and .stp) is supported. However, reading curves should not be too dificult to implement.

using NURBS, FileIO
Patches = load("assets/torus.stp")

using PlotlyJS
plotPatches(Patches, plotControlPoints=false, resolution=0.25)

Multipatch Files

To read multipatch files as defined and provided by the nurbs Octave implementation and BEMBEL the load function and the readMultipatch function is provided.

Note

Apart from these files the implementation in this package is done independendly from the Octave package. Similarities are accidentally (as it is also based on [1]). Also note, that the Octave package so far provides more functionality.

using NURBS, FileIO
Patches = load("assets/sphere.dat")

using PlotlyJS
plotPatches(Patches, plotControlPoints=true, resolution=0.1)