def getPlacement(entity): "returns a placement from the given entity" if DEBUG: print "getting placement ", entity if not entity: return None pl = None if entity.type == "IFCAXIS2PLACEMENT3D": x = getVector(entity.RefDirection) z = getVector(entity.Axis) y = z.cross(x) loc = getVector(entity.Location) m = fcvec.getPlaneRotation(x, y, z) pl = FreeCAD.Placement(m) pl.move(loc) elif entity.type == "IFCLOCALPLACEMENT": pl = getPlacement(entity.PlacementRelTo) relpl = getPlacement(entity.RelativePlacement) if pl and relpl: pl = relpl.multiply(pl) elif relpl: pl = relpl elif entity.type == "IFCCARTESIANPOINT": loc = getVector(entity) pl = FreeCAD.Placement() pl.move(loc) if DEBUG: print "made placement for", entity.id, ":", pl return pl
def getRotation(self): "returns a placement describing the working plane orientation ONLY" m = fcvec.getPlaneRotation(self.u, self.v, self.axis) return FreeCAD.Placement(m)
def getRotation(self): "returns a placement describing the working plane orientation ONLY" m = fcvec.getPlaneRotation(self.u,self.v,self.axis) return FreeCAD.Placement(m)