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 #ifndef CV3D_H
#define CV3D_H #define CV3D_H
#define CGAL_INEXACT //#define CGAL_INEXACT
#define CGAL_HIERARCHY #define CGAL_HIERARCHY
#include "CGALTriangulation3Ddefs.H" #include "CGALTriangulation3Ddefs.H"

View File

@ -1,5 +1,4 @@
EXE_DEBUG = -DFULLDEBUG -g -O0 //EXE_DEBUG = -DFULLDEBUG -g -O0
//EXE_DEBUG =
include $(GENERAL_RULES)/CGAL include $(GENERAL_RULES)/CGAL
FFLAGS = -DCGAL_FILES='"${CGAL_PATH}/CGAL/files"' 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 // 3: adjust the spacing of remaining points on a pair by pair basis to
// remove excess points and add points to long uncontrolled spans. // remove excess points and add points to long uncontrolled spans.
const edge& e(edges[edgeI]); const edge& e(edges[edgeI]);
const point& eStart(localPts[e.start()]); const point& eStart(localPts[e.start()]);
@ -328,7 +329,7 @@ void Foam::CV3D::smoothEdge
tempEdgePoints.append tempEdgePoints.append
( (
eStart + (edgePoint - eStart) eStart + (edgePoint - eStart)
* tols_.featurePointGuard/edgeDist * tols_.featurePointGuard/edgeDist
); );
startGuardPlaced = true; startGuardPlaced = true;
@ -350,7 +351,7 @@ void Foam::CV3D::smoothEdge
else if else if
( (
edgeDist > tols_.featurePointGuard edgeDist > tols_.featurePointGuard
&& edgeDist < (edgeLength - tols_.featurePointGuard) && edgeDist < (edgeLength - tols_.featurePointGuard)
) )
{ {
tempEdgePoints.append(edgePoint); tempEdgePoints.append(edgePoint);
@ -377,15 +378,37 @@ void Foam::CV3D::smoothEdge
point newEdgePoint(vector::zero); 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)
{ {
tempEdgePoints.append(edgePoints[0]); 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 else
(
(edgeDistances[1] - edgeDistances[0]) > tols_.edgeGroupSpacing
)
{ {
// ...add the first point by default
tempEdgePoints.append(edgePoints[0]); 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()); edgePoints.transfer(tempEdgePoints.shrink());
} }
@ -794,7 +827,8 @@ void Foam::CV3D::insertSurfaceNearestPointPairs()
for for
( (
Triangulation::Finite_vertices_iterator vit = finite_vertices_begin(); Triangulation::Finite_vertices_iterator vit =
finite_vertices_begin();
vit != finite_vertices_end(); vit != finite_vertices_end();
vit++ vit++
) )
@ -852,14 +886,17 @@ void Foam::CV3D::insertSurfaceNearestPointPairs()
edgePoints.shrink(); edgePoints.shrink();
edgeLabels.shrink(); edgeLabels.shrink();
smoothEdgePositions(edgePoints, edgeLabels); if (edgePoints.size())
{
smoothEdgePositions(edgePoints, edgeLabels);
insertEdgePointGroups insertEdgePointGroups
( (
edgePoints, edgePoints,
edgeLabels, edgeLabels,
"surfaceNearestEdgePoints.obj" "surfaceNearestEdgePoints.obj"
); );
}
} }
DynamicList<point> allNearSurfacePoints(nSurfacePointsEst); DynamicList<point> allNearSurfacePoints(nSurfacePointsEst);