Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
+ fixes #1537: python function to apply a placement to a shape
  • Loading branch information
5263 authored and yorikvanhavre committed May 19, 2014
1 parent bddb6f9 commit 27a2e52
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Mod/OpenSCAD/OpenSCADUtils.py
Expand Up @@ -555,3 +555,21 @@ def addsubobjs(obj,toremoveset):
checkinlistcomplete = True
for obj in toremove:
obj.Document.removeObject(obj.Name)

def applyPlacement(shape):
if shape.Placement.isNull():
return shape
else:
import Part
if shape.ShapeType == 'Solid':
return Part.Solid(shape.childShapes()[0])
elif shape.ShapeType == 'Face':
return Part.Face(shape.childShapes())
elif shape.ShapeType == 'Compound':
return Part.Compound(shape.childShapes())
elif shape.ShapeType == 'Wire':
return Part.Wire(shape.childShapes())
elif shape.ShapeType == 'Shell':
return Part.Shell(shape.childShapes())
else:
raise ValueError('Unsupported shape type')

0 comments on commit 27a2e52

Please sign in to comment.