random curves

hi guys,
i’m working on a project where i need to generate lots of long random 3d curves that will act as a path later on.
is there some kind of plugin that will draw a random curve in a domain, let’s say a cube 1,1,1 ?
perfect would be if we could set the length and number of handles.
think of a long rope in space, or a ball of wool that is messed up.
maybe someone can give me a hint or are there some modifiers that will mess up a curve in a pleasant way? =)
i basicly need something like in this picture below but longer and lot’s of them. my python skills are limited
thought i’d ask, a simple question is sometimes faster than to draw lots of them by hand.
thx for your help and happy blending.


I think i have a nice solution for you that looks like this:


here’s the workflow:

  1. create a mesh for the shape you want to make a tangle for (simple shapes like cubes and spheres will work best, the curve won’t follow the contours of the shape for concave shapes)
  2. put a particle system on the shape and make sure it’s generating all of the particles on a single frame
  3. set the particle emission to volume if you want to make a volumetric tangle or keep it on the surface for a surface covering curve
  4. add a separate plane object, go to edit mode, and reduce it to a single vertex by merging the verts with w-key > merge
  5. on the shape’s particle system, set the point object as the dupli object for the particles (under the render section)
  6. mess with the particle setting to get the point distribution you want (i turned off normal emission speed and turned up brownian motion so I could let the particles animate a bit before picking the distribution I liked)

here’s my particle settings for reference:


you should have something that looks like this:


  1. in the modifier tab of the properties editor, press the “convert” button on the particles modifier
  2. adds a new object for each of the particles (since each object is just one vert we are getting one vert per particle)
  3. select all of the new objects and press CRTL-J to join them into one object
  4. now run this quick script(hosted on github) I wrote from inside the script editor to add edges between the points, resulting in big tangled line (this also adds an operator called “curvify points” that you can find in spacebar search)
  5. press alt-C to bring up the convert menu and convert the mesh to a curve
  6. tab into edit mode for the curve, select all the points, use spacebar to search for “set spline type” and set to bezier
  7. press V and select “automatic” to make the curve smooth instead of jaggy

if you want to mess with the handles off all the points, press V and select “free”, then make the pivot point “individual origins” and scale them

with some more time it would be possible to make this a self contained script to just take a mesh and generate a tangle without having to manually do all the steps, but I don’t have the time tonight to do that :wink: let me know if you think that would be worth spending time on or if the above process is enough.

2 Likes

wow, this is exactly what i was looking for and i didn’t expect a whole tutorial.
thanks a lot for your script, time and guidance atartanian! =)
it’s actually genius to use a particle system for the distribution of the verts(handles).
this method will save me a lot of time and it also made me cook spagetti :smiley:



1 Like

Hi i did not get the 8th step add new object for each particles means. And i have installed that addon cant find in the addon to activate. 2.79. Can u plz make a video on it so that we can rewind and go through each time. Thanks

Hi all! I’ve also stumbled across this, as I’m trying to get this exact effect for a project I’m working on.
However, I’m using Blender 2.8, and for the life of me I can’t get the script to work. I’m relatively new to Blender, so any advice would be appreciated! Is there a trick to running the script?