[v8i mdl] mdlMesh_newPolyfaceFromExpandedXYTriangulation Problems

Problem Image: http://imgur.com/Bfe978i 

For some reason when I try to mesh these points, the meshing API is connecting one side to the other instead of connecting to the nearest vertex.  The points are all laid out at approx 5 foot intervals.

I have tried all sorts of values for the expansionFraction, I have also tried the basic mdlMesh_newPolyfaceFromXYTriangulation call, same results.

MSElementDescrP mesh = NULL;

if(meshPoints.size() >= 3){

if (SUCCESS != mdlMesh_newPolyfaceFromExpandedXYTriangulation(&mesh, &meshPoints.at(0), meshPoints.size(), 0.1, true))
{
     return;
 }

}

Any ideas?

Parents Reply
  • iifuzz said:
    std::sort(meshPoints.begin(), meshPoints.end(), sortPnts)

    Excellent:  a practical demonstration of the C++ standard library sort algorithm!

    C++ Pass-by-Reference

    iifuzz said:
    std::sort(meshPoints.begin(), meshPoints.end(), sortPnts)

    You can avoid having your predicate function copy its parameters if you pass-by-const-reference …

    inline bool sortPnts(const DPoint3d& p1, const DPoint3d& p2) {  
      return (p1.x < p2.x) || (p1.x == p2.x && p1.y < p2.y);
    }

     
    Regards, Jon Summers
    LA Solutions

Children