Divooka Reference

CAD Export

6 nodes

On this page 6

Write3mf

Function

Writes a 3MF package (3D Manufacturing Format, the core specification's model with base materials), the format slicers read colour from: each body one object, a closed mesh tessellated as CadExport.WriteStl tessellates, each triangle in the colour of the face it was cut from, with its alpha. Faces never painted are left in no material and the object takes the slicer's own colour. Unit declares the units of the unchanged coordinates.

Signature
Write3mf
    model: Cad Model
    path: Text
    unit: Length Unit
    quality: Cad Preview Options
void Write3mf(
    CadModel model,
    string path,
    LengthUnit unit = LengthUnit.Millimeter,
    CadPreviewOptions quality)

Parameters

nametypedefaultdescription
modelCad Model—The bodies; each must be a closed solid, as 3MF requires.
pathText—Where to write, overwritten if it is there.
unitLength UnitMillimeterWhat one model unit is.
qualityCad Preview Options—How finely to tessellate; null for the preview's.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Export
Package
CAD

Write Dxf

Function

Writes a flat shape as a DXF drawing, as OpenSCAD exports a 2D object: its boundaries as lines, arcs and polylines on one layer, curves other than lines and arcs followed by polylines within the tolerance (the kernel's DxfWriter).

Signature
WriteDxf(shape: Cad Shape, path: Text, tolerance: Number)
void WriteDxf(
    CadShape shape,
    string path,
    double tolerance = 1E-06)

Parameters

nametypedefaultdescription
shapeCad Shape—The shape.
pathText—Where to write, overwritten if it is there.
toleranceNumber1E-06How far polylines standing in for other curves may stray from them.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Export
Package
CAD

Write Off

Function

Writes the bodies as one OFF file (Object File Format, which OpenSCAD reads and writes), tessellated as CadExport.WriteStl tessellates, each body a closed mesh of shared corners, its faces counter-clockwise seen from outside.

Signature
WriteOff
    model: Cad Model
    path: Text
    quality: Cad Preview Options
void WriteOff(
    CadModel model,
    string path,
    CadPreviewOptions quality)

Parameters

nametypedefaultdescription
modelCad Model—The bodies.
pathText—Where to write, overwritten if it is there.
qualityCad Preview Options—How finely to tessellate; null for the preview's.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Export
Package
CAD

Write Step

Function

Writes all exact B-reps to STEP, retaining disconnected bodies. Unit declares the units of the unchanged coordinates; it does not rescale them.

Signature
WriteStep
    model: Cad Model
    path: Text
    unit: Length Unit
    tolerance: Number
void WriteStep(
    CadModel model,
    string path,
    LengthUnit unit = LengthUnit.Millimeter,
    double tolerance = 1E-06)

Parameters

nametypedefaultdescription
modelCad Model—
pathText—
unitLength UnitMillimeter
toleranceNumber1E-06
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Export
Package
CAD

Write Stl

Function

Writes an explicitly tessellated binary STL. STL has no unit metadata; choose model units before modeling. With no quality given, the model is tessellated as its preview is, at its own scale: chords within 0.1% of its bounding diagonal, 20° between normals.

Signature
WriteStl
    model: Cad Model
    path: Text
    quality: Cad Preview Options
void WriteStl(
    CadModel model,
    string path,
    CadPreviewOptions quality)

Parameters

nametypedefaultdescription
modelCad Model—
pathText—
qualityCad Preview Options—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Export
Package
CAD

Write Svg

Function

Writes a flat shape as an SVG drawing, as OpenSCAD exports a 2D object: one filled path, even-odd so that holes stay holes, in millimetres with Y running up the page as it does in the model, on a page that is the shape's box. Lines, arcs and Béziers are written exactly - lines as lines, arcs as SVG arcs, curves of degree three or less as Béziers - and other curves as lines within the tolerance. An SVG's coordinates are its page's, so read back (CadImport.ReadShape) the shape stands with its box's lower-left corner at the origin; DXF keeps the model's coordinates.

Signature
WriteSvg(shape: Cad Shape, path: Text, tolerance: Number)
void WriteSvg(
    CadShape shape,
    string path,
    double tolerance = 1E-06)

Parameters

nametypedefaultdescription
shapeCad Shape—The shape.
pathText—Where to write, overwritten if it is there.
toleranceNumber1E-06How far lines standing in for other curves may stray from them.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Export
Package
CAD