1

I would like to get the rotation on the X,Y,Z axis and the position of a .STEP object on FreeCAD, and also get screenshots in every position of the object with Python Scripts of FreeCAD.

I saw that we can do it manually (I'm a real beginner on FreeCAD), but it's not what I want.

So I tried this, but it doesn't seems to be the good solution :

>>> for i in range(360):
...     for j in range(360):
...         for k in range(360):
...             FreeCAD.getDocument("mySTEP").getObject("Part_Feature").Placement = App.Placement(App.Vector(0,0,0),App.Rotation(App.Vector(i,j,k),1))

As I said, I want to get screenshots of the object in all its rotations on X,Y and Z and also its position.

Is anyone can help me please?

Thank you

  • Hello everyone, I tried another the solution but the object doesn't move. The code is : `>>> for i in range (360): ... for j in range (360): ... App.getDocument("mySTEP").Part__Feature.Placement=App.Placement(App.Vector(i,j,0), App.Rotation(i,j,0), App.Vector(i,j,0))` – teslaUbuntu Jul 23 '19 at 07:31
  • Not sure if you managed to solve this but I think you'll need to normalise your vectors e.g. `(i,j,k)/sqrt(i^2+j^2+k^2)`, and modify your angular ranges to -180 to +180 degrees so that you cover the negative vector range as well. – airdas Apr 17 '23 at 14:34

0 Answers0