It sounds as if your normals are incorrect. Your algorithm to flip the
triangles to have consistent neighbour orientation is correct?
It might be that you have an incorrect surface to start with e.g. more
than 2 faces per edge or faces on top of each other. Have a look at it
with e.g. eclectic (from http://www.thermoanalytics.com) or paraview.
Alternatively if you don't mind sending it I could run it through my
surface checker.
Regards,
Mattijs
Allen H. Nugent wrote:
Dear DXplorers,
I am on the verge of giving up on ever fixing a buggy surface rendering
of my artificial-heart pump chamber, but maybe someone can give me an
angle I haven't tried yet.
I generated a set of ~1-mm-spaced nodes to describe the surface, then
formed triangular connections between them. The two programs that did
these were buggy, BFI approaches that required some manual editing of
their output. The output went into a DX native file that produces a ~99%
perfect result.
Unfortunately, the <1% that is not perfect consists of triangles that
don't render properly: they are far too light or dark compared to their
neighbors (and stand out like a dog's you-know-what's!).
I modified my software to ensure that each triangle is defined by 3
vertices that are sequenced anticlockwise (with respect to a convenient
central datum), but I don't think it works correctly at the joint
between the main pump housing and the inflow conduit (triangles around
the joint look like they were added on in a clumsy patchwork).
I have tried editing triads of vertices by hand (using {Pick} to
identify the culprits), and have observed many strange and wonderful
results, including:
a) no change to the triangle (the most common result)
b) the triangle changes from too dark to too light
c) the triangle changes from too light to too dark
d) an adjacent, good triangle goes bad
e) a fraction of the triangle renders OK, leaving the rest of it
transparent (really weird!)
f) parts of the triangle render with different shades
I suppose I need to know the assumptions behind the algorithm used in
{Shade}, so that I can try to make my geometry conform to what it
expects. Is there some detailed documentation with the source code?
I can e-mail a .ps file to anyone who wishes; I don't think the Major
lets me attach it for e-mails to the List.
Regards,
Allen H. Nugent
Graduate School of Biomedical Engineering
University of New South Wales
Sydney NSW 2052 Australia
Tel: +61 2 9385 3916 Fax: +61 2 9663 2108
--
/*---------------------------------------------------------*\
| =========== Mattijs Janssens |
| \\ / Development Engineer |
| \\ / |
| \\ / Nabla Ltd. |
| \\ / The Mews, Picketts Lodge |
| \\/ Picketts Lane, Salfords, |
| F ield Surrey RH1 5RG. |
| O peration Tel: +44 (0)1293 821272 |
| A nd Email: [EMAIL PROTECTED] |
| M anipulation URL: http://www.Nabla.co.uk |
\*---------------------------------------------------------*/