PDA

View Full Version : Scaling multiple tangents equally...


Kirl
06-05-2003, 04:18 PM
Is it possible to 'scale' multiple tangents equally?

I want to make them all longer (softer), but they're in a circle so I can't do it maully without screwing the alignment...

I attached a pic.

MJV
06-05-2003, 05:34 PM
Good questoin. This is the type of thing you would expect to be able to do with a modifier in a more mature app. I don't think there is any way to do it in Cinema though. I've often wanted to do the same thing.

artemesia66
06-05-2003, 06:17 PM
in general that kind of control over tangents would be a great thing.

for the shape that it looks like your making, though, try messing around with the epicycloid splines. (pp228 in the manual for the math, if you're interested)

radius= well, radius
radius/r=number of "lobes" in your curve.

then mess around with 'a' to control the shape of the lobes.

for practical application see my WIP bowl posted today :)

Cinema1954
06-06-2003, 12:43 AM
It's a bit fiddly, but here's a way: First, adjust the values for the two points at the top and bottom of the image (call them points 1 and 4).

Next, using the model tool, rotate the spline 60 degrees clockwise, then switch to the object axis tool and rotate back to zero. This brings points 6 and 3 to the top and bottom, and sets the object coordinates back to normal so the numbers that worked for the first pair of points will work here.

Finally, repeat and modify points 5 and 2, then rotate -120 with the model tool and back to zero with the axis tool.

It sure would be nice if there was some way to do this in one operation!

mnu
06-06-2003, 11:56 AM
Hi all,

I tried to write a small COFFEE expression to accomplish this. Check it out and tell me wether this is what you need. This is the link

http://www.entagma.org/download/thetangentthingy.zip

cheers mnu

Kirl
06-06-2003, 05:18 PM
Thanks all, unfortunatly I'm still not using R8 so I couldn't check the expression.

In the meantime I did managed to get something close to what I originally wanted but it's not as easely adjustable as one tangent would've been.

Cinema1954's way would've worked nicely if only I didn't had as many of these flower things...

mnu
06-08-2003, 01:34 PM
Hey, no problem.

Here's the code. Just paste it into a COFFEE Expression Tag attached to the Spline you want to edit.

//ENTAGMA 2003//
//copy tangent length expression//

//you have to change the variable masterpoint to hold the point number of the point
//that you want to use as master.


main(doc,op)
{
var masterpoint = 4;

var pntcnt = op->GetPointCount();
var sel = op->GetPointSelection();
var tangents = op->GetTangents();
var newtangents = op->GetTangents();

println(tangents[0]);

var i;
for (i=0; i<pntcnt; i++)
{
if(sel->IsSelected(i))
{

var basetanL = vnorm(newtangents[i*2+0]);
var basetanR = vnorm(newtangents[i*2+1]);


var mastertanL = vlen(tangents[masterpoint*2+0]);
var mastertanR = vlen(tangents[masterpoint*2+1]);

newtangents[i*2+0]=basetanL*mastertanL;
newtangents[i*2+1]=basetanR*mastertanR;
}
}
op->SetTangents(newtangents);
doc->Message(MSG_UPDATE);
}


cheers mnu

CGTalk Moderation
01-15-2006, 08:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.