Open RogersDoug opened 8 years ago
Do you have an example file to share and/or a log?
The vtx obj reader is increasing the point count if there are normals or texture coordinates causing the remesh to fail.
https://www.dropbox.com/s/qd8rprg3o6p7ncr/bunny.zip?dl=0
As a test, I eliminated normals and texture coordinates from the OBJ reader. This fixed the issue, but it is an not ideal fix. Can ACVD be extended to support vertex attributes like normals and texture coordinates?
Is there a way to get a list of all the clustered faces that will produce a vertex on the reduced mesh?
The vtx obj reader is increasing the point count if there are normals or texture coordinates causing the remesh to fail.
Launching ACVD on this mesh gives me : ./ACVD bunny.obj 1000 0 load : bunny.obj
Mesh with 69664 polygons, 208992 points, 208992 edges Bounding Box: [-94.6899, 32.9874, -61.8736] [61.0091, 187.321, 58.7997] The mesh is made of 69664 triangles 208992 non-manifold edges and 208992 boundary edges The mesh has 69664 connected components Valences entropy: 0 0 disconnected vertices, 208992 connected vertices 100 percent of irregular vertices Mesh geometry quality: AngleMin=0.000472145 AverageMinAngle=36.744 Qmin=7.1367e-06 Qav=0.712631 P30=2.35081
The two important lines are : The mesh is made of 69664 triangles The mesh has 69664 connected components
which means that this is a triangle soup and not a surface mesh. Triangles need to be connected.
As a test, I eliminated normals and texture coordinates from the OBJ reader. This fixed the issue,
Are you shure you have not also merged vertices to get a one-connected component mesh?
Is there a way to get a list of all the clustered faces that will produce a vertex on the reduced mesh?
the code is not written but in ACVD.cxx, you can get the clustering result as Clusterging->GetClustering() which returns for each vertex its associated cluster i.e. the vertex in the new mesh
which means that this is a triangle soup and not a surface mesh. Triangles need to be connected.
They are connected as a surface in the in the input file, but the obj reader splits them. There are two issues.
1) obj read splits points if the attributes are difference (texture coordinate or normals)
2) ACVD does not support vertex attributes.
obj read splits points if the attributes are difference (texture coordinate or normals)
If that's really the case, it is a problem from vtkOBJReader, you should ping vtk developers; the easiest way would be the vtkusers mailing list
ACVD does not support vertex attributes.
Do you mean that you want also vertex attributes to be present in the simplified mesh?
Do you mean that you want also vertex attributes to be present in the simplified mesh?
Yes. That is exactly what I want. I want the normals and texture coordinates and all vertex data for the simplified mesh.
So we are on the same page, let me make some definitions. A point is a 3d position only (x,y,z). A vertex has a point and other attributes like a normal or texture coordinate. For a cube that has vertex normals for each face, you will have eight points, but 24 vertices (6 faces x 4 verts/face). Each vertex on the face will have the same normal. To maintain discontiguous normals or texture coordinates on a per vertex basis, you must duplicate the points (or have the verts refer to them).
Points
Normals
It looks like the OBJ reader duplicates points, when it should duplicate vertices.
So after simplification, I would like to get the vertex attributes. Ideally the simplification process would be based on vertices, not points only.
Also it would be better to only collapse edges that are along seams or toward them to maintain visual quality of texture and normal borders.
I think putting more logic in attributes handling will be very difficult, as handling these attributes is user-dependent.
What about providing the clustering results (a vertex -> cluster lookup table), using clustering->GetClustering? I could easily do that, and the remaining would have to be performed by the end-user.
The simplification process need to be affected. Handling material or texture boundary conditions would be more useful and could be implemented the same way that boundary conditions are.
See the section 6 about preserving boundary conditions. http://cseweb.ucsd.edu/~ravir/190/2016/garland97.pdf
ACVD handles boundaries differently, see section VI.D here : https://hal.archives-ouvertes.fr/hal-00537025/document
I had forgotten to expose this option. I just did it in this commit : f66daace39c46ea4b9a4d1c247ce7c972830aa84
This option is not perfect but should suit a lot of boundary cases. Does it improve your case?
My interest is in material boundaries vs. mesh boundaries. If I have a sphere with one material in the top half and another material in the bottom half, I would like the result to be that no triangle spans both halves. This is important for simplifying meshes with multiple materials.
I built ACVD on Windows 10 64 bit, VS2015, VTK 7.0.0.
Using .obj files as input does not correctly generate output ply files.