I have created an object e.g. a PRISM. One of its edges ends at Vertex1 @ Vertex2. The Global coordinates of those two vertexes are known. x1,y1,z1 and x2,y2,z2 . Now on I want to turn the object around this edge using a script like the following. I tried many ways but Rotation still remains to me unpredictable.
Any help please ?
Code: Select all
sel=FreeCADGui.Selection.getSelectionEx()[0]
obj=sel.Object
rot=FreeCAD.Rotation(FreeCAD.Vector(A,B,C), 10)
#centre = FreeCAD.Vector(5,5,0)
pos=obj.Placement.Base
newplace=FreeCAD.Placement(pos,rot)
obj.Placement=newplace
Any idea about the needed values of A,B,C ? Maybe using the centre ? The obj.Placement.Base = Vector (15.0, 25.0, 10.0)