12-19-2004, 04:36 AM
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-20-2006, 05: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.