Mesh I/O

Loading and saving of files can be done through the FileIO functions load and save.

`FileIO` compatibility

The FileIO module contains a hard-coded central map of file types to modules, and the PLY and STL slots are already taken by MeshIO. In order to be able to register our load functions, the ConstructiveGeometry.__init__ function overrides a couple of entries in FileIO's hash table.

File loading

Files can be loaded in this way:

using FileIO
bust = load("beethoven.ply")

The following formats are supported: .stl (ASCII and binary); .ply (ASCII and little-endian/big-endian binary).

TODO: .dxf

File saving

Files can be saved in this way:

using FileIO
save("foo.stl", object)

The following formats are supported: .stl (ASCII) and .ply (ASCII) for volumes; .svg for shapes.

Note that this saves only the main mesh of the object; any highlighted meshes produced by the highlight operation are discarded.

Image file formats (.png, .pdf) are also supported; they are delegated to Makie's plot function. For these formats the highlighted parts of the object are preserved.

OpenSCAD output

ConstructiveGeometry.scadFunction
scad(io::IO, name::Symbol, parameters, children)
scad(filename::AbstractString, s::AbstractGeometry...)
scad(io::IO, s::AbstractGeometry)

Returns, in printable form (e.g. Symbol or String), the OpenSCAD name of this object.

source
Deprecated

Since the constructions from this package have started to diverge from those of OpenSCAD, (and also since the possibilities for export and visualization have improved), OpenSCAD output is being deprecated and may be removed in a future version. Only those constructions which exists in OpenSCAD are supported (e.g. spheres, but not sweeps).

OpenSCAD to Julia conversion.

Might be possible for a limited subset of OpenSCAD language. TODO (with a low priority).