Author Topic: Randomize Points of selected polylines  (Read 2473 times)

Offline Rodneyk

  • Droid
  • **
  • Posts: 62
    • View Profile
Randomize Points of selected polylines
« on: November 22, 2012, 22:53:43 pm »
Another memeber was trying to make something that looked like a rough wood texture.

He had the idea of creating a backgound with lots of small polyline then randomizing the Z axis.  I wrote this small plugin that does the one piece he was missing. It might be useful to someone else. This is my first plugin for cambam.

To install just copy the Randomize.dll file into the plugins directory (normally found at : C:\Program Files (x86)\CamBam plus 0.9.8\plugins).

By default the plugin will add a random value in the range of [0,0.5] to the Z coordinate of all selected polylines.

The plugin may also be used to affect the X,Y, and Z corrdinates. If the plugin finds a 2 point polyline object with a tag of "random" it will use the two points coordinates to bound the new points. The plugin will not alter this polyline, but it must be selected along with the lines to randomize. ONLY a 2 point (single segment) polyline will be used. If more than one "random" polyline is found only the first one will be used.

So if you wanted to randomize the X coordinates of a set of polylines to fall between -1 and 1 you would just need to add a new polyline with points [-1,0,0], and [1,0,0] with the tag name "random".

If you wanted to affect multple axises at the same time it will do that too, just use points like [-0.5,-0.5,-0.5],[0.5,0.5,0.5]

Once the polyline with the tag name "random" is added simply select all the lines you want to randomize including the "random" polyline and press <Ctrl><Shift><R>. Or you could use the "Edit Randomize" menu item.

Note this plugin created new polylines and does not affect the original lines in the file.