Fixed small logic error in smoothEdges that meant that point groups at the start and end of the edge weren't handled properly. Changed from compiling with FULLDEBUG. Using the exact kernel because dualisation was causing CGAL to fail an assertion. Going to examine the failing tets and try to check and intervene if possible so the inexact kernel can be used again.

This commit is contained in:
graham
2008-10-03 19:22:57 +01:00
parent 188e43299d
commit e9b537adf2
3 changed files with 55 additions and 19 deletions

View File

@ -43,7 +43,7 @@ SourceFiles
#ifndef CV3D_H
#define CV3D_H
#define CGAL_INEXACT
//#define CGAL_INEXACT
#define CGAL_HIERARCHY
#include "CGALTriangulation3Ddefs.H"

View File

@ -1,5 +1,4 @@
EXE_DEBUG = -DFULLDEBUG -g -O0
//EXE_DEBUG =
//EXE_DEBUG = -DFULLDEBUG -g -O0
include $(GENERAL_RULES)/CGAL
FFLAGS = -DCGAL_FILES='"${CGAL_PATH}/CGAL/files"'

View File

@ -286,6 +286,7 @@ void Foam::CV3D::smoothEdge
// 3: adjust the spacing of remaining points on a pair by pair basis to
// remove excess points and add points to long uncontrolled spans.
const edge& e(edges[edgeI]);
const point& eStart(localPts[e.start()]);
@ -377,15 +378,37 @@ void Foam::CV3D::smoothEdge
point newEdgePoint(vector::zero);
if (edgePoints.size() == 1)
// if (edgePoints.size() == 1)
// {
// tempEdgePoints.append(edgePoints[0]);
// }
// else if
// (
// (edgeDistances[1] - edgeDistances[0]) > tols_.edgeGroupSpacing
// )
// {
// tempEdgePoints.append(edgePoints[0]);
// }
if (edgePoints.size() > 1)
{
if ((edgeDistances[1] - edgeDistances[0]) < tols_.edgeGroupSpacing)
{
// ...the first two points on the edge start a group
newEdgePoint += edgePoints[0];
groupSize++;
}
else
{
tempEdgePoints.append(edgePoints[0]);
}
else if
(
(edgeDistances[1] - edgeDistances[0]) > tols_.edgeGroupSpacing
)
}
else
{
// ...add the first point by default
tempEdgePoints.append(edgePoints[0]);
}
@ -418,6 +441,16 @@ void Foam::CV3D::smoothEdge
}
}
if (groupSize > 0)
{
// A point group has been formed at the end of the edge and needs to
// be finished.
newEdgePoint /= groupSize;
tempEdgePoints.append(newEdgePoint);
}
edgePoints.transfer(tempEdgePoints.shrink());
}
@ -794,7 +827,8 @@ void Foam::CV3D::insertSurfaceNearestPointPairs()
for
(
Triangulation::Finite_vertices_iterator vit = finite_vertices_begin();
Triangulation::Finite_vertices_iterator vit =
finite_vertices_begin();
vit != finite_vertices_end();
vit++
)
@ -852,6 +886,8 @@ void Foam::CV3D::insertSurfaceNearestPointPairs()
edgePoints.shrink();
edgeLabels.shrink();
if (edgePoints.size())
{
smoothEdgePositions(edgePoints, edgeLabels);
insertEdgePointGroups
@ -861,6 +897,7 @@ void Foam::CV3D::insertSurfaceNearestPointPairs()
"surfaceNearestEdgePoints.obj"
);
}
}
DynamicList<point> allNearSurfacePoints(nSurfacePointsEst);
DynamicList<point> allSurfacePoints(nSurfacePointsEst);