From afaf1e885955efb39428abb6000c697728cae708 Mon Sep 17 00:00:00 2001 From: "Soroosh.Mani" Date: Tue, 5 Dec 2023 11:56:39 -0500 Subject: [PATCH] Remove low-res elements in hi-res region --- ocsmesh/cli/subset_n_combine.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ocsmesh/cli/subset_n_combine.py b/ocsmesh/cli/subset_n_combine.py index c225670..c442314 100755 --- a/ocsmesh/cli/subset_n_combine.py +++ b/ocsmesh/cli/subset_n_combine.py @@ -634,8 +634,8 @@ def _main( # Attach overlaps to buffer region (due to 1 layer and upstream) - poly_seam_4, jig_clip_hires = self._add_overlap_to_polygon(jig_clip_hires_0, poly_seam_3) - poly_seam_5, jig_clip_lowres = self._add_overlap_to_polygon(jig_clip_lowres_0, poly_seam_4) + poly_seam_4, jig_clip_hires_1 = self._add_overlap_to_polygon(jig_clip_hires_0, poly_seam_3) + poly_seam_5, jig_clip_lowres_1 = self._add_overlap_to_polygon(jig_clip_lowres_0, poly_seam_4) # Cleanup buffer shape poly_seam_6 = utils.remove_holes_by_relative_size( @@ -647,8 +647,13 @@ def _main( _logger.info("Calculate reclipped polygons...") start = time() + jig_clip_hires = jig_clip_hires_1 poly_clip_hires = utils.remove_holes( utils.get_mesh_polygons(jig_clip_hires)) + + jig_clip_lowres = utils.clip_mesh_by_shape( + jig_clip_lowres_1, poly_clip_hires, + fit_inside=False, inverse=True) poly_clip_lowres = utils.get_mesh_polygons(jig_clip_lowres) _logger.info(f"Done in {time() - start} sec")