Mesh : What about independant normal orientation ?

Discussion related to the implementation of new features & algorithms to the Core Engine.

Moderators: jromang, tomb, zcott, coordinators

Mesh : What about independant normal orientation ?

Postby Rom1 » Wed Jul 06, 2011 8:22 am

Hello,

In my company, we use CATIA as a 3D tool, and a lot of our work is done by different entity.

The problem is we don't care about the orientation of the surfaces when they are created.

You understand that I got some problems when using glass2 material, as you now it needs a coherent normal orientation (all exterior, or all interior )

I first tried to mange a manual normal reorientation. But if i got a lot of surfaces I spend a lot of time each time I receive a new version of my cad.

There is a difference between cad received and cad rendered, so I could got problems of data management.

Some cad data are provided by my customer, there is no way to touch them.

I was looking for some automation process, but it seems to be difficult.

So my question is : Would it be possible to modify the engine as it would be "normal independent" ?

glass2 material would have to know in which medium we are by another way.
Rom1
Developer
 
Posts: 100
Joined: Thu Feb 04, 2010 7:18 am

Re: Mesh : What about independant normal orientation ?

Postby jeanphi » Wed Jul 06, 2011 9:04 am

Hi,

If the meshes are closed, there are algorithms to recompute the normals. However I seem to remember that your meshes are not always closed and in such cases, it is impossible to recompute accurately the normals, and the fact that the mesh is not closed will lead to artefacts if we modify the core to recompute the normals on the fly the the medium properties (a ray can pass in a hole and then the orientation will be miscomputed).

Jeanphi
jeanphi
Developer
 
Posts: 6624
Joined: Mon Jan 14, 2008 7:21 am

Re: Mesh : What about independant normal orientation ?

Postby Lord Crc » Wed Jul 06, 2011 9:39 am

We could however add a heuristic at load time which could at least work in a lot of cases I think, something like:

- Compute vertex normals normally.
- If normal of the majority of the extremal vertexes (in case of multiple) points "in" towards center of mass, flip all normals.

May be some better heuristics, but I think this should be good for a lot of cases?

Just a thought :)
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4518
Joined: Sat Nov 17, 2007 2:10 pm

Re: Mesh : What about independant normal orientation ?

Postby pciccone » Wed Jul 06, 2011 9:55 am

Lord Crc, that sounds very reasonable to me.
User avatar
pciccone
Developer
 
Posts: 692
Joined: Wed Jan 13, 2010 11:02 am
Location: California

Re: Mesh : What about independant normal orientation ?

Postby jeanphi » Wed Jul 06, 2011 10:41 am

Hi,

The issue with CATIA meshes is that normal winding is not consistent across the mesh. The issue is not that normals are inverted, it's that for some triangles the normal will point outward and for others it will point inward. So you need to compute the mesh topology and guess where the normal should be which is almost impossible at load time.
What would work better would be to have the interior and exterior medium defined for the mesh, check those with the medium of the ray and determine the normal accordingly. However is the meshes are not closed, the ray can pass in a hole and you'll compute the normal on the wrong side. That might be acceptable though.

Jeanphi
jeanphi
Developer
 
Posts: 6624
Joined: Mon Jan 14, 2008 7:21 am

Re: Mesh : What about independant normal orientation ?

Postby Lord Crc » Wed Jul 06, 2011 10:55 am

jeanphi wrote:So you need to compute the mesh topology and guess where the normal should be which is almost impossible at load time.


Hmm I must admit I've never tried this, so I'm probably missing something, but couldn't one use a similar approach? Find the extremal vertex (pick one if multiple), and pick one of the triangles (say largest area one?) using this vertex as the starting point. Compute the vertex normal for that initial vertex starting with the initial triangle. Reorienting the triangles to be consistent with the vertex normal so far.

Then compute the vertex normals of the remaining connected vertexes, again reorienting the tris to be consistent, and so on. After that you do the pass I suggested above to flip normals if needed.

Again, I'm probably missing something here... but could perhaps work?
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4518
Joined: Sat Nov 17, 2007 2:10 pm

Re: Mesh : What about independant normal orientation ?

Postby Rom1 » Wed Jul 06, 2011 11:05 am

That's true, as jeanphi point it, some of our mesh are not closed, and the mesh normal orientation is not consistent (the problem is to invert some normals, not all :()

That's why I got automation problems.

The solution with the medium defined in the mesh would be interesting. I'm sure we can manage light problems due to hole or bad mesh as they should be relatively small.

We got the original cad therefore we should know were the "surrealistic" path would be.

We use absorption so, if we miss input face or output face of the mesh we would got a black part (absorption along few meter would result as a total loss of light energy)
Rom1
Developer
 
Posts: 100
Joined: Thu Feb 04, 2010 7:18 am

Re: Mesh : What about independant normal orientation ?

Postby guibou » Wed Jul 06, 2011 12:24 pm

jeanphi wrote:What would work better would be to have the interior and exterior medium defined for the mesh, check those with the medium of the ray and determine the normal accordingly. However is the meshes are not closed, the ray can pass in a hole and you'll compute the normal on the wrong side. That might be acceptable though.


As far as I know, media precedence is a target for 0.9. You will have to do this kind of trick (checking the ray medium) to get medium precedence to work. So I think implementing this is the same time may be a good idea.

Also, It may helps with surfaces with only one side.
guibou
Developer
 
Posts: 271
Joined: Fri Dec 04, 2009 10:14 am

Re: Mesh : What about independant normal orientation ?

Postby jeanphi » Wed Jul 06, 2011 12:31 pm

Hi,

I'm not sure this is the same stuff. I'll have to think about it some more.

Jeanphi
jeanphi
Developer
 
Posts: 6624
Joined: Mon Jan 14, 2008 7:21 am

Re: Mesh : What about independant normal orientation ?

Postby Rom1 » Mon Sep 05, 2011 6:45 am

Hi there.

Is there any news about independent normal orientation ?

If I can help for something, please tell me.
Rom1
Developer
 
Posts: 100
Joined: Thu Feb 04, 2010 7:18 am

Next

Return to Architecture & Design

Who is online

Users browsing this forum: No registered users and 0 guests

cron