Divooka Reference

CAD Shape Builder

24 nodes

On this page 24

Make CAD Shape Builder

Function

Creates an empty session with a fixed, positive modeling tolerance.

Signature
CadShapeBuilder(tolerance: Number) -> Cad Shape Builder
CadShapeBuilder CadShapeBuilder(double tolerance = 1E-06)

Parameters

nametypedefaultdescription
toleranceNumber1E-06

Returns

CAD Shape BuilderCad Shape Builder
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Shape Builder
Package
CAD

Add

Function

Adds a shape by union.

Signature
Add(Cad Shape Builder: Cad Shape Builder, shape: Cad Shape)
void Add(CadShapeBuilder Cad Shape Builder, CadShape shape)

Parameters

nametypedefaultdescription
Cad Shape BuilderCad Shape Builder—
shapeCad Shape—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Shape Builder
Package
CAD

Build

Function

Returns the shape drawn so far.

Signature
Build(Cad Shape Builder: Cad Shape Builder) -> Cad Shape
CadShape Build(CadShapeBuilder Cad Shape Builder)

Parameters

nametypedefaultdescription
Cad Shape BuilderCad Shape Builder—

Returns

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

Clear

Function

Removes everything drawn.

Signature
Clear(Cad Shape Builder: Cad Shape Builder)
void Clear(CadShapeBuilder Cad Shape Builder)

Parameters

nametypedefaultdescription
Cad Shape BuilderCad Shape Builder—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Shape Builder
Package
CAD

Cut

Function

Takes a shape away from everything drawn so far.

Signature
Cut(Cad Shape Builder: Cad Shape Builder, shape: Cad Shape)
void Cut(CadShapeBuilder Cad Shape Builder, CadShape shape)

Parameters

nametypedefaultdescription
Cad Shape BuilderCad Shape Builder—
shapeCad Shape—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Shape Builder
Package
CAD

Difference

Function

Adds the first child of a block less every other: OpenSCAD's difference() { ... } of 2D children.

Signature
Difference
    Cad Shape Builder: Cad Shape Builder
    children: Action<Cad Shape Builder>
void Difference(
    CadShapeBuilder Cad Shape Builder,
    Action<CadShapeBuilder> children)

Parameters

nametypedefaultdescription
Cad Shape BuilderCad Shape Builder—
childrenAction<Cad Shape Builder>—The block, given a flat session of its own.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Shape Builder
Package
CAD

Fill

Function

Adds what a block draws without its holes: OpenSCAD's fill() { ... }.

Signature
Fill
    Cad Shape Builder: Cad Shape Builder
    children: Action<Cad Shape Builder>
void Fill(
    CadShapeBuilder Cad Shape Builder,
    Action<CadShapeBuilder> children)

Parameters

nametypedefaultdescription
Cad Shape BuilderCad Shape Builder—
childrenAction<Cad Shape Builder>—The block, given a flat session of its own.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Shape Builder
Package
CAD

Children

Function

The children added so far, in order, each placed.

Signature
Children(Cad Shape Builder: Cad Shape Builder) -> Cad Shape Array
CadShape[] Children(CadShapeBuilder Cad Shape Builder)

Parameters

nametypedefaultdescription
Cad Shape BuilderCad Shape Builder—

Returns

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

Current

Function

The shape drawn so far.

Signature
Current(Cad Shape Builder: Cad Shape Builder) -> Cad Shape
CadShape Current(CadShapeBuilder Cad Shape Builder)

Parameters

nametypedefaultdescription
Cad Shape BuilderCad Shape Builder—

Returns

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

Tolerance

Function

The tolerance used by the session's booleans, in model units.

Signature
Tolerance(Cad Shape Builder: Cad Shape Builder) -> Number
double Tolerance(CadShapeBuilder Cad Shape Builder)

Parameters

nametypedefaultdescription
Cad Shape BuilderCad Shape Builder—

Returns

resultNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Shape Builder
Package
CAD

Hull

Function

Adds the convex hull of everything a block draws: OpenSCAD's hull() { ... } of 2D children (Cad2D.Hull), exact.

Signature
Hull
    Cad Shape Builder: Cad Shape Builder
    children: Action<Cad Shape Builder>
void Hull(
    CadShapeBuilder Cad Shape Builder,
    Action<CadShapeBuilder> children)

Parameters

nametypedefaultdescription
Cad Shape BuilderCad Shape Builder—
childrenAction<Cad Shape Builder>—The block, given a flat session of its own.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Shape Builder
Package
CAD

Intersect

Function

Keeps only what everything drawn so far has in common with a shape.

Signature
Intersect
    Cad Shape Builder: Cad Shape Builder
    shape: Cad Shape
void Intersect(
    CadShapeBuilder Cad Shape Builder,
    CadShape shape)

Parameters

nametypedefaultdescription
Cad Shape BuilderCad Shape Builder—
shapeCad Shape—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Shape Builder
Package
CAD

Intersection

Function

Adds what every child of a block has in common: OpenSCAD's intersection() { ... } of 2D children.

Signature
Intersection
    Cad Shape Builder: Cad Shape Builder
    children: Action<Cad Shape Builder>
void Intersection(
    CadShapeBuilder Cad Shape Builder,
    Action<CadShapeBuilder> children)

Parameters

nametypedefaultdescription
Cad Shape BuilderCad Shape Builder—
childrenAction<Cad Shape Builder>—The block, given a flat session of its own.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Shape Builder
Package
CAD

Minkowski

Function

Adds the Minkowski sum of everything a block draws, each child added to the next: OpenSCAD's minkowski() { ... } of 2D children (Cad2D.Minkowski).

Signature
Minkowski
    Cad Shape Builder: Cad Shape Builder
    children: Action<Cad Shape Builder>
void Minkowski(
    CadShapeBuilder Cad Shape Builder,
    Action<CadShapeBuilder> children)

Parameters

nametypedefaultdescription
Cad Shape BuilderCad Shape Builder—
childrenAction<Cad Shape Builder>—The block, given a flat session of its own.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Shape Builder
Package
CAD

Mirror

Function

Adds what a block draws, mirrored in the line through the origin square to a direction: OpenSCAD's mirror([x, y]) { ... }.

Signature
Mirror
    Cad Shape Builder: Cad Shape Builder
    normalX: Number
    normalY: Number
    children: Action<Cad Shape Builder>
void Mirror(
    CadShapeBuilder Cad Shape Builder,
    double normalX,
    double normalY,
    Action<CadShapeBuilder> children)

Parameters

nametypedefaultdescription
Cad Shape BuilderCad Shape Builder—
normalXNumber—The mirror line's normal, along X.
normalYNumber—Along Y.
childrenAction<Cad Shape Builder>—The block, given a flat session of its own.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Shape Builder
Package
CAD

Offset

Function

Adds what a block draws, grown or shrunk with round corners: OpenSCAD's offset(r) { ... }.

Signature
Offset
    Cad Shape Builder: Cad Shape Builder
    radius: Number
    children: Action<Cad Shape Builder>
void Offset(
    CadShapeBuilder Cad Shape Builder,
    double radius,
    Action<CadShapeBuilder> children)

Parameters

nametypedefaultdescription
Cad Shape BuilderCad Shape Builder—
radiusNumber—How far: positive grows, negative shrinks.
childrenAction<Cad Shape Builder>—The block, given a flat session of its own.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Shape Builder
Package
CAD

Offset Delta

Function

Adds what a block draws, grown or shrunk with sharp or cut corners: OpenSCAD's offset(delta, chamfer) { ... }.

Signature
OffsetDelta
    Cad Shape Builder: Cad Shape Builder
    delta: Number
    chamfer: Truth
    children: Action<Cad Shape Builder>
void OffsetDelta(
    CadShapeBuilder Cad Shape Builder,
    double delta,
    bool chamfer,
    Action<CadShapeBuilder> children)

Parameters

nametypedefaultdescription
Cad Shape BuilderCad Shape Builder—
deltaNumber—How far: positive grows, negative shrinks.
chamferTruth—Cut the corners across.
childrenAction<Cad Shape Builder>—The block, given a flat session of its own.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Shape Builder
Package
CAD

Projection

Function

Adds the shadow of what a 3D block builds on the XY plane, or with Cut the cut through it at Z = 0: OpenSCAD's projection(cut) { ... } (Cad.Projection).

Signature
Projection
    Cad Shape Builder: Cad Shape Builder
    cut: Truth
    children: Action<Cad Builder>
void Projection(
    CadShapeBuilder Cad Shape Builder,
    bool cut,
    Action<CadBuilder> children)

Parameters

nametypedefaultdescription
Cad Shape BuilderCad Shape Builder—
cutTruth—Whether to cut at Z = 0 rather than cast the whole shadow.
childrenAction<Cad Builder>—The block, given a 3D session of its own.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Shape Builder
Package
CAD

Resize

Function

Adds what a block draws, scaled about the origin to a size: OpenSCAD's resize([x, y], auto) { ... }.

Signature
Resize
    Cad Shape Builder: Cad Shape Builder
    width: Number
    height: Number
    auto: Truth
    children: Action<Cad Shape Builder>
void Resize(
    CadShapeBuilder Cad Shape Builder,
    double width,
    double height,
    bool auto,
    Action<CadShapeBuilder> children)

Parameters

nametypedefaultdescription
Cad Shape BuilderCad Shape Builder—
widthNumber—The new width; zero to leave it.
heightNumber—The new height; zero to leave it.
autoTruth—Scale a direction given zero with the other.
childrenAction<Cad Shape Builder>—The block, given a flat session of its own.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Shape Builder
Package
CAD

Rotate

Function

Adds what a block draws, turned about the origin counter-clockwise: OpenSCAD's rotate(a) { ... }, in radians.

Signature
Rotate
    Cad Shape Builder: Cad Shape Builder
    angle: Number
    children: Action<Cad Shape Builder>
void Rotate(
    CadShapeBuilder Cad Shape Builder,
    double angle,
    Action<CadShapeBuilder> children)

Parameters

nametypedefaultdescription
Cad Shape BuilderCad Shape Builder—
angleNumber—How far, in radians.
childrenAction<Cad Shape Builder>—The block, given a flat session of its own.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Shape Builder
Package
CAD

Scale

Function

Adds what a block draws, scaled about the origin: OpenSCAD's scale([x, y]) { ... }.

Signature
Scale
    Cad Shape Builder: Cad Shape Builder
    x: Number
    y: Number
    children: Action<Cad Shape Builder>
void Scale(
    CadShapeBuilder Cad Shape Builder,
    double x,
    double y,
    Action<CadShapeBuilder> children)

Parameters

nametypedefaultdescription
Cad Shape BuilderCad Shape Builder—
xNumber—The factor along X.
yNumber—The factor along Y.
childrenAction<Cad Shape Builder>—The block, given a flat session of its own.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Shape Builder
Package
CAD

Slice

Function

Adds the cut through what a 3D block builds at Z = 0: OpenSCAD's projection(cut = true) { ... }.

Signature
Slice
    Cad Shape Builder: Cad Shape Builder
    children: Action<Cad Builder>
void Slice(
    CadShapeBuilder Cad Shape Builder,
    Action<CadBuilder> children)

Parameters

nametypedefaultdescription
Cad Shape BuilderCad Shape Builder—
childrenAction<Cad Builder>—The block, given a 3D session of its own.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Shape Builder
Package
CAD

Translate

Function

Adds what a block draws, moved: OpenSCAD's translate([x, y]) { ... }.

Signature
Translate
    Cad Shape Builder: Cad Shape Builder
    x: Number
    y: Number
    children: Action<Cad Shape Builder>
void Translate(
    CadShapeBuilder Cad Shape Builder,
    double x,
    double y,
    Action<CadShapeBuilder> children)

Parameters

nametypedefaultdescription
Cad Shape BuilderCad Shape Builder—
xNumber—How far along X.
yNumber—How far along Y.
childrenAction<Cad Shape Builder>—The block, given a flat session of its own.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
CAD Shape Builder
Package
CAD

Begin

Function

Creates an empty flat session from a graph node.

Signature
Begin(tolerance: Number) -> Cad Shape Builder
CadShapeBuilder Begin(double tolerance = 1E-06)

Parameters

nametypedefaultdescription
toleranceNumber1E-06

Returns

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