Skip to main content

sew_rotated_copies

Function sew_rotated_copies 

Source
pub fn sew_rotated_copies(
    cell: &BrepSolid,
    kept_faces: &[u64],
    axis_origin: Vec3,
    axis_direction: Vec3,
    step: f64,
    count: usize,
    tolerance: f64,
) -> Result<(BrepSolid, SewReport, Vec<Vec<u64>>), KernelRefusal>
Expand description

Sew count copies of cell’s faces kept_faces, copy k turned by k · step (radians, right-handed about axis_direction) about the axis through axis_origin, into one solid: the faces left out are the cell’s faces on the surfaces dividing it from its neighbours, where a copy meets the next. The soup is the cell’s kept faces per copy, ids offset per copy by one span past the cell’s largest id (copy k by (k + 1) · span), with the edges and vertices they use, sewn as sew_solid sews. Beside the solid and its report, the result’s face ids by copy (copy k at index k, each in the cell’s face order).

The orientation: with BREP_SEW_PATTERN_SIGN (default on) and count · step one full turn, it is read from one copy ([sew_sign_by_pattern]), else as sew_solid reads it. About the z axis through the origin each turn is the matrix [c −s 0 0; s c 0 0; 0 0 1 0] of (s, c) = (k·step).sin_cos().

Refused: a cell that is not a plain solid of one shell (a cellular body’s regions would name the cell’s ids), no kept face, a kept id the cell lacks, a zero count, a non-finite or zero axis, a non-finite step, or ids too large for count + 1 spans.