Skip to content
Snippets Groups Projects
Commit c6cf0b09 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[MeL] Use exact predicates for point projection

Previously using inexact predicates would yield ambiguous results whether a point
is inside or outside of a projected element, depending on compiler and architecture.

The exact predicates are slower, so one could think about to add a run-time flag to
use exact or inexact predicates giving the user an option for fast or correct calculations.
parent 1615ae66
No related branches found
No related tags found
No related merge requests found
...@@ -21,10 +21,8 @@ namespace ProjectPointOnMesh ...@@ -21,10 +21,8 @@ namespace ProjectPointOnMesh
Element const* getProjectedElement(std::vector<const Element*> const& elements, Element const* getProjectedElement(std::vector<const Element*> const& elements,
MathLib::Point3d const& node) MathLib::Point3d const& node)
{ {
auto is_right_of = [&node](Node const& a, Node const& b) { auto is_right_of = [&node](Node const& a, Node const& b)
return GeoLib::getOrientationFast(node, a, b) == { return GeoLib::getOrientation(node, a, b) == GeoLib::Orientation::CW; };
GeoLib::Orientation::CW;
};
for (auto const* e : elements) for (auto const* e : elements)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment