pub enum Kind {
Coincident,
Concentric,
Parallel,
Perpendicular,
Distance {
value: Scalar,
},
Angle {
value: Scalar,
},
Tangent,
Path,
}Expand description
What a constraint asks of its two features.
Variants§
Coincident
They touch: two points coincide, a point lies on a line or a plane, two lines are one, a line lies in a plane, two planes are one (facing either way).
Concentric
Two lines — axes, as a round edge or face has — are one.
Parallel
Lines and planes run parallel: two lines, two planes’ normals, a line along a plane.
Perpendicular
Lines and planes stand square: two lines, two planes, a line along a plane’s normal.
Distance
They are value apart: two points, a point and a line or a plane,
or two parallel lines or planes, or a line parallel to a plane.
Angle
The lines (or planes’ normals) meet at value degrees.
Tangent
The second entity keeps touching the first, a face, flat or curved: a circle — a roller’s rim, a pin’s — keeps its radius off the face, its center on the face’s offset, a point stays on the face. A cam and its follower, a pin in a slot of any shape.
Path
The second entity — a point, a circle’s center — runs along the first, a curve: a path mate, a pin along a slot’s center line.
Implementations§
Source§impl Kind
impl Kind
pub fn label(&self) -> &'static str
Sourcepub fn feet(&self) -> &'static [&'static str]
pub fn feet(&self) -> &'static [&'static str]
The names of the parameters of the foot point on the first entity
it is kept at, each a value of the state: the curve’s t, the
face’s u and v. None for a kind that keeps no point on a curve
or a face.
Sourcepub fn roles(&self) -> &'static [Role]
pub fn roles(&self) -> &'static [Role]
What an entity of a constraint of this kind can be, in the order its
geometry is taken (see Kind::geometry): for one that touches or
keeps a distance, a point before a line before a plane before a round
face’s axis; for a concentric one, an axis; for one that turns, a
direction.
A flat face is its plane before it is anything round: the cap of a revolved cylinder is a disc, a surface of revolution round the cylinder’s axis, and a part standing on it stands on the plane, not with the axis in it. Only a concentric mate wants the disc’s axis.
Sourcepub fn geometry(
&self,
k: usize,
shape: &Shape,
surface: impl FnOnce() -> GeopResult<Option<NurbSurface3D>>,
curve: impl FnOnce() -> GeopResult<Option<NurbCurve3D>>,
) -> GeopResult<Option<Geometry>>
pub fn geometry( &self, k: usize, shape: &Shape, surface: impl FnOnce() -> GeopResult<Option<NurbSurface3D>>, curve: impl FnOnce() -> GeopResult<Option<NurbCurve3D>>, ) -> GeopResult<Option<Geometry>>
The geometry the kth entity of a constraint of this kind
contributes, shape — as the first of its Kind::roles it fits —
and surface and curve, the wall of a face and the run of an edge,
asked of a tangent’s first and of a path’s first only: of a tangent
constraint, the
face first and then the circle or the point that touches it; of a
path, the curve and then the point that runs along it.