Skip to content

Commit

Permalink
levelset: fix evaluation of segment information for segment with non-…
Browse files Browse the repository at this point in the history
…ordered vertices

The function that projects a point onto a polygon expects in input an
anti-clockwise ordered list of vertex coordinates.
  • Loading branch information
andrea-iob committed Mar 21, 2023
1 parent a1cd488 commit 7bdc10a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/levelset/levelSetSegmentationObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,9 @@ int SegmentationKernel::getSegmentInfo( const std::array<double,3> &pointCoords,

default:
{
ConstProxyVector<long> elementVertexIds = m_surface->getFacetOrderedVertexIds(segment);
BITPIT_CREATE_WORKSPACE(segmentVertexCoors, std::array<double BITPIT_COMMA 3>, nSegmentVertices, ReferenceElementInfo::MAX_ELEM_VERTICES);
m_surface->getElementVertexCoordinates(segment, segmentVertexCoors);
m_surface->getVertexCoords(elementVertexIds.size(), elementVertexIds.data(), segmentVertexCoors);
pointProjectionVector -= CGElem::projectPointPolygon( pointCoords, nSegmentVertices, segmentVertexCoors, lambda );

break;
Expand Down

0 comments on commit 7bdc10a

Please sign in to comment.