Hi Yves,
On Thu, 24 May 2007, Yves wrote:
> I think I understand the problem better now. The difference in the knot
> vectors influence mainly the clamping to end nodes and the end tangents
> of the surface.
Yes, that's exactly what's happening I think.
> At least this is how it looks. What I understand of your message is that
> the clean way to correct this is to insert some control points at the
> end of the surface that will have the good tangent to close correctly
> and clamp the surface. Since you already have the code to do this (and
> that I don't), I would appreciate very much if you could post it or
> email it to me.
OK, I've attached it. You have to copy OSGBSplineTensorSurface.cpp to
$OSGROOT/OpenSG/Source/System/NodeCores/Drawables/Nurbs/Internal/ and
rebuild OpenSG. The other file is your example code from yesterday
slightly modified by me, the important additions are of course the
clamp_knotvectors() method and the makeClampedSurface() wrapper around it.
I realize it's not nice to look at, but as I said it was a quick
copy'n'paste job from another project to make sure clamping is indeed your
problem, and it seemed faster to just write a wrapper that converts
between the C-style arrays used by the example and the STL vectors used by
the clamp_knotvectors() method. Note that unclamped trimming curves are
still not handled, although it would be fairly trivial to add support for
them.
I will think about how to integrate this functionality into OpenSG cleanly
if there's interest. I've also checked OSGSurface.cpp and the errorcode
from setting the knotvectors is indeed ignored, resulting in the crash.
Should have been using exceptions there anyway. :)
HTH,
Akos
PS: attachment deleted as SF didn't like it, sent to Yves off the list, if
anyone else wants it drop me a mail.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users