Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Anonymous
en respuesta a: SEANT61

I am using JavaScript for this development, and I am working completely outside of CAD environment. Project is 90% JavaScript and 10% Java, but help from any programming language is good with me. So far i was able to calculate extrusion vector, below is the python code, hope it might help someone.

 

 

 

 

#rotList = normal vector to the plane from three points
extrution_vector = np.array(rotList)
if abs(extrution_vector[0]) < 1/64 and abs(extrution_vector[1]) < 1/64:
    ax = np.cross((0,1,0), extrution_vector)
else:
    ax = np.cross((0,0,1), extrution_vector)

mx = sum([i**2 for i in ax])**.5   #calculate magnitude of ax
ax = ax * 1/mx   #scale ax to have magnitude 1

ay = np.cross(extrution_vector, ax)
az = extrution_vector