From 6e74cc48d89b58d76679883831e934a9100c598c Mon Sep 17 00:00:00 2001
From: ramox81 <184937705+ramox81@users.noreply.github.com>
Date: Fri, 11 Sep 2026 10:57:23 +0300
Subject: [PATCH] Recreate hatch boundaries as exact regions
---
src/app/command_driver.rs | 18 +++++++++++++++---
src/command.rs | 2 +-
src/modules/draw/draw/hatchedit.rs | 19 +++++++++++++------
src/scene/model/presspull_model.rs | 6 +++++-
4 files changed, 34 insertions(+), 11 deletions(-)
diff --git a/src/app/command_driver.rs b/src/app/command_driver.rs
index 2fa61e4f6..16be1a02c 100644
--- a/src/app/command_driver.rs
+++ b/src/app/command_driver.rs
@@ -4650,7 +4650,7 @@ impl OpenCADStudio {
let valid_handles:Vec<_>=sources.keys().copied().collect();
self.tabs[i].scene.edit_hatch_boundary_handles(handle,&valid_handles,true);
}
- HatchEditOperation::RecreateBoundary { associate } => {
+ HatchEditOperation::RecreateBoundary { associate, region } => {
let source = self.tabs[i].scene.document.get_entity(handle).cloned();
if let Some(acadrust::EntityType::Hatch(source)) = source {
let storage = crate::entities::curve::ocs_plane(
@@ -4662,8 +4662,20 @@ impl OpenCADStudio {
glam::DVec3::from_array(storage.x_axis),
glam::DVec3::from_array(storage.y_axis),
);
- let rings = crate::scene::hatch_boundary_rings(&source);
- let entities = crate::scene::boundary_entities(&rings, plane);
+ let entities = if region {
+ let entities = source.paths.iter().map(|path| {
+ let curves = path.edges.iter().map(crate::entities::hatch::edge_curve).collect::