Skip to main content

rotate_faces

Function rotate_faces 

Source
pub fn rotate_faces(
    solid: &BrepSolid,
    face_ids: &[u64],
    axis_point: Vec3,
    axis_direction: Vec3,
    angle_radians: f64,
) -> Result<BrepSolid, KernelRefusal>
Expand description

ROTATE the faces face_ids of solid by angle_radians about the axis through axis_point along axis_direction (right-handed), re-intersecting the neighbours the rotation moves the selection relative to.

solid is never touched: every refusal below happens before a clone is even made, or on the clone before it is returned, so a refused rotation leaves the caller’s solid exactly as it was.

§Regimes

Rigid — every fixed carrier a boundary vertex touches is invariant under the rotation (carrier_invariant_under). The corner rides by R, the edges map by R exactly, and the fixed faces re-trim around them. This is what makes a cylindrical wall spun about its own axis a no-op that BUILDS.

Re-intersection — otherwise the corner is the common point of the carriers meeting there, with the moved ones ROTATED, and every affected edge is rebuilt between the new corners — straight between planes, and as the EXACT conic wherever a plane meets an oblique cylinder or cone, whichever of the two the rotation turns, or neither, for a fixed edge whose corner rides it. The TURNED side of such a pair is the tilted bore: its mouth is re-intersected in the frame R leaves, and its seam corner rides its own generatrix down to the fixed flat. A quadric meeting a quadric, or a sphere, torus, general revolution or free-form neighbour, refuses by name.

The re-solve only looks at the faces the selection borders, so a rotation that carries it into a face it does not border (a bore’s wall turned until a mouth walks off its cap and out through a side) closes incidence-clean on a body that passes through itself. crate::accept_sound is the floor on the way out of this entry, as it is for crate::move_faces: it repairs where the crossing can be proved and refuses by name where it cannot. rotate_faces_unchecked is the re-solve alone, for a caller that runs its own acceptance on the result.