Divooka Reference

CAD Import

3 nodes

On this page 3

Read Mesh

Function

A closed mesh read from a file as an exact solid of flat faces, OpenSCAD's import() of STL, OFF, OBJ and 3MF: corners closer than the tolerance are one corner, triangles in one plane one face, and the faces are built as Cad.Polyhedron builds them - a solid of the kernel's own kind, which the words pick faces of, a fillet rounds and STEP carries. The colours of a 3MF file's triangles are painted on their faces (Cad.Color), and triangles of different colours are never one face. A mesh that does not close round a volume is refused, saying where.

Signature
ReadMesh(path: Text, tolerance: Number, name: Text) -> Cad Model
CadModel ReadMesh(
    string path,
    double tolerance = 1E-06,
    string name = "")

Parameters

nametypedefaultdescription
pathText—The file: .stl (ASCII or binary), .off, .obj or .3mf; every object of a 3MF file is one body.
toleranceNumber1E-06The model's tolerance, in its units: how close corners are to be one.
nameText—What its group is called; empty for "Import".

Returns

resultCad Model
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Import
Package
CAD

Read Shape

Function

A flat shape read from a drawing, OpenSCAD's import() of SVG and DXF.

Signature
ReadShape -> Cad Shape
    path: Text
    layer: Text
    DPI: Number
    tolerance: Number
CadShape ReadShape(
    string path,
    string layer = "",
    double dpi = 96,
    double tolerance = 1E-06)

Parameters

nametypedefaultdescription
pathText—The drawing: .svg or .dxf.
layerText—For a DXF file, the layer to read; empty for every layer.
DPINumber96For an SVG file, how many of its pixels make an inch.
toleranceNumber1E-06The model's tolerance, in its units.

Returns

resultCad Shape
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Import
Package
CAD

Read Step

Function

Reads STEP and converts coordinates to the chosen target unit. Preserves free geometry and import warnings.

Signature
ReadStep -> Cad Import Result
    path: Text
    targetUnit: Length Unit
    tolerance: Number
CadImportResult ReadStep(
    string path,
    LengthUnit targetUnit = LengthUnit.Millimeter,
    double tolerance = 1E-06)

Parameters

nametypedefaultdescription
pathText—
targetUnitLength UnitMillimeter
toleranceNumber1E-06

Returns

resultCad Import Result
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Import
Package
CAD