Skip to content
Snippets Groups Projects
Commit 7e99cd26 authored by laurence's avatar laurence
Browse files

ENH: Add enhanced edge conformation method

parent a0097c43
Branches
Tags
No related merge requests found
......@@ -2183,54 +2183,59 @@ void Foam::conformalVoronoiMesh::addSurfaceAndEdgeHits
pointIndexHitAndFeature(edHit, featureHit)
);
}
// else if (firstPass)
// {
// label hitIndex = nearestEdgeHit.index();
//
// // Calc new edge location
//// Foam::point newPt =
//// 0.5
//// *(
//// nearestEdgeHit.hitPoint()
//// + edHit.hitPoint()
//// );
//
// pointIndexHit pHitOld =
// edgeLocationTreePtr_().findNearest
// (
// nearestEdgeHit.hitPoint(), GREAT
// );
//
// pointIndexHit pHitNew =
// edgeLocationTreePtr_().findNearest
// (
// edHit.hitPoint(), GREAT
// );
//
// if
// (
// pHitNew.hitPoint() - pHitOld.hitPoint()
// )
// {
// edHit.setPoint(pHit.hitPoint());
//
// featureEdgeHits[hitIndex] =
// pointIndexHitAndFeature(edHit, featureHit);
//
// existingEdgeLocations_[hitIndex] =
// edHit.hitPoint();
//
// // Change edge location in featureEdgeHits
// // remove index from edge tree
// // reinsert new point into tree
// edgeLocationTreePtr_().remove(hitIndex);
// edgeLocationTreePtr_().insert
// (
// hitIndex,
// hitIndex + 1
// );
// }
// }
else if (firstPass)
{
label hitIndex = nearestEdgeHit.index();
// Calc new edge location
Foam::point newPt =
0.5
*(
nearestEdgeHit.hitPoint()
+ edHit.hitPoint()
);
pointIndexHit pHitOld =
edgeLocationTreePtr_().findNearest
(
nearestEdgeHit.hitPoint(), GREAT
);
pointIndexHit pHitNew =
edgeLocationTreePtr_().findNearest
(
edHit.hitPoint(), GREAT
);
if
(
magSqr(pHitNew.hitPoint() - edHit.hitPoint())
< magSqr
(
pHitOld.hitPoint()
- nearestEdgeHit.hitPoint()
)
)
{
edHit.setPoint(edHit.hitPoint());
featureEdgeHits[hitIndex] =
pointIndexHitAndFeature(edHit, featureHit);
existingEdgeLocations_[hitIndex] =
edHit.hitPoint();
// Change edge location in featureEdgeHits
// remove index from edge tree
// reinsert new point into tree
edgeLocationTreePtr_().remove(hitIndex);
edgeLocationTreePtr_().insert
(
hitIndex,
hitIndex + 1
);
}
}
}
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment