From 5fca85424d1776c0d4e5b2261eb235b038843f11 Mon Sep 17 00:00:00 2001 From: Ondrej Sychrovsky Date: Mon, 8 Jan 2024 23:20:22 +0100 Subject: [PATCH 1/2] Add solution to cases where the two parts for the cross part are not the same height but start on the same plane. --- lasercut/crosspart.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lasercut/crosspart.py b/lasercut/crosspart.py index 722cb47..33166a2 100644 --- a/lasercut/crosspart.py +++ b/lasercut/crosspart.py @@ -368,6 +368,22 @@ def make_cross_parts(parts): and not first_face_second_shape and second_face_second_shape: #print str_parts_name + " : a part is above the other (2)" remove_intersections(first_part, second_part, referential_faces, axis, True) + elif not first_face_first_shape and not second_face_first_shape \ + and first_face_second_shape and not second_face_second_shape: + # Case where face 2 is common base and shape 2 is higher + remove_intersections(first_part, second_part, referential_faces, axis) + elif first_face_first_shape and not second_face_first_shape \ + and not first_face_second_shape and not second_face_second_shape: + # Cae where face 2 is common base and shape 1 is higher + remove_intersections(first_part, second_part, referential_faces, axis, True) + elif not first_face_first_shape and second_face_first_shape \ + and not first_face_second_shape and not second_face_second_shape: + # Case where face 1 is common base and shape 1 is higher + remove_intersections(first_part, second_part, referential_faces, axis) + elif not first_face_first_shape and not second_face_first_shape \ + and not first_face_second_shape and second_face_second_shape: + # Case where face 1 is common and shape 2 is higher + remove_intersections(first_part, second_part, referential_faces, axis, True) else: raise ValueError("Not managed") From 206808ae39c1dfe962319f061cbdbe0e5d9277fd Mon Sep 17 00:00:00 2001 From: Ondrej Sychrovsky Date: Tue, 9 Jan 2024 00:11:05 +0100 Subject: [PATCH 2/2] Fix a typo in the comment. --- lasercut/crosspart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lasercut/crosspart.py b/lasercut/crosspart.py index 33166a2..6001cdb 100644 --- a/lasercut/crosspart.py +++ b/lasercut/crosspart.py @@ -374,7 +374,7 @@ def make_cross_parts(parts): remove_intersections(first_part, second_part, referential_faces, axis) elif first_face_first_shape and not second_face_first_shape \ and not first_face_second_shape and not second_face_second_shape: - # Cae where face 2 is common base and shape 1 is higher + # Case where face 2 is common base and shape 1 is higher remove_intersections(first_part, second_part, referential_faces, axis, True) elif not first_face_first_shape and second_face_first_shape \ and not first_face_second_shape and not second_face_second_shape: