Crate fidget_shapes

Crate fidget_shapes 

Source
Expand description

Standard library of shapes and transforms

These shapes are designed for use in higher-level languages and tools. Each shape is a single struct with named member variables. The “output” of the shape is always a Tree, and can be generated by calling Tree::from(..). Shape member variables can always be represented by variants of Value (checked by a unit test).

Every shape implements Facet + Clone + Send + Sync + Into<Tree> + 'static. When generating bindings, users are expected to inspect the shape’s type using annotations provided by the facet crate; to iterate over the entire shape library, use ShapeVisitor and visit_shapes.

For an example of binding shapes into a dynamic language, look at the implementation of fidget_rhai::shapes (specifically the internal register_shape function).

Modules§

types
Types used in shape construction

Structs§

Blend
Smooth quadratic blend of two shapes
Box
Box defined by lower and upper corners
Circle
2D circle
Difference
Take the difference of two shapes
ExtrudeZ
Extrude an XY shape in the Z direction
Intersection
Take the intersection of a set of shapes
Inverse
Computes the inverse of a shape
LoftZ
Loft between two XY shape in the Z direction
Move
Move a shape
Rectangle
Rectangle defined by lower and upper corners
Reflect
Reflection
ReflectX
Reflection about the X axis
ReflectY
Reflection about the Y axis
ReflectZ
Reflection about the Z axis
RevolveY
Revolve a shape about the Y axis, creating a 3D volume
Rotate
Rotates an object about an arbitrary axis and rotation center
RotateX
Rotates an object about the X axis
RotateY
Rotates an object about the Y axis
RotateZ
Rotates an object about the Z axis
Scale
Non-uniform scaling
ScaleUniform
Uniform scaling
Sphere
3D sphere
Union
Take the union of a set of shapes

Traits§

ShapeVisitor
Trait for a type which can visit each of the shapes in our library

Functions§

visit_shapes
Maps a shape visitor across all shape definitions