From: Alexandre Naaman (naaman++at++laplace.engr.sgi.com)
Date: 03/24/2004 17:52:48
Hi Jarsolav,
Well, as far as I can tell, the trim loops you've defined below do not
describe valid trim loops and hence this is not a tessellation bug but
rather an incorrectly defined trim loop which leads to undefined results
(tessellation).
Printing out the begin and end points for the various curves which make
up the trim loop you've setup, for both the commented and uncommented
versions of your code gives:
lin1 begin pt = (15,-1.25), end pt = (16,-1.25)
cir1 begin pt = (7.3951,-1.25), end pt = (7.3951,1.25)
lin2 begin pt = (0,1.25), end pt = (-1,1.25)
cir2 begin pt = (-7.39509,1.25003), end pt = (-7.3951,-1.25)
for the case where we use the piece of code where you move the points by
"15.0" and the numbers below are for the original piece of code.
lin1 begin pt = (15,-1.25), end pt = (16,-1.25)
cir1 begin pt = (7.3951,-1.25), end pt = (7.3951,1.25)
lin2 begin pt = (-15,1.25), end pt = (-16,1.25)
cir2 begin pt = (-7.39509,1.25003), end pt = (-7.3951,-1.25)
As you can see, none of the begin/end points match, in either case.
In other words, end pt for lin1 should match begin pt for circ1 and then
end pt for cir1 should match begin pt for lin2 and so on.
In reality these trim loops only need to meet at their endpoints in object
space but in practice(most of the time), this also has to happen in UV
space.
By moving the point you mentioned you do indeed get a tessellation but
it's not correct. On IRIX I also get a tessellation using the inital point
position but it too doesn't look very inspiring.
I don't know exactly what kind of effect you're trying to acheive but I
have attached to this email a version of your code which defines a valid
trim loop and does generate a valid tessellation. If you run the program
then you'll see that the output with respect to the begin/end points looks
like this:
lin1 begin pt = (15,-1.25), end pt = (16,-1.25)
cir1 begin pt = (16,-1.25), end pt = (-2.29266e-06,1.25)
lin2 begin pt = (0,1.25), end pt = (-1,1.25)
cir2 begin pt = (-0.99999,1.25), end pt = (15,-1.25)
minus some precision issues you can see how the points from the various
curves now match up.
I've also attached a pfa file which you can load using perfly to see how
things should look in case you have issues compiling the sample.
Hope this clarifies things for you,
Alex.
> I encountered another problem when constructing plane with a trim loop
> consisting of 2 line segments and 2 circular arc segments. When
> tessellated this plane shows an artifact resulting from bad
> triangulation. The simplified code fragment to demonstrate the problem
> follows. When the parameter domain of second line segment is just moved
> by 15.0, everything is ok (the comented lines).
>
> Jaroslav
>
> //*************************************************************
>
> pfGroup* root = new pfGroup;
>
> // Plane
> pfPlaneSurface* pl = new pfPlaneSurface();
>
> // Trim line 1
> pfLine2d* lin1 = new pfLine2d();
> lin1->setOrigin(pfVec3(15.0f, -1.25f, 0.0f));
> lin1->setPoint1(-22.3951f, 0.0f, -22.3951f);
> lin1->setPoint2(-7.6049f, 0.0f, -7.6049f);
> pl->addTrimCurve(0, lin1, NULL);
>
> // Trim arc 1
> pfCircle2d* cir1 = new pfCircle2d();
> cir1->setRadius(7.5);
> cir1->setBeginT(-0.167448f);
> cir1->setEndT(0.167448f);
> pl->addTrimCurve(0, cir1, NULL);
>
> // Trim line 2
> pfLine2d* lin2 = new pfLine2d();
>
> lin2->setOrigin(pfVec3(-15.0f, 1.25f, 0.0f));
> lin2->setPoint1(-22.3951f, 0.0f, -22.3951f);
> lin2->setPoint2(-7.6049f, 0.0f, -7.6049f);
>
> // With this code fragment, everything is ok
> // lin2->setOrigin(pfVec3(0.0f, 1.25f, 0.0f));
> // lin2->setPoint1(-7.3951f, 0.0f, -7.3951f);
> // lin2->setPoint2(7.3951f, 0.0f, 7.3951f);
>
> // Line oriented in -X direction
> lin2->setOrient(pfMatrix(
> -1.0f, 0.0f, 0.0f, 0.0f,
> 0.0f, -1.0f, 0.0f, 0.0f,
> 0.0f, 0.0f, 1.0f, 0.0f,
> 0.0f, 0.0f, 0.0f, 1.0f));
> pl->addTrimCurve(0, lin2, NULL);
>
> // Trim arc 2
> pfCircle2d* cir2 = new pfCircle2d();
> cir2->setRadius(7.5);
> cir2->setBeginT(2.97414f);
> cir2->setEndT(3.30904f);
> pl->addTrimCurve(0, cir2, NULL);
>
> pl->setTrimLoopClosed(0, PFLOOP_CLOSED);
> root->addChild(pl);
>
> pfTessParaSurfaceAction* tessSurf = new pfTessParaSurfaceAction();
> pfdTessellateGeometry(root, tessSurf);
>
> -----------------------------------------------------------------------
> List Archives, Info, FAQ: http://www.sgi.com/software/performer/
> Open Development Project: http://oss.sgi.com/projects/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
> -----------------------------------------------------------------------
>
This archive was generated by hypermail 2b29 : Wed Mar 24 2004 - 17:54:16 PST