pub fn seg_split_at_point<T>(
    v1: PlineVertex<T>,
    v2: PlineVertex<T>,
    point_on_seg: Vector2<T>,
    pos_equal_eps: T
) -> SplitResult<T>
where T: Real,
Expand description

Splits a polyline segment defined by v1 to v2 at the point_on_seg given. Assumes the point_on_seg lies on the segment.

§Examples

// arc half circle arc segment going from (0, 0) to (1, 0) counter clockwise
let v1 = PlineVertex::new(0.0, 0.0, 1.0);
let v2 = PlineVertex::new(1.0, 0.0, 0.0);
let point = Vector2::new(0.5, -0.5);
let SplitResult { updated_start, split_vertex } = seg_split_at_point(v1, v2, point, 1e-5);
let quarter_circle_bulge = (std::f64::consts::PI / 8.0).tan();
assert!(updated_start.fuzzy_eq(PlineVertex::new(v1.x, v1.y, quarter_circle_bulge)));
assert!(split_vertex.fuzzy_eq(PlineVertex::new(point.x, point.y, quarter_circle_bulge)));