Skip to content

Commit

Permalink
-change the Z of the inputs to the mesher to be 0.0. Bug 15246 expose…
Browse files Browse the repository at this point in the history
…s a bug that is caused by variable z values. These are not needed by the mesher.
  • Loading branch information
alemon-aquaveo committed Jul 12, 2024
1 parent 965dec6 commit 7d07972
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion xmsmesher/meshing/MePolyMesher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,17 @@ class MePolyMesherImpl : public MePolyMesher
}; // class MePolyMesherImpl

//----- Internal functions -----------------------------------------------------
namespace {
//------------------------------------------------------------------------------
/// \brief Sets the Z to 0.0 in a vector of Pt3d
//------------------------------------------------------------------------------
static void iSetPt3dZtoZero(VecPt3d& a_vec)
{
for (auto& pt : a_vec)
pt.z = 0.0;
} // i_Set_Pt3d_Z_to_Zero

}
//----- Class / Function definitions -------------------------------------------

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -249,16 +259,25 @@ bool MePolyMesherImpl::MeshIt(const MeMultiPolyMesherIo& a_input,

m_polyId = polyInput.m_polyId;
m_outPoly = polyInput.m_outPoly;
iSetPt3dZtoZero(m_outPoly);
m_seedPts = polyInput.m_seedPoints;
iSetPt3dZtoZero(m_seedPts);
m_relaxSeedPoints = polyInput.m_relaxSeedPoints;
ComputeTolerance();

// holes inside the outer polygons
m_inPolys = polyInput.m_insidePolys;
for (auto& pts : m_inPolys)
{
iSetPt3dZtoZero(pts);
}
// bias term
m_bias = polyInput.m_bias;
// refine pts
m_refineToPolys->SetRefinePoints(a_input.m_refPts, m_xyTol);
std::vector<MeRefinePoint> refPts = a_input.m_refPts;
for (auto& rp : refPts)
rp.m_pt.z = 0.0;
m_refineToPolys->SetRefinePoints(refPts, m_xyTol);
m_refineToPolys->RefPtsAsPolys(polyInput.m_polyId, m_outPoly, m_inPolys, m_refPtPolys,
m_refMeshPts, m_refPtsTooClose);
// size function
Expand Down Expand Up @@ -312,9 +331,12 @@ bool MePolyMesherImpl::MeshIt(const VecPt3d& a_outPoly,
VecInt& a_triangles)
{
m_outPoly = a_outPoly;
iSetPt3dZtoZero(m_outPoly);
ComputeTolerance();
SortPoly(m_outPoly);
m_inPolys = a_inPolys;
for (auto& pts : m_inPolys)
iSetPt3dZtoZero(pts);
m_bias = a_bias;
VecInt cells;
return MeshFromInputs(a_points, a_triangles, cells);
Expand Down

0 comments on commit 7d07972

Please sign in to comment.