diff options
author | Stephen Leger <stephen@3dservices.ch> | 2017-08-03 16:59:40 +0300 |
---|---|---|
committer | Stephen Leger <stephen@3dservices.ch> | 2017-08-04 06:13:39 +0300 |
commit | 00b84551cf7798c402508bce9458a2ed2ca1fc77 (patch) | |
tree | 786d56eb32024f5fa2a6c84f12afbcc7a1e824e2 /archipack/archipack_cutter.py | |
parent | 83e5b12b75643ea5f71a5de40533d82d9179ab2a (diff) |
archipack: thumb generator to replace static thumbs, revert _preset to preset according to talk with ideasman42
Diffstat (limited to 'archipack/archipack_cutter.py')
-rw-r--r-- | archipack/archipack_cutter.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/archipack/archipack_cutter.py b/archipack/archipack_cutter.py index bce82008..ba51b863 100644 --- a/archipack/archipack_cutter.py +++ b/archipack/archipack_cutter.py @@ -40,6 +40,7 @@ class CutterSegment(Line): def __init__(self, p, v, type='DEFAULT'): Line.__init__(self, p, v) self.type = type + self.is_hole = True @property def copy(self): @@ -404,23 +405,29 @@ class CutAblePolygon(): # no points found at all if start < 0: # print("no pt inside") - return + return not keep_inside if not slice_res: # print("slice fails") # found more segments than input # cutter made more than one loop - return + return True if len(store) < 1: if is_inside: # print("not touching, add as hole") - self.holes.append(cutter) - return + if keep_inside: + self.segs = cutter.segs + else: + self.holes.append(cutter) + + return True self.segs = store self.is_convex() + return True + class CutAbleGenerator(): @@ -641,8 +648,7 @@ class ArchipackCutter(): row.prop(self, 'parts_expand', icon="TRIA_DOWN", icon_only=True, text="Parts", emboss=False) box.prop(self, 'n_parts') for i, part in enumerate(self.parts): - if i < self.n_parts: - part.draw(layout, context, i) + part.draw(layout, context, i) else: row.prop(self, 'parts_expand', icon="TRIA_RIGHT", icon_only=True, text="Parts", emboss=False) |