The secret of MOI welding

Next
 From:  Micha
2453.1 
Hello Michael,

for better texturing I use the mesh unfolder Unfold3D - it's one of the easiest unfolder. The downside of Unfold3D is, it is not optimized for CAD user. What do it means? If a mesh is loaded to Unfold3D, than the user can set cuts/uncuts for unfolding. If he set a cut, than the mesh edge is unwelded. The user can uncut the cut only, if the original imported mesh was welded at this edge. And this is the problem for CAD models most, because the mesh edges of a cube are unwelded most and if I would weld it at Rhino, than the cube looks extrem smoothed.

Here an example - without welding vs. welded (Rhino3D)


Now I found, that MOI OBJ export meshes are welded without additional smoothing effects and I can free set cuts and uncuts at Unfold3D. That's great, now Unfold3D is full useable. (MOI3D meshes are great for unfolding.)

Could you explain, why MOI meshes are welded but show no smoothing effect, if I open the mesh at Rhino? Interesting is, if I import a MOI obj mesh to Rhino and export it to Unfold3D later, than the nice welding without smoothing is gone, all edges are unwelded and the unfold dosn't work anymore. This is a big problem for the workflow.

My problem is, that I use MOI3D to mesh NURBs objects for rendering. But once loaded to Rhino, I can't use the meshes at Unfold3D again like I used it direct from MoI to Unfold3D. Some weeks befor I ask at the Rhino forum for that feature, but the developer don't know, how to get a welded mesh without smoothing effect. Could you help please? How can this be done?

Regards,
Micha

Here a screenshot of Unfold3D - I can free choose, where I set the cuts.


PS: The links to the Rhino forum welding threads:
http://news2.mcneel.com/scripts/dnewsweb.exe?utag=&group=rhino&xrelated=302352&cmd_related=View+thread
http://news2.mcneel.com/scripts/dnewsweb.exe?utag=&group=rhino&xrelated=302259&cmd_related=View+thread

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  jbshorty
2453.2 
Hi Micha. Does Unfold3D give you option to delete the vertex normal map? It can be done in some mesh modeling programs, such as modo, just select that map and delete it. Then the mesh will be rendered flat but vertices are still welded. Probably you can do it in other programs too...

jonah
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
2453.3 In reply to 2453.1 
Hi Micha - the basic problem that you are seeing when importing into Rhino is that Rhino does not support "per face" attributes, it only supports a single vertex list of attributes. So in order to emulate the per-face attributes that are generated when you export a welded OBJ file from MoI, it is going to make duplicated points at import time rather than keeping the original unifed point structure, because the unified structure is not possible for it to hold with its system of defining meshes.


I'll try to explain the difference between "per face" and "per vertex" type systems here, but it will be a bit complex since it involves the actual structure of the data.


Basically the "per vertex" system means that there is a list of vertices each of which contains a 3d point, uv texture point, and a vertex normal for shading. Then faces have a list of numbers that index into those vertices, for example you may have a list of 4 vertices, and then 2 faces that index them. That would look something like this:

Vertex list, length 4

Vertex1 (point 2,5,6 uv 0.5,0.1 shading normal 0,0,1 )
Vertex2 (point 6,2,3 uv 0.2,0.2 shading normal 0,1,0 )
Vertex3 (.. similar data with a point, uv, normal ... )
Vertex4 (.. similar again .. )

Face list:

Face1: ( 1 , 2 , 3 )
Face2: ( 1, 3, 4 )


This is the system that Rhino uses for storing mesh data. So notice with this system that 2 faces can share the same vertex, but they can only do so if they want to share all the same information at once since a single vertex has all of the 3d, uv, and normal information combined into it.

With this system it is not possible to have 2 faces that share the vertex when they want to have the same 3d point only, but have differing UVs or normals, and this kind of situation is exactly what you want to have when you have a welded box model, the shading for each polygon of the box should be different so it needs different normals from the neighboring polygon, but at the same time it has the same point location so it would be good to share that but you can't do a "partial share" with this structure.


Now let us look at the "per face" type system instead, which is more flexible.

With this system instead of there being only one vertex list, there are instead 3 lists, one each for points, uvs and normals and they can all have a different number of items in the list. Then for each face instead of it having just one index for every entry of the face, it actually has 3 index values so a single entry of a face can reference points, uvs, and normals independently.

That system looks like this:

Point list:
Point1: (2.2,5.6,6.1)
Point2: (4.2,5.2,1.2)
Point3: (... xyz value)
Point4: (... xyz value)

UV list:
uv1: (0.5,0.5)
uv2: (1.0,1.0)
uv3: (.. uv value )
uv4: (.. uv value )
uv5: (.. uv value )
uv6: (.. uv value )

Normals list:
normal1: (0.0,0.0,1.0)
normal2: (1.0,0.0,0.0)
normal3: (.. xyz direction value)
normal4: (.. xyz direction value)
normal5: (.. xyz direction value)
normal6: (.. xyz direction value)

Faces list:
face1: ( (1,2,2) (2,1,1) (3,1,4) )
face2: ( (1,3,3) (3,4,2) (2,4,5) )



This is actually how a welded OBJ file is defined, if you open up the OBJ file in a text editor you will be able to see these various lists, you may want to export a box and take a look at that.

Notice how this system is structured differently than the previous system - a triangle face is now in this system not just a list of 3 index numbers, but instead a set of 9 numbers which are 3 sets of 3 index values. Each set of 3 specifies a different point, uv, and normal value.

So with this system it is possible to make cube that uses 8 points for the 3D points, and have those points shared between all the faces of the cube, while at the same time allowing a different vertex normal for each different face.



The way that Rhino defines mesh data follows the first method, while the welded OBJ files that you export from MoI and that you want to have use the second method.

When Rhino imports data where the data is structured using this second method, it sees that it has differing values per face and then makes a bunch of separate entries in its single vertex list so that it can assign different values, that essentially "unwelds" it since the faces will no longer share the same vertex anymore.

If you need to work on this kind of welded data, it is probably not really a good choice to use Rhino for doing the editing, since it does not fundamentally work on that kind of data.

You would probably get some better results with a more polygon-focused program like Silo for instance, polygon modelers can tend to work more directly on the second kind of "per face" data and so would preserve the structure you need rather than breaking that structure into a different system at import time.


Maybe you have assumed that all programs handle polygon meshes in the exact same way? That may be why this seems confusing to you before, because that assumption is not correct, there are different methods for storing polygon data and you seem to want to work with a different method than what Rhino uses...

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
2453.4 In reply to 2453.1 
Hi Micha, just one more detail to try and explain why you see those shading artifacts in Rhino when you do a "full weld" while inside of Rhino.

As I explained before, Rhino's mesh structure does not allow for only partial sharing between faces, a face can only either have all of its information (3d point, uv, and normal) shared, or none shared with neighboring faces.

If you tell Rhino to force a welding to make all faces share the same vertices, that means that they will also share the same vertex normal for shading as well, so that smooth shading will then try to be calculated across all those faces. In the case of a box you don't want shading to flow across all faces, but that is what you get anyway with welding in Rhino.

The way that Rhino defines its meshes just does not make it possible to have welded points but different smoothing per face.

Some programs handle these issues in different ways - there is the possibility to have "per face" polygon attributes like I described earlier which is the most flexible, but also some programs that have only "per vertex" type data like Rhino use an additional mechanism called "smoothing groups" where they can assign faces to different groups and then will not let smoothing intermingle outside of one of those groups.

When MoI exports a welded OBJ file, it will actually put out both kinds of data - it will have per-face attributes and also emit smoothing groups as well so I'm not quite sure which method your unwrap program actually uses.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Micha
2453.5 In reply to 2453.4 
Thank you very much for the detailed explanation. So, it seems to be, if I need Unfold3D, than I must direct use data from MOI3D. There is one problem: some times Unfold3D tell me, that something is wrong with the mesh and than, in the past, I tried to fix the mesh error in Rhino. If I get an error again I will post it - if I remember me right, the error was called a "butterfly point".

At the Unfold3D help page I found some infos about the mesh requirements. Is it possible to get meshes without butterfly points per MoI?

http://www.polygonal-design.fr/e_unfold/manual3_1v5.php
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
2453.6 In reply to 2453.5 
Hi Micha, for most mesh uses such as just rendering it for example, those "butterfly points" are not normally a problem, so MoI's mesher has not been designed to treat them in any special way or avoid them. They are not really what I would call an "error" in the mesh really.

But I would think it would be kind of unusual to get that situation, especially if you have a well formed fully closed solid it should not have any border edges at all in the generated mesh, so probably ensuring that all edges are joined and that you have a closed solid would be a good step to help avoid that kind of thing.

If you can give me an example that does generate one of those butterfly points, it would help me to understand the situation a bit more.

... Actually, if I understand the problem correctly, it may be that you have to avoid certain arrangements of geometry which are just not permitted by Unfold3D - for example how would you expect for me to avoid a butterfly point with a model that is set up exactly as the example shown in the Unfold3D page? I include an example file here - how would you expect for this mesh to be created without any butterfly points?

I suppose one possible solution is to have that butterfly point be a duplicated point instead of a shared point between the faces that touch there. Right now I have no provision for doing that, so if you need such a thing you should try exporting with welding turned off, then take that result mesh into a polygon processing program and weld all other points except for that butterfly point, that may eliminate it.

But it would probably be best if Unfold3D would just duplicate ("unweld") such points itself since it is sensitive to their presence...

- Michael

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Micha
2453.7 In reply to 2453.6 
OK, I will send a link to this thread to the Unfold3D team -maybe they can do something.

Thanks,
Micha
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
2453.8 In reply to 2453.7 
Hi Micha, also next time you run into it, please try to post the model file or e-mail it to me at moi@moi3d.com if you want to keep it private, and if possible indicate the area that has this point in it. That may help me to better understand if there is anything I can do to avoid it, or possibly give you some ideas on how to fix up the model to avoid it.

But notice that page you gave for the Unfold3D docs says "Modeling rules" - these are meant to be rules that must be followed when creating the model.

If the people who created your original model did not follow those rules, then I guess that model is then not suitable for Unfold3D - you would need to show those modeling rules to the people who create the model to make sure that they don't create an unsuitable one.

I understand that is probably not practical for you to actually be able to do in your particular situation, but following these rules during model creation is what is intended to be done for use with Unfold3D I think.

Remember - MoI's mesher does not have artifical intelligence and is not generally intended to alter the topology or overall structure of a model that you give it to mesh - on the contrary, it generally tries to follow the topology and structure that it is given as best it can.

If you need a topology to follow special rules, if you give the mesher a model with topology that breaks those rules you will then probably get a mesh that also breaks those rules.

Again, remember that saying "garbage in, garbage out" - if you input objects to the mesher that are not configured properly for what you want, probably the exported mesh is not going to be configured properly neither.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Michael Gibson
2453.9 In reply to 2453.6 
Hi Micha - one other note on "butterfly points" - maybe these could also happen if the mesh that MoI exported did not get completely welded.

One thing you may want to look at is if your base object is of very small or very large size in units. I mean for example if your entire model is something like 0.03 units across, or 100000 units across, either of those can cause some problems.

If you try to get your model to be a more consistent size more like 10 units across instead of very large or very small that may help various things work more smoothly and may have points welded better.

Just another possible thing to look at anyway.


Probably a lack of welding is what would be generating your butterfly points in most cases rather than a completely unsuitable modeled topology. Another big thing to check though is whether your object is a closed solid or not, if it is not a solid then some edges of it are open edges which will then generate open border edges which is part of what makes a "butterfly point". So that is another big thing to check for.


Objects of a very small or large size can be harder to get automatically joined into a solid when imported from IGES or something like that.


- Michael

EDITED: 3 Mar 2009 by MICHAEL GIBSON

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All