mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-19 11:04:39 +00:00
modified MyVolume::isosurface() to remove sliver triangles, still we have an assert error caused by the FaceProjection + Point2Face...
This commit is contained in:
parent
133ea1cfba
commit
046ef0d85d
@ -1,7 +1,6 @@
|
||||
#include "balloon.h"
|
||||
#include "float.h"
|
||||
#include "math.h"
|
||||
#include "../filter_plymc/plymc.h"
|
||||
#include "vcg/complex/trimesh/update/curvature.h"
|
||||
|
||||
using namespace vcg;
|
||||
@ -339,16 +338,6 @@ void Balloon::evolveBalloon(){
|
||||
//--- Estrai isosurface
|
||||
vol.isosurface( surf, 0 );
|
||||
|
||||
//--- Remove slivers which might crash the whole system (reuses the one defined by plymc)
|
||||
// Paolo: il parametro perc va dato in funzione della grandezza del voxel se gli dai come
|
||||
// perc: perc=voxel.side/4 sei safe
|
||||
surf.vert.EnableVFAdjacency();
|
||||
surf.face.EnableVFAdjacency();
|
||||
surf.face.EnableFFAdjacency();
|
||||
vcg::tri::UpdateTopology<CMeshO>::VertexFace( surf );
|
||||
vcg::tri::UpdateTopology<CMeshO>::FaceFace( surf );
|
||||
tri::Simplify( surf, vol.getDelta()/4 );
|
||||
|
||||
//--- Clear band for next isosurface, clearing the corresponding computation field
|
||||
for(unsigned int i=0; i<vol.band.size(); i++){
|
||||
Point3i& voxi = vol.band[i];
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#include "volume.h"
|
||||
#include "myheap.h" // only required by source
|
||||
#include "../filter_plymc/plymc.h" // remove bad triangles from marching cubes
|
||||
|
||||
using namespace vcg;
|
||||
/// the array is used to scan a single voxel that contains the triangle in the initialization
|
||||
@ -233,6 +234,16 @@ void MyVolume::isosurface( CMeshO& mesh, float offset ){
|
||||
(*vi).P()[2] = ((*vi).P()[2]-padsize) * delta + bbox.min[2];
|
||||
}
|
||||
|
||||
|
||||
//--- Remove slivers which might crash the whole system (reuses the one defined by plymc)
|
||||
// Paolo: il parametro perc va dato in funzione della grandezza del voxel se gli dai come
|
||||
// perc: perc=voxel.side/4 sei safe
|
||||
mesh.vert.EnableMark();
|
||||
mesh.vert.EnableVFAdjacency();
|
||||
mesh.face.EnableVFAdjacency();
|
||||
tri::UpdateTopology<CMeshO>::VertexFace( mesh );
|
||||
tri::Simplify( mesh, getDelta()/4 );
|
||||
|
||||
// Update surface normals
|
||||
vcg::tri::UpdateNormals<CMeshO>::PerVertexNormalizedPerFaceNormalized( mesh );
|
||||
vcg::tri::UpdateFlags<CMeshO>::FaceProjection(mesh); // needed to have more robust face distance tests
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user