Skip to content

Commit

Permalink
Change the function that generates centroid triangles to generate the…
Browse files Browse the repository at this point in the history
…m regardless of whether the cell points are oriented CW or CCW.
  • Loading branch information
csmemoe-aquaveo committed Feb 23, 2022
1 parent c514192 commit 0cc4768
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dev/xmsprofile_debug
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ compiler=Visual Studio
compiler.version=14
build_type=Debug
[options]
xmsextractor:xms=False
xmsextractor:wchar_t=typedef
xmsextractor:pybind=False
xmsextractor:testing=True
[build_requires]
Expand Down
9 changes: 2 additions & 7 deletions xmsextractor/ugrid/XmUGridTriangulatorBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,9 @@ bool XmUGridTriangulatorBase::GenerateCentroidTriangles(int a_cellIdx,
Pt3d centroid = gmComputeCentroid(polygon);

// make sure the centroid is located inside the cell
for (size_t pointIdx = 0; pointIdx < polygon.size(); ++pointIdx)
if (gmPointInPolygon2D(polygon, centroid) != 1)
{
const Pt3d& pt1 = polygon[pointIdx];
const Pt3d& pt2 = polygon[(pointIdx + 1) % numPoints];

// centroid should be to the left of each edge
if (gmTurn(pt1, pt2, centroid, 0.0) != TURN_LEFT)
return false;
return false;
}

// add centroid to list of points
Expand Down

0 comments on commit 0cc4768

Please sign in to comment.