forked from 1b-agent/opencadstudio-upstream
Merge pull request #1181 from ramox81/codex/complete-region-support
# Conflicts: # src/app/commands/draw.rs
This commit is contained in:
commit
50c5e18c75
1 file changed
+12
-5
@@ -1340,7 +1340,9 @@ impl OpenCADStudio {
|
|||||||
.filter(|(handle, _)| !sources.contains(handle))
|
.filter(|(handle, _)| !sources.contains(handle))
|
||||||
.filter_map(|(_, entity)| crate::entities::curve::entity_curve(entity))
|
.filter_map(|(_, entity)| crate::entities::curve::entity_curve(entity))
|
||||||
.collect();
|
.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(
|
let working_plane = crate::command::WorkingPlane::new(
|
||||||
glam::DVec3::from_array(plane.origin),
|
glam::DVec3::from_array(plane.origin),
|
||||||
glam::DVec3::from_array(plane.x_axis),
|
glam::DVec3::from_array(plane.x_axis),
|
||||||
@@ -1371,12 +1373,17 @@ impl OpenCADStudio {
|
|||||||
regions.push((region, body));
|
regions.push((region, body));
|
||||||
sources.extend(crate::scene::ring_source_handles(&ring, &boundary_sources));
|
sources.extend(crate::scene::ring_source_handles(&ring, &boundary_sources));
|
||||||
}
|
}
|
||||||
} else if !open_curves.is_empty() {
|
} else if open_plane_rejected {
|
||||||
self.command_line.push_error("REGION: open objects must form coplanar, noncollinear boundaries.");
|
self.command_line.push_error(
|
||||||
|
"REGION: open objects must form coplanar, noncollinear boundaries.",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if regions.is_empty() {
|
if regions.is_empty() {
|
||||||
self.command_line
|
if !open_plane_rejected {
|
||||||
.push_error("REGION: select closed planar profiles or connected coplanar edges.");
|
self.command_line.push_error(
|
||||||
|
"REGION: select closed planar profiles or connected coplanar edges.",
|
||||||
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
self.push_undo_snapshot(i, "REGION");
|
self.push_undo_snapshot(i, "REGION");
|
||||||
let count = regions.len();
|
let count = regions.len();
|
||||||
|
|||||||
Reference in new issue
Block a user