Created
February 20, 2014 11:53
-
-
Save 5263/9111947 to your computer and use it in GitHub Desktop.
exact representation of a FreeCAD placement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def hexplacement(plm): | |
fhex="*[float.fromhex(s) for s in %s]" | |
fstr="FreeCAD.Placement(FreeCAD.Vector(%s),FreeCAD.Rotation(%s))" | |
t=[f.hex() for f in plm.Base] | |
r=[f.hex() for f in plm.Rotation.Q] | |
return fstr % (fhex % t, fhex % r ) | |
if __name__=='__main__': | |
import FreeCAD | |
print hexplacement(FreeCAD.Placement()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment