pub struct CurveCurveHit {
pub first_parameter: Option<f64>,
pub second_parameter: Option<f64>,
pub point: Point,
pub multiplicity: u32,
}Expand description
One meeting of two 3D curves.
A parameter is stored only when the solver computed it on its way to
the point; the others are None, and the caller recovers one with the
curve’s parameter_of(hit.point) when it needs it.
§Examples
use geomcore::{Circle, Intersect, Point, Tolerance, Vector};
// Two coplanar circles: the solver finds the points, not the angles.
let first = Circle::new(Point::ORIGIN, Vector::Z, 2.0).unwrap();
let second = Circle::new(Point::new(2.0, 0.0, 0.0), Vector::Z, 2.0).unwrap();
let result = first.intersect(&second, Tolerance::DEFAULT);
let hit = result.hits()[0];
assert_eq!(hit.first_parameter, None);
let angle = first.parameter_of(hit.point);
assert!(first.eval_point(angle).distance(hit.point) < 1e-12);Fields§
§first_parameter: Option<f64>Parameter on the first curve, in its bounds or the trimmed curve’s
range: the hit lies within tol.confusion in space of the range,
and a hit just beyond an end (the seam included) reports that end.
None when the solver did not compute it; recover it with the
curve’s parameter_of(hit.point).
second_parameter: Option<f64>Parameter on the second curve, in its bounds or the trimmed curve’s
range, within tol.confusion in space of the range (a hit just
beyond an end reports that end). None when the solver did not
compute it; recover it with the curve’s parameter_of(hit.point).
point: PointThe meeting point, within tolerance of both curves.
multiplicity: u321 where the curves cross, 2 or more where they are tangent.