Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion main/opengeometry/src/analytic/booleans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ use crate::{
};
use serde::{Deserialize, Serialize};

mod cylinder_half_space;

#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum BooleanOp {
Expand Down Expand Up @@ -5162,7 +5164,32 @@ fn cylinder_box_boolean(
.exchange
.max(box_.brep.accuracy.exchange),
};
perpendicular_cylinder_box_boolean(&box_, &cylinder, cylinder_is_a, operation, id, accuracy)
match perpendicular_cylinder_box_boolean(
&box_,
&cylinder,
cylinder_is_a,
operation,
id.clone(),
accuracy,
) {
Err(error @ GeometryError::CoverageGap { .. }) => {
match cylinder_half_space::cylinder_half_space_boolean(
&box_,
&cylinder,
cylinder_is_a,
operation,
id,
accuracy,
) {
// Keep only results and deliberate resolution limits; any
// other failure leaves the original error so the generic
// fallbacks still run.
result @ (Ok(_) | Err(GeometryError::UnresolvedIntersection(_))) => result,
Err(_) => Err(error),
}
}
result => result,
}
}

fn cylinder_source(input: &CylinderInput<'_>, face: u32) -> FaceSource {
Expand Down
Loading
Loading