obj2mesh and flat meshes

Hello,
I have a problem with obj2mesh when processing meshing that are flat in
one of the axis directions, eg:

usemtl material
v 0 0 0
v 1 0 0
v 1 1 0
v 0 1 0
f 1/0/0 3/0/0 4/0/0 2/0/0

and obje2mesh reports:
obj2mesh: fatal - no polygons in mesh

The problem is at line 288 in ./src/ot/cvmesh.c, version 3.5.

        for (i = 0; i < 3; i++) {
                if (meshbounds[0][i] >= meshbounds[1][i])
                        error(USER, "no polygons in mesh");

If the range is zero then the meshbounds extents are equal. Perhaps this
should be:

        for (i = 0; i < 3; i++) {
                if (meshbounds[0][i] > meshbounds[1][i])
                        error(USER, "no polygons in mesh");

The only way this could trigger is if no vertices were processed so I
would think there is an easier way to tell if there were no polygons, ie,
what does this check really do? Why not see if the count of polygons is
greater than zero.

James Lee.

This bug was fixed in the source tree over a year ago. You really need to download the HEAD release if you're working with meshes, as this is a relatively new feature. You can download it from <http://www.radiance-online.org/>. Follow the directions very carefully!

-Greg

···

From: James Lee <canoe@onetel.net.uk>
Date: May 27, 2004 9:41:51 AM PDT

Hello,
I have a problem with obj2mesh when processing meshing that are flat in
one of the axis directions, eg:

usemtl material
v 0 0 0
v 1 0 0
v 1 1 0
v 0 1 0
f 1/0/0 3/0/0 4/0/0 2/0/0

and obje2mesh reports:
obj2mesh: fatal - no polygons in mesh

The problem is at line 288 in ./src/ot/cvmesh.c, version 3.5.

        for (i = 0; i < 3; i++) {
                if (meshbounds[0][i] >= meshbounds[1][i])
                        error(USER, "no polygons in mesh");

If the range is zero then the meshbounds extents are equal. Perhaps this
should be:

        for (i = 0; i < 3; i++) {
                if (meshbounds[0][i] > meshbounds[1][i])
                        error(USER, "no polygons in mesh");

The only way this could trigger is if no vertices were processed so I
would think there is an easier way to tell if there were no polygons, ie,
what does this check really do? Why not see if the count of polygons is
greater than zero.

James Lee.