Skip to main content

boolean

Function boolean 

Source
pub fn boolean<S: Scalar>(
    part: &mut Part<S>,
    namer: &Namer,
    solid_a: SolidId,
    solid_b: SolidId,
    op: BooleanOp,
    params: RemeshParams<S>,
) -> GeopResult<Option<SolidId>>
Expand description

solid_a combined with solid_b under op, as a new solid in model.

Ok(None) means the result is empty, which is an answer rather than a failure: intersecting two solids that do not overlap, or subtracting a solid that wholly contains the first, legitimately leaves nothing. Callers that treat “no solid” as an error would reject the majority of scenes in this crate’s own test set.

Both input solids are consumed either way: their faces are transferred to the result or deleted, so neither id is valid afterwards.

The result is named namer’s root name, and everything the boolean creates on the way is named as crate::naming describes; every face, edge and vertex it keeps keeps its name.