#[non_exhaustive]pub enum Primitive {
Block {
x: Scalar,
y: Scalar,
z: Scalar,
},
Sphere {
radius: Scalar,
},
Cylinder {
radius: Scalar,
height: Scalar,
},
Cone {
radius: Scalar,
height: Scalar,
},
Pyramid {
x: Scalar,
y: Scalar,
height: Scalar,
},
Torus {
major_radius: Scalar,
minor_radius: Scalar,
},
Wedge {
x: Scalar,
y: Scalar,
height: Scalar,
top_x_min: Scalar,
top_x_max: Scalar,
top_y_min: Scalar,
top_y_max: Scalar,
},
}Expand description
Exact primitive solid; tessellation is a separate operation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Block
Axis-aligned box in local coordinates.
Sphere
Sphere centered at the local origin.
Cylinder
Cylinder along local +z.
Cone
Cone along local +z.
Pyramid
Rectangular pyramid along local +z.
Torus
Ring torus centred on the local origin, about local +z.
The tube’s centre circle has radius major_radius in the plane
z = 0. Only a ring torus, 0 < minor_radius < major_radius, is a
valid solid: at minor == major (a horn torus) the tube pinches the
axis to a point, and past it (a spindle torus) the tube overlaps
itself, so neither bounds a two-manifold solid.
Fields
Wedge
Wedge: a box whose top face is narrowed or shifted, as OCCT’s
BRepPrimAPI_MakeWedge(dx, dy, dz, xmin, zmin, xmax, zmax) with
OCCT’s y (the height) read as local +z here.
The base is the rectangle [0, x] x [0, y] at z = 0 and the top is
[top_x_min, top_x_max] x [top_y_min, top_y_max] at z = height.
Every face is planar and the solid is the convex hull of the two
rectangles. The top may collapse to a segment (top_x_min == top_x_max or top_y_min == top_y_max, a wedge proper) or to a point
(a pyramid with its apex anywhere); OCCT’s ltx form is top_x_min = 0, top_x_max = ltx, top_y_min = 0, top_y_max = y.