Fix subcompounding of lattice objects

After implementing an info tool, I noticed lattices are not structured
the way I wanted. Seems like either importing or exporting a brep makes
the shape wrapped into a compound.
Unwrapping manually...
This commit is contained in:
DeepSOIC 2015-10-31 20:14:10 +03:00
parent 5c84bac561
commit 893328f1da

View File

@ -66,6 +66,8 @@ def loadShape(shapeID):
sh = Part.Shape() sh = Part.Shape()
f = open(getShapePath(shapeID + '.brep')) f = open(getShapePath(shapeID + '.brep'))
sh.importBrep(f) sh.importBrep(f)
if sh.ShapeType == "Compound":
sh = sh.childShapes()[0]
f.close() f.close()
except Exception as err: except Exception as err:
FreeCAD.Console.PrintError('Failed to load standard shape "'+shapeID+'". \n' + err.message + '\n') FreeCAD.Console.PrintError('Failed to load standard shape "'+shapeID+'". \n' + err.message + '\n')