Skip to main content

plane_ruled_section_arc

Function plane_ruled_section_arc 

Source
pub fn plane_ruled_section_arc(
    plane_origin: Vec3,
    plane_normal: Vec3,
    frame: &RevolutionFrame,
    rho0: f64,
    rho1: f64,
    height: f64,
    start_azimuth: f64,
    sweep: f64,
    tolerance: f64,
) -> Result<NurbsCurve, String>
Expand description

The EXACT arc of plane ∩ ruled revolution spanning a given AZIMUTH range about the carrier’s own frame — the arc-restricted, seam-anchorable form of the full sections [intersect_plane_quadric] returns.

ADDITION, not a change: intersect_plane_quadric is untouched and still answers every pair it answered before, bit for bit. This function exists because a direct edit needs the section as an EDGE, not as a carrier section, and an edge has endpoints: a closed rim must START at the face’s own seam vertex (which need not sit at the carrier’s u = 0 — see the push-face seam fix), and an open rim is a sub-arc between two re-solved corners. intersect_plane_quadric always returns the whole section anchored at the frame’s x_axis, so neither is expressible through it.

Both constructions below are the ones that function already uses, and both preserve AZIMUTH — the cylinder’s map adds only an axial component, the cone’s is a central projection from a point ON the axis — so “the arc from azimuth a through sweep” is well defined on the section itself and the anchoring is exact rather than fitted:

  • Cylinder (rho1 ≈ rho0): the section is the AFFINE image of the base circle under the axial shear X ↦ X + axis·(c − n·X)/(n·axis), which is linear in the homogeneous control point, so a rational-quadratic arc maps to a rational-quadratic arc on the SAME knot vector.
  • Cone/frustum: the section is the PROJECTIVE image from the apex, X ↦ apex + (k/((X−apex)·n))·(X−apex), again linear in the homogeneous control point. Weight signs flip for a parabolic/hyperbolic section (the arc crosses the apex plane), and those are refused by name rather than silently mis-built.

sweep must be positive and at most a full turn; a reversed rim is built forward and reversed by the caller, which is what keeps the knot vector the arc construction’s own.