Fr
17
Feb
2012
I recently stumbled across a nice script that deforms geometry along a path. I found that on a japanese site through a tip of a modo user on the luxology forums. Unfortunately the description on how to use it was in japanese as well. So I had quite a bit of guessing to figure out how to use it.
You can find a gif describing the use of the script here:
http://livedoor.blogimg.jp/take_z_ultima/imgs/1/3/13b1992a.gif
The script is located on this site - among a lot of other scripts:
http://park7.wakwak.com/~oxygen/lib/script/modo/category.html
To make things easier, here is the link that points to a .lzh archive of that script:
Okay, so to get started, unpack that archive and copy the script into your preferred scripts folder. To start it, you can use the run script function in modo or if you prefer a more advanced solution, assign it to a form or a shortcut.
I wanted to deform a toothbelt that was exactly 2 meters long, as in the image above. To do that there are a few things to care of in order to get the desired result. The most important is that the geometry should be oriented along the z axis.
Next, you need a curve in the same mesh layer than the belt.
The basic procedure of deforming is quite simple. Change the selection mode to polygons and select all polygons of your mesh, except the curve. then switch to edge selection mode and select all edges of the curve. Run the script.
My case was a bit more complicated though. I needed the scaling and proportions of that belt intact. So I needed the curve to be exactly 2 meters long. Richard Hurrey had a nice tip about that on the luxology forums, too: If you constrain a mesh or locator to the curve using the path constraint, you will get the length of that curve displayed among the channels of the curve item. Of course you need that curve item in a separate layer to do that.
So I went ahead, cut my curve to a new mesh layer, made a locator item and constrained it via path constraint to the curve. Looks like this:
As you can read in the length channel of the path constraint item, the curve is about 20 cm too long. With both the curve item and the path constraint item selected, you can now select some of the curves vertices and adjust them until the curve length reads 2m. Copy the curve into your toothbelt mesh, select all toothbelt polygons, then select all curve edges and run the script.
Should look something like this:
Okay - that's not exacly what I was after. And it seems there is no way to figure out how the geometry is going to be aligned to the curve. At least I did not find any hint. So rotate the toothbelt 90° so it will align the way you want and run the plugin again. This is my result: