Skip to content

Commit

Permalink
fix: pad up to named face instead of last face
Browse files Browse the repository at this point in the history
feature: allow up to 9 plate high bricks
  • Loading branch information
vectronic committed Mar 15, 2020
1 parent a8a4024 commit edf0645
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions Legify/Body.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def _render_body_pocket(self):

body_pocket_sketch = self.brick.newObject("Sketcher::SketchObject", "body_pocket_sketch")

side_ribs = self.height == 3 and self.depth > 1 and self.width > 1
side_ribs = self.height > 2 and self.depth > 1 and self.width > 1

geometries = []
constraints = []
Expand Down Expand Up @@ -483,7 +483,8 @@ def _render_tube_ribs(self):
front_tube_ribs_sketch.addConstraint(constraints)

front_tube_ribs_pad = self.brick.newObject("PartDesign::Pad", "front_tube_ribs_pad")
front_tube_ribs_pad.Type = PAD_TYPE_TO_LAST
front_tube_ribs_pad.Type = PAD_TYPE_UP_TO_FACE
front_tube_ribs_pad.UpToFace = (self.back_inside_datum_plane, [""])
front_tube_ribs_pad.Profile = front_tube_ribs_sketch
front_tube_ribs_pad.Reversed = 1

Expand Down Expand Up @@ -525,7 +526,8 @@ def _render_tube_ribs(self):
side_tube_ribs_sketch.addConstraint(constraints)

side_tube_ribs_pad = self.brick.newObject("PartDesign::Pad", "side_tube_ribs_pad")
side_tube_ribs_pad.Type = PAD_TYPE_TO_LAST
side_tube_ribs_pad.Type = PAD_TYPE_UP_TO_FACE
side_tube_ribs_pad.UpToFace = (self.right_inside_datum_plane, [""])
side_tube_ribs_pad.Profile = side_tube_ribs_sketch

self.doc.recompute()
Expand Down Expand Up @@ -559,7 +561,8 @@ def _render_tubes(self):
self.depth - 1, self.width - 1, True)

tubes_pad = self.brick.newObject("PartDesign::Pad", "tubes_pad")
tubes_pad.Type = PAD_TYPE_TO_LAST
tubes_pad.Type = PAD_TYPE_UP_TO_FACE
tubes_pad.UpToFace = (self.top_inside_datum_plane, [""])
tubes_pad.Profile = tubes_pad_sketch

self.doc.recompute()
Expand Down Expand Up @@ -646,7 +649,11 @@ def _render_stick_ribs(self):
stick_ribs_sketch.addConstraint(constraints)

stick_ribs_pad = self.brick.newObject("PartDesign::Pad", "stick_ribs_pad")
stick_ribs_pad.Type = PAD_TYPE_TO_LAST
stick_ribs_pad.Type = PAD_TYPE_UP_TO_FACE
if self.width > 1:
stick_ribs_pad.UpToFace = (self.back_inside_datum_plane, [""])
else:
stick_ribs_pad.UpToFace = (self.right_inside_datum_plane, [""])
stick_ribs_pad.Profile = stick_ribs_sketch
if self.width > 1:
stick_ribs_pad.Reversed = 1
Expand Down Expand Up @@ -697,7 +704,8 @@ def _render_sticks(self):
self.depth - 1, 1, True)

sticks_pad = self.brick.newObject("PartDesign::Pad", "sticks_pad")
sticks_pad.Type = PAD_TYPE_TO_LAST
sticks_pad.Type = PAD_TYPE_UP_TO_FACE
sticks_pad.UpToFace = (self.top_inside_datum_plane, [""])
sticks_pad.Profile = sticks_pad_sketch

self.doc.recompute()
Expand Down

0 comments on commit edf0645

Please # to comment.