[Bf-committers] Patch for bug 1355

Ton Roosendaal bf-committers@blender.org
Sun, 13 Jun 2004 12:26:28 +0200


Although the method used is very simple, it has the advantage of the  
simplicity too. Carefully examining the sample file (in bug report) and  
what the code does, some aspects pop up:

- the Mesh is highly irregular (face centroids at unreliable places)
- the Mesh has non-flat quads


- the code doesn't take quads into account at all
- the code uses (cpu cheapness) manhattan distance, no real distance.

You could have checked that converting the error file to triangles  
already worked, but not in all cases... for the latter the manhattan  
distance solves it.

Most important was just adding code to evaluate quads properly, meaning  
treating them as 2 individual triangles, since the quads can be  
non-flat. Check the commit I just did.

Still, the used system is simple, and I bet you can find some  
situations it won't work for. An improved system only can work when it:

- separates parts first with a sortof select-connected
- from each part, find the face that has least intersections with other  
faces, with one of its possible normals (both face sides).

Which all will be quite costy, and I propose we could wait for problem  
files & evidence first. :)


On Saturday, Jun 12, 2004, at 21:57 Europe/Amsterdam,  
jeremy@marzhillstudios.com wrote:

> On 12 Jun 2004 at 14:12, Jiri Hnidek wrote:
>> Hi,
>> it works for me, but can you tell me: "What is meaning of variable
>> dotcent?" ;-)
> I was fiddling with the feature some more today and noticed it still
> doesn't work for all meshes, particularly a uvsphere mesh.
> I can make it work for the sphere mesh but then it won't work for the
> bug blend. Basically I had two possible ways to calculate whether a
> normal was facing in or out. One used the mesh centroid and the other
> used the centroid of an adjacent face and the test face.
> The adjacent face method worked for sphere but not test blend. The
> mesh centroid worked for test blend but not sphere. Anyone got a
> suggestion as to how to proceed from here? Its possible we migh need
> to offer a selection of algorithms for this function. Different types
> of meshes need different types of methods.
> Jeremy Wall
> _______________________________________________
> Bf-committers mailing list
> Bf-committers@blender.org
> http://www.blender.org/mailman/listinfo/bf-committers
Ton Roosendaal  Blender Foundation ton@blender.org