Re: [info-performer] One more tessellation problem

Date view Thread view Subject view Author view

From: Alexandre Naaman (naaman++at++laplace.engr.sgi.com)
Date: 04/07/2004 16:00:46


On Mon, 5 Apr 2004, Jaroslav Sinecky wrote:

Hi again Jarsolav,

 After much investigating, I've found a solution to the problem you were
seeing. The cause of the problem had to do with us not evaluating the trim
curves properly.

 The solution was really quite simple ... we _were_ computing the trim
curve evaluation points using a formula that looked something like:

        t = i * deltaT + beginT;

 but unfortunately, if i is large enough, then when i == num_samples there
may be a significant difference between t and endT. In the case you noted
below the difference was of the order of 5e-8. This caused the tessellator
to get confused and believe that there was a "kink" in the trim loop (on
one of the corners) and messed everything up causing it to do all kinds of
additional garbage-in/garbage-out style work.

 If we amplify what the trim loop looked like after we computed the
discrete version of it it would look something like this:
        _________________
        | |
        | |
        | |
        | |
        | |
        | |
        | |
        \_______________|

 Instead of a square, as it should have been.

 I've amplified the error here so you can see that if endT for the left
most vertical line did not result with it's y value being equal to 0 (the
begin pt for the bottom most trim curve) then the tessellator got confused
and actually ended up creating a trim loop which looked more like:

        _________________
        | |
        | |
        | |
        | |
        | |
        | |
        +--------------\|

 and so even though the first "version" of the trim curves (with the kink)
created a convex shape, the internal representation wasn't and this is
what caused all the havoc.

 So, to make a long story short, it' fixed now and will be available in
the next Performer release (3.1.1).

 Thanks for the feedback,

Alex.

> Hi all,
>
> /* I'm sending this again because it seems the first mail didn't make it
> through. I'm putting link to piece.pfb instead of attaching it. Sorry if it
> arrives twice at the end. */
>
> I'm using the performer tessellator exhaustively, it works mostly well, but
> there are cases when I get some uncorrect artifacts. Its usually tedious to
> track where the problem actually is and can be also in surfaces/trim curves
> definitions. Anyway I have one case which is quite transparent (and visualy
> more enoying), I would be glad if someone can have a look at it...
>
> I send a piece.pfb enclosed with two pfNurbSurfaces, in the uv-parametrical
> space each has a simple trim loop in form of unit square (0,0)->(1,1). Now
> when I load this file, add topological information (the two surfaces have
> one common boundary) and tessellate it, there is a very visible tessellation
> artifact.
> Note: this happens only with common boundary defined and only for some
> concrete chordal tolerance values.
>
> Jaroslav
>
> ps. Pf3.1, Windows XP.
>
> Here is the code:
>
> // Load the file and get two surfaces
> pfGroup* root = (pfGroup*)pfdLoadFile("piece.pfb");
> pfParaSurface* surf1 = (pfParaSurface*)root->getChild(0);
> pfParaSurface* surf2 = (pfParaSurface*)root->getChild(1);
>
> // Add topology
> pfTopo* topo = new pfTopo();
> topo->addSurface(surf1);
> topo->addSurface(surf2);
>
> // Common boudary
> pfBoundary* b = new pfBoundary();
> topo->addBoundary(b);
> b->addEdge(0, surf1, 0, 0);
> b->addEdge(1, surf2, 0, 2);
> surf1->getTrimCurve(0, 0)->setBoundaryDir(1);
> surf2->getTrimCurve(0, 2)->setBoundaryDir(-1);
>
> // Tessellate
> pfTessParaSurfaceAction* tessSurf = new pfTessParaSurfaceAction();
> tessSurf->setChordalDevTol(5e-5f); // With these values, all is ok:
> 5e-4f, 5e-6f
> pfdTessellateGeometry(root, tessSurf);
>
> // Now can store and open in perfly to see what happened
> pfdStoreFile(root, "simple.pfb");
>
> the link to piece.pfb: http://home.tiscali.cz/pusher/piece.pfb
>
> -----------------------------------------------------------------------
> 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
> -----------------------------------------------------------------------
>


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Apr 07 2004 - 16:02:45 PDT