subtract_2d

Function subtract_2d 

Source
pub fn subtract_2d(
    profile: &Profile2D,
    void_contour: &[Point2<f64>],
) -> Result<Profile2D>
Expand description

Perform 2D boolean difference: profile - void_contour

Takes a profile and subtracts a void contour from it, returning a new profile with the void added as a hole (or modifying the outer boundary if the void cuts through it).

§Arguments

  • profile - The base profile to subtract from
  • void_contour - The void footprint to subtract (any winding; normalised CCW)

§Returns

  • Ok(Profile2D) - The resulting profile with the void subtracted
  • Err - If the operation fails