diff options
-rw-r--r-- | Boxer.py | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -433,21 +433,36 @@ def make(doc, cfg): for e in extrudes.values(): box.addObject(e) - doc.recompute() - views = None cfg.generateViews = True if cfg.generateViews: views = makeShape2DViews(doc, cfg, extrudes) viewsGroup = doc.addObject("App::DocumentObjectGroup", "Views") viewsGroup.Label = 'Views' + pos = Vector(0, 0, 0) + r = Rotation(Vector(0, 0, 1), 0) +# print('pos: ' + str(pos.x)) for sideType in SideType: try: view = views[sideType] +# print('view.Shape.BoundBox: ' + str(view.Shape.BoundBox) + ', .XLength: ' + str(view.Shape.BoundBox.XLength) + ', .Center: ' + str(view.Shape.BoundBox.Center)) + +# if pos.x == 0: +# pos.x += -view.Shape.BoundBox.XMin +# print('first: pos: ' + str(pos.x)) + + view.Placement = Placement(pos, r) +# print('Placement: ' + str(view.Placement.Base) + ', BoundBox: ' + str(view.Shape.BoundBox)) + pos.x += view.Shape.BoundBox.XLength + pos.x += 10 # 10mm spacing between each side viewsGroup.addObject(view) except KeyError: pass + viewsGroup.ViewObject.Visibility = False + + doc.recompute() + return { 'parts': parts, 'extrudes': extrudes, |