python code

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
mesutbarut
Posts: 11
Joined: Fri Mar 30, 2018 1:00 pm

python code

Post by mesutbarut »

Hi guys,
ı need a macro program which is the xyz to lra. ı can pay for it.
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: python code

Post by microelly2 »

Can you explain what length rotation angle format means.
without a formula it's not possible to write the macro.
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: python code

Post by Jee-Bee »

User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: python code

Post by microelly2 »

in the first case

Code: Select all

from numpy import arctan2,pi,arccos

a=FreeCAD.Vector(10,10,10*2**0.5)

l=a.Length
r=arctan2(a.x,a.y)*180/pi
a=arccos(a.z/l)*180/pi

l
r
a
Post Reply