0

I've got a bit of a puzzler here

I am using blender to import 3d plots that I generate using a 3d graphic utility. What I want is for the blender objects that I create to have a perfect radius, so that they seem like continuous lines with a given linewidth.

So, the most natural way I have found to do that is to import my XYZ points, connect them with edges into a mesh, then convert the mesh to a curve, and set the curves bevel depth, then set the shading to smooth. So, this produces a beautiful line-like object, whose cross-section is always a perfect circle around the line that I want created. The overall effect is to generate something that looks like a 3d line graph

enter image description here

OK- so far, so good. Here's the tricky bit. The next step is that I want to be able to color the graph in a programmatic way. that is, I want to be able to import an RGB or HSV value with each vertex, and have blender color the 3d-line segment that comes out of that vertex with that RGB color. The issue is that, as far as I know, there is no "faces" that I can select to color in the curve object. That would suggest that I could convert it back to a mesh, at which point, the new mesh would be of the appropriate shape, but all the vertices and faces would be tough to ID.

One thing I tried was to import each 2-vertex line segment as independent meshes, then convert each to curves, then color each of the 10000 little curves differently to produce the illusion of a smoothly changing color scheme. This technically works, but since blender has to create maybe 10000 independent objects, it takes a prohibitively long time.

Another thought I had is to generate custom X3d files myself, but the issue there is that the actual "making the line 3d" part actually happens in blender, when I convert the mesh to a curve and use the bevel tool. All that actually comes out of my 3d graphing utility is a series of xyz points corresponding to the vertices that connect up my line.

most recently, what I did was figure out how many vertices are generated given a specific bevel-resolution from the curve that I'm converting from, then I generated a program that "knew" that, say, faces 1-10 would correspond to the line segment that would have joined the first two vertices from my original x-y-z euler points. this actually worked perfectly, if a bit slowly, but I have again run into a problem-- it seems that blender only allows about 32000 materials, but I often have millions of faces that I want to programatically color. So, is there any property that faces have that would allow me to directly set the their RGB value without having to resort to adding new materials? (thus allowing me to circumvent the limit)

  • apologies, I realize that I didn't finish the full title. – Jacob B Jun 05 '20 at 02:40
  • I don't know if this is at all helpful, but I found an interesting discussion about coloring by vertex, including some python scripts that may have some useful components. Make sure to read all the answers and comments as well, because there is some back and forth with regards to what is or is not possible. Link is here - https://blender.stackexchange.com/questions/30841/how-to-view-vertex-colors – Christopher Bennett Jun 05 '20 at 03:42
  • Also related https://blender.stackexchange.com/questions/179327/scripting-alternative-to-editing-colour-based-on-vertex-coordinates-using-nodes/179367#179367 – batFINGER Jun 05 '20 at 21:10

0 Answers0