0
$\begingroup$

I have some coordinate data generated by an app that I'm generating planes which allows me to visualize in 3d space a path (see screenshot).. Ideally this is good but it would be awesome if I could figure out how to connect each center point of the plane to a curve, that I can then add a camera to which allows me to fly though the path generated.

The code I have generates the path from data (I truncated the values).. but having a hard time generating a curve from this thats connected to the planes.. maybe I'm going about this in reverse?

from math import radians

rotation = [
[0.5729577951308232, 0.0, 0.0],
[4.010704565915763, 0.0, 0.5729577951308232], 
[7.448451336700702, 0.0, 1.1459155902616465], 
[11.459155902616466, 0.0, 1.7188733853924696],
[15.469860468532229, 0.0, 2.291831180523293], 
[18.907607239317166, 0.0, 2.8647889756541165],
[22.918311805232932, 0.0, 3.437746770784939], 
[26.35605857601787, 0.0, 4.010704565915763],  
[30.36676314193363, 0.0, 4.583662361046586],  
[34.37746770784939, 0.0, 5.156620156177409],  
[37.81521447863433, 0.0, 5.729577951308233],  
[41.8259190445501, 0.0, 6.302535746439055],   
[45.836623610465864, 0.0, 6.875493541569878], 

]

rotation = [[radians(values) for values in lists] for lists in rotation]

size = 2
rot = (radians(90),0,0) 
bpy.ops.mesh.primitive_plane_add(size = size, align='WORLD', location=(0.0, 0.0, 0.0), rotation=rot)
bpy.ops.object.transform_apply(location=True, rotation=True, scale=True)

spacing = 4
for x in rotation:
    print(x) 
    bpy.ops.object.duplicate(linked = False, mode ='TRANSLATION')
    bpy.context.object.rotation_euler = x
    bpy.ops.transform.translate(value=(0, spacing ,0), orient_type="LOCAL")```

[![enter image description here][1]][1]


  [1]: https://i.stack.imgur.com/as3sH.png
$\endgroup$
4
  • $\begingroup$ opps forgot at the top of the code import bpy $\endgroup$
    – Steve
    Jan 24 at 20:12
  • $\begingroup$ You can edit this question by pressing the edit button on the bottom left of the question. $\endgroup$
    – tetii
    Jan 25 at 1:48
  • $\begingroup$ i think this behreajj.medium.com/… could help you a lot $\endgroup$
    – Chris
    Jan 25 at 2:02
  • $\begingroup$ yea.. thanks.. i saw that and it broke my head apart :) lol.. $\endgroup$
    – Steve
    Jan 26 at 8:59

0

You must log in to answer this question.

Browse other questions tagged .