|12 December 2004||#1|
Join Date: Nov 2004
Hey all, I have a bit of a problem on a NURBS curve, and the docs haven't really helped..
I think I accidentally got a multiknot into this thing, but I'm having a devil of a time tracking it down. I've tried to get the status of each knot by selecting it and pressing Shift+Enter, but that doesn't seem to tell me the multiplicity. I've also tried deleting each knot to see if it's the one, but irrespective, deleting a knot wildly moves the CVs to make up for it, so it's really hard to tell.
I know, I should just start the thing over, but I already have model relationships on it, and besides, I'd like to know how to fix this in future rather than just keep doing everything the hard way.
The reason I think there is a multiknot is that the resulting surface will have two isoparms rather close together that I can't get separated.. makes me feel kinda stupid to knot know which knot is knot right, but, hey, there should be a way....
Do I hafta stop, figure out the XSI object model, and write a script to automatically select any knot with multiplicity > 1, or is there some more straightforward way of determining this?
(I'm pretty sure the answer will make me feel dumb, lol.)
|12 December 2004||#2|
Join Date: Nov 2004
corrupted NURBS curve
This problem drove me sufficiently crazy that I wrote a script, which I've included below. (Obviously provided with no warranties, lol.) It selects all the knots in a NURBS curve that have multiplicity above one. Incidentally, this is always true of the first knot, and never of the last, no matter what you do.
The script doesn't work either on a closed curve or on a curve that has ever BEEN closed (unless you delete the close operators). If anyone understands why, please do tell! (The internal knot indices stop matching the user interface ones, but I don't know why.) It also doesn't work if the curve has less than 5 CVs.
After spending quite some time shouting at the computer like a madman, I have finally come to the conclusion that either I've just lost my mind or XSI may subtly (but maddeningly) corrupt curves over time in much the same fashion as Windows 98 corrupts itself over time. If your NURBS surface (based on curves) looks a bit off and you can't figure out why (or if there is a knot curve where you think there shouldn't be one), I'd recommend the following:
1. Run the script below and pick the relevant curve. If only the first knot and any you intended to be multiknots get selected, then the curve is okay.
2. If any *other* knots show up selected (and you don't have a close curve operator on the stack), then turn on NURBS hulls on unselected objects, unselect it, and start drawing a new curve over top of it. If it's planar and you draw with CVs, you should be able to pretty easily recreate it the same.
3. Now NUKE THE THING!!! (At least in my opinion) the curve has become so fatally corrupted that no amount of deleting knots and re-adding CVs or even freezing it is going to make it behave right.
After I did this and rebuilt the surface, it looked fine and all the isoparms were in the expected places.
Hopefully this corruption is a rare occurrence. I can't really identify what it is that I did to this one to get it so screwed up, but I had several other curves in the scene quite a bit more complex (where I had the hull crossing itself in a number of places to get nice microbevelled edges) that didn't seem to corrupt themselves like this one did. And btw, they passed the test that the script should only select the first point.
If anyone has any additional insight, I'd LOVE to hear it; I've just recently gotten into XSI, and NURBS, so this could possibly be a case of my confusing the ???? out of myself, but I *did* get the desired results after heeding this, so maybe there's something to it.
// On a good day, this script will select the multiknots in a
// curve. It's not a good day if the curve has ever been closed.
// Uncomment the two extra lines to get some diagnostic info.
var ret = PickElement( siCurveFilter, "Pick curve", "", button, 2 );
button = ret.Value("ButtonPressed");
if( button != 0 )
var x3dobj = ret.Value("PickedElement");
var knotcoll = x3dobj.ActivePrimitive.Geometry.Curves(0).Knots;
var knotcount = knotcoll.Count;
var name = x3dobj.Name;
for( i = 0 ; i < knotcount ; i++ )
//logmessage( i + "=" + knotcoll.GetMultiplicity(i) );
if( knotcoll.GetMultiplicity(i) > 1 )
AddToSelection( name + ".knot[" + i + "]" );
|01 January 2006||#3|
Join Date: Sep 2003
Thread automatically closed
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.
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
|Thread Closed share thread|