pub struct Profile<S: Scalar> {
pub curves: Vec<NurbCurve2D<S>>,
pub curve_names: Vec<String>,
pub joint_names: Vec<String>,
}Expand description
A chain of profile curves, with a stable name for every curve and every
joint between them — what extrude and revolve build the names of the
faces, edges and vertices they sweep out of it from (see
geop_core_part’s crate docs). For a sketch these are its element ids;
for a shape built in code, positions in the chain (Profile::closed).
joint_names[i] names the joint where curves[i] starts. A closed loop
has one joint per curve; an open chain one more, its end.
Fields§
§curves: Vec<NurbCurve2D<S>>§curve_names: Vec<String>§joint_names: Vec<String>Implementations§
Source§impl<S: Scalar> Profile<S>
impl<S: Scalar> Profile<S>
Sourcepub fn closed(curves: Vec<NurbCurve2D<S>>) -> Self
pub fn closed(curves: Vec<NurbCurve2D<S>>) -> Self
A closed loop whose curves are called c0, c1, ... and whose joints
p0, p1, ..., p0 where c0 starts.
Sourcepub fn open(curves: Vec<NurbCurve2D<S>>) -> Self
pub fn open(curves: Vec<NurbCurve2D<S>>) -> Self
An open chain, named like Profile::closed plus its end joint.
Sourcepub fn with_prefix(self, prefix: &str) -> Self
pub fn with_prefix(self, prefix: &str) -> Self
The same chain with prefix put in front of every name — to keep
several Profile::closed loops of one extrude apart.
pub fn is_closed(&self) -> bool
Sourcepub fn check_names(&self) -> GeopResult<()>
pub fn check_names(&self) -> GeopResult<()>
Checks that there is one name per curve and one per joint.
Sourcepub fn reversed(&self) -> Self
pub fn reversed(&self) -> Self
The same chain traversed the other way; every name stays with its curve or joint.
Sourcepub fn map_curves(&self, f: impl Fn(&NurbCurve2D<S>) -> NurbCurve2D<S>) -> Self
pub fn map_curves(&self, f: impl Fn(&NurbCurve2D<S>) -> NurbCurve2D<S>) -> Self
The same chain with f applied to every curve, keeping the names.