Crate scad_tree

Source
Expand description

The scad_tree library is a library for generating OpenSCAD code from Rust.

Notes on usage:

  • 2D profiles for non-OpenSCAD functions/macros are specified by points in clockwise order.
  • Polyhedron faces are specified in clockwise order.

Re-exports§

pub use dim2::BezierStar;
pub use dim2::CubicBezier2D;
pub use dim2::CubicBezierChain2D;
pub use dim2::QuadraticBezier2D;
pub use dim3::CubicBezier3D;
pub use dim3::CubicBezierChain3D;
pub use dim3::Polyhedron;
pub use dim3::QuadraticBezier3D;

Modules§

dim2
Module for the creation of 2D profiles and curves.
dim3
Module for the creation of 3D curves and polyhedrons.
metric_thread
Module for metric threaded rod, nuts and bolts.
prelude
Module for quickly importing library types and macros.

Macros§

circle
Creates a circle.
color
Colors children.
cube
Create a cube.
cylinder
Creates a cylinder.
difference
Constructive Solid Geometry difference operation.
fat_thread
Runs a code block in a separate thread.
hull
Constructive Solid Geometry hull operation.
import
Import a file for use in OpenSCAD
intersection
Constructive Solid Geometry intersection operation.
linear_extrude
Extrude a 2D profile along the Z axis creating a 3D shape.
minkowski
Minkowski sum.
mirror
Mirror object(s).
offset
Offsets a 2D shape.
polygon
Creates a polygon.
polyhedron
Creates a polyhedron.
projection
Create a 2D projection of a 3D object.
resize
Resize an object.
rotate
Rotates children.
rotate_extrude
Create a 3D shape by rotating a 2D profile around the Z axis.
scad_file
Saves Scad objects to a file in a separate thread.
scale
Scale an object.
sphere
Creates a sphere.
square
Creates a square or rectangle.
surface
Loads a height map from a file.
text
Creates text.
translate
Translates children.
union
Constructive Solid Geometry union operation.

Structs§

Indices
Wraps a Vec<u64>.
MersenneTwister
Holds the data for the Mersenne Twister algorithm.
Mt4
A matrix with column major order.
Paths
Paths wrap a Vec<Indices>.
Pipe
Pt2
A 2D point.
Pt3
A 3D point.
Pt4
A 4D point.
Pt2s
Wraps a Vec<Pt2>.
Pt3s
Wraps a Vec<Pt3>.
Pt4s
Wraps a Vec<Pt4>.
Scad
A tree of OpenSCAD operations.
TextParams
Text macro parameters
Viewer
Viewer struct is used to view points, edges, and curves in OpenSCAD.

Enums§

ScadColor
Enum of all the named OpenSCAD colors
ScadOp
The supported OpenSCAD operations.
TextDirection
The possible directions of text.
TextHalign
The ways for horizontal alignment of text.
TextValign
The ways for vertical alignment of text.

Functions§

approx_eq
Returns true if a and b are within epsilon
dacos
Returns the arc-cosine of degrees
dasin
Returns the arc-sine of degrees
datan
Returns the arc-tangent of degrees
dcos
Returns the cosine of degrees
dsin
Returns the sine of degrees
dtan
Returns the tangent of degrees
triangulate2d
Triangulate a 2D polygon.
triangulate2d_rev
Triangulate a 2D polygon with vertices in CCW order.
triangulate3d
Triangulate a 3D polygon
triangulate3d_rev
Triangulate a 3D polygon with vertices in CCW order.

Type Aliases§

Faces
Alias for Paths.