[info-performer] Tessellation bug (?)

Date view Thread view Subject view Author view

From: Jaroslav Sinecky (jsinecky++at++tiscali.cz)
Date: 03/01/2004 04:21:34


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);


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Mar 01 2004 - 04:53:49 PST