Merge pull request #1181 from ramox81/codex/complete-region-support

# Conflicts:
#	src/app/commands/draw.rs
This commit is contained in:
Hakan Seven committed 2026-09-11 12:26:53 +03:00
commit 50c5e18c75
1 file changed
+12 -5
+12 -5
View File
@@ -1340,7 +1340,9 @@ impl OpenCADStudio {
.filter(|(handle, _)| !sources.contains(handle))
.filter_map(|(_, entity)| crate::entities::curve::entity_curve(entity))
.collect();
if let Some(plane) = cadkernel::space::common_curve_plane(&open_curves, 1.0e-6) {
let open_plane = cadkernel::space::common_curve_plane(&open_curves, 1.0e-6);
let open_plane_rejected = !open_curves.is_empty() && open_plane.is_none();
if let Some(plane) = open_plane {
let working_plane = crate::command::WorkingPlane::new(
glam::DVec3::from_array(plane.origin),
glam::DVec3::from_array(plane.x_axis),
@@ -1371,12 +1373,17 @@ impl OpenCADStudio {
regions.push((region, body));
sources.extend(crate::scene::ring_source_handles(&ring, &boundary_sources));
}
} else if !open_curves.is_empty() {
self.command_line.push_error("REGION: open objects must form coplanar, noncollinear boundaries.");
} else if open_plane_rejected {
self.command_line.push_error(
"REGION: open objects must form coplanar, noncollinear boundaries.",
);
}
if regions.is_empty() {
self.command_line
.push_error("REGION: select closed planar profiles or connected coplanar edges.");
if !open_plane_rejected {
self.command_line.push_error(
"REGION: select closed planar profiles or connected coplanar edges.",
);
}
} else {
self.push_undo_snapshot(i, "REGION");
let count = regions.len();