Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Marching TetraHedrons Algorithm Question.

38 views
Skip to first unread message

SpreadTooThin

unread,
Jul 2, 2019, 10:21:06 PM7/2/19
to
I'm having an issue with right handed vs left handed triangles that come out of my marching tetrahedral method.

I check parts of my code against what was published by another author's.
http://www.mougel.org/informatique/IUP/IUP3/VisuSc/Rapport.pdf

In some sections our codes are almost identical but the author hasn't published all the code.
Fortunately It would seem that my bug happens in a section of code that the author published and I compared my code with his and they are the same.

As all the geometry of my point grid looks correct, it's just that some triangles are drawn right handed and others left.

I am making the assumption that the other code is correct and hasn't overlooked two sided polygons.

This is the section of code (You will find similar code in the other authors code)

select case triindex
case &h01, &h0E

tri.p(0) = VertexInterp(iso, g.p(v0), g.p(v1), g.val(v0), g.val(v1))
tri.p(1) = VertexInterp(i so, g.p(v0), g.p(v2), g.val(v0), g.val(v2))
tri.p(2) = VertexInterp(iso, g.p(v0), g.p(v3), g.val(v0), g.val(v3))
parent.ThreadCreatedTriangle(tri)

if you look at the test cases they are always grouped in paris and interpolated the same way.
https://commons.wikimedia.org/wiki/File:TetrasCases.png?uselang=fr

I'm wondering if these two cases need to be handled separately for cases where clockwise/counter clockwise winding is important?

0 new messages