20 #include <boost/make_shared.hpp> 21 #include <boost/thread/mutex.hpp> 78 virtual void SetSizeFunc(BSHP<InterpBase> a_interp)
override;
81 double a_sizeBias)
override;
105 double a_meanSpacing,
106 double a_minimumCurvature,
107 bool a_smooth)
override;
111 int a_polyOffsetIter);
114 virtual std::string
ToPyRepr()
const override;
132 const VecDbl& a_segLengths,
133 const VecDbl& a_segTvalues,
134 const VecDbl& a_interpLengths,
228 for (
size_t i = 0; i < vTris.size(); ++i)
274 Pt3d pMin(p[0]), pMax(p[0]);
275 for (
size_t i = 0; i < nPts; ++i)
287 double boundsDistSq =
MdistSq(pMin.x, pMin.y, pMax.
x, pMax.
y);
302 double a_meanSpacing,
303 double a_minimumCurvature,
323 int a_polyOffsetIter)
328 a_out.
m_pts.resize(0);
330 for (
size_t i = 0; i < a_input.
m_loops.size(); ++i)
339 pts.push_back(pts.front());
344 if (!redistPts.empty())
345 redistPts.pop_back();
384 std::string msg =
"MePolyRedistributePts set to use curvature redistribution; " 385 "MePolyRedistributePtsImpl::SizeFromLocation can not be call with these " 386 "settings. XM_NODATA will be returned.";
396 return lengths.front();
404 std::stringstream ss;
409 ss <<
"size_func: <class: InterpBase>\n";
415 std::string offOn[2] = {
"False",
"True"};
430 ret.reserve(a_idx.size());
431 for (
size_t i = 0; i < a_idx.size(); ++i)
432 ret.push_back(a_pts[a_idx[i]]);
443 for (
size_t i = 0; i < a_pts.size(); ++i)
445 Pt3d p0(a_pts[i]), p1(a_pts[0]);
446 if (i < a_pts.size() - 1)
449 auto start = pts.begin();
452 newPts.insert(newPts.end(), start, pts.end());
466 a_lengths.assign(a_pts.size(), 0.0);
488 for (
size_t i = 0; i < s.size(); ++i)
489 a_lengths[i] = (
double)s[i];
500 double lastInterp(-1), distSq(0);
504 lastInterp = a_lengths[0];
508 for (
size_t i = 1; i < a_pts.size(); ++i)
510 distSq =
MdistSq(aPt.
x, aPt.
y, a_pts[i].x, a_pts[i].y);
513 a_lengths[i] = lastInterp;
517 lastInterp = a_lengths[i];
528 for (
size_t i = 0; i < lengths.size(); ++i)
530 sum = sum / lengths.size();
532 std::stringstream ss;
533 ss <<
"Interpolator not defined in MePolyRedistributePts. Size function " 534 "set to constant value: " 568 double& d(a_lengths[a_idx]);
604 double diff(0), factor(0);
609 for (
size_t i = 0; i < nPts; ++i)
615 a_wt[i] = 1 / a_d2[i];
632 static bool debug(
false);
637 VecDbl segLength, segTvalues;
644 tVals.reserve(a_pts.size());
645 tVals.push_back(0.0);
646 for (
size_t i = 0; i < a_pts.size() - 1; ++i)
649 if (i + 1 < a_pts.size() - 1)
651 TvaluesForSeg(i, nextIdx, segLength, segTvalues, a_interpLengths, pcntin, tVals);
653 double aveTincrement(0);
654 for (
size_t i = 1; i < tVals.size(); ++i)
656 aveTincrement += tVals[i] - tVals[i - 1];
658 aveTincrement /= (tVals.size() - 1);
664 double leftOverTval = 1 - tVals.back();
665 if (tVals.size() < 2)
670 if (leftOverTval >= 0)
671 leftOverTval = 1 - tVals.back();
673 if (tVals.size() > 2)
675 double redistT = (leftOverTval - aveTincrement) / tVals.size();
676 for (
size_t i = 1; i < tVals.size(); ++i)
677 tVals[i] += (i * redistT);
679 else if (segLength.size() > 3)
686 if (tVals.size() > 2)
688 tVals.push_back(1.0);
689 ret.reserve(tVals.size());
692 ret.push_back(a_pts[0]);
696 for (
size_t i = 1; i < tVals.size(); ++i)
698 double segT0, segT1, tVal = tVals[i];
701 tVal = (tVal - segT0) / (segT1 - segT0);
704 if (segIdx + 1 < a_pts.size())
705 nextIdx = segIdx + 1;
706 const Pt3d &p0(a_pts[segIdx]), &p1(a_pts[nextIdx]);
708 pt.
x = p0.x + tVal * (p1.
x - p0.x);
709 pt.
y = p0.y + tVal * (p1.
y - p0.y);
724 finalpts.reserve(a_pts.size());
725 int numint((
int)a_pts.size());
726 double pcntin(0), pcntleft(0);
728 Pt3d prevpt(a_pts[0]);
729 prevpt.
z = a_interpLengths[0];
730 Pt3d nextpt(a_pts[1]);
731 nextpt.
z = a_interpLengths[1];
732 double len_segs(0), len_arc(0), length(0);
733 len_arc = length =
Mdist(prevpt.
x, prevpt.
y, nextpt.
x, nextpt.
y);
735 double totdist(0), w1(0), w2(0);
741 pcntleft = pcntin + 2 * length / (w1 + w2);
745 double scale = 1.0 - pcntin;
746 double ptlength = 2 * scale * w1 * length / (2 * length + scale * (w1 - w2));
749 double pcnt = ptlength / length;
750 double newweight = w1 * (1 - pcnt) + w2 * pcnt;
753 finalpts.push_back(
Pt4d());
754 finalpts[numfinal - 1].x = prevpt.
x + pcnt * (nextpt.
x - prevpt.
x);
755 finalpts[numfinal - 1].y = prevpt.
y + pcnt * (nextpt.
y - prevpt.
y);
756 finalpts[numfinal - 1].z = newweight;
757 finalpts[numfinal - 1].w = totdist;
759 prevpt = finalpts[numfinal - 1];
768 if (++nextid < numint)
772 nextpt = a_pts[nextid];
773 nextpt.
z = a_interpLengths[nextid];
775 length =
Mdist(prevpt.
x, prevpt.
y, nextpt.
x, nextpt.
y);
786 double len_segs_to_adjust = 0.0;
788 double len_arc_to_adjust = len_arc - len_segs;
790 int first_pt_to_move = numfinal - 1;
796 len_segs_to_adjust = (length + totdist) / pcntleft;
798 while (first_pt_to_move >= 0 && finalpts[first_pt_to_move].w < w1 * 2.0 &&
799 finalpts[first_pt_to_move].w > w1 * 0.5)
801 len_segs_to_adjust += finalpts[first_pt_to_move].w;
802 len_arc_to_adjust += finalpts[first_pt_to_move].w;
807 double scale = len_arc_to_adjust / len_segs_to_adjust;
811 prevpt.
z = a_interpLengths[0];
813 nextpt.
z = a_interpLengths[1];
814 length =
Mdist(prevpt.
x, prevpt.
y, nextpt.
x, nextpt.
y);
815 for (
int i = 0; i < numfinal; i++)
817 if (i < first_pt_to_move)
819 totdist = finalpts[i].w;
821 while (totdist > length)
827 nextpt = a_pts[nextid];
828 nextpt.
z = a_interpLengths[nextid];
829 length =
Mdist(prevpt.
x, prevpt.
y, nextpt.
x, nextpt.
y);
834 totdist = finalpts[i].w * scale;
836 while (totdist > length)
842 nextpt = a_pts[nextid];
843 nextpt.
z = a_interpLengths[nextid];
844 length =
Mdist(prevpt.
x, prevpt.
y, nextpt.
x, nextpt.
y);
847 double pcnt = totdist / length;
848 finalpts[i].x = prevpt.
x + pcnt * (nextpt.
x - prevpt.
x);
849 finalpts[i].y = prevpt.
y + pcnt * (nextpt.
y - prevpt.
y);
851 prevpt = finalpts[i];
858 if (a_pts.front() == a_pts.back() && numfinal < 2)
860 if (a_pts.size() < 3)
864 finalpts[0] = a_pts[a_pts.size() / 3];
865 finalpts[1] = a_pts[a_pts.size() * 2 / 3];
867 ret.assign(finalpts.size() + 2,
Pt3d());
868 ret.front() = a_pts.front();
869 ret.back() = a_pts.back();
870 for (
size_t i = 1; i < finalpts.size(); ++i)
871 ret[i] = finalpts[i];
890 for (
size_t i = 0; i < a_pts.size(); ++i)
893 a_out.
m_pts.push_back(a_pts[i]);
913 const VecDbl& a_segLengths,
914 const VecDbl& a_segTvalues,
915 const VecDbl& a_interpLengths,
920 double length(a_segLengths[a_idx]);
922 double t1(a_segTvalues[a_idx]), t2(a_segTvalues[a_nextIdx]);
926 double w1(a_interpLengths[a_idx]), w2(a_interpLengths[a_nextIdx]);
931 double pcntleft = a_pcntin + (2 * length) / (w1 + w2);
934 double scale = 1.0 - a_pcntin;
935 double ptlength = 2 * scale * w1 * length / (2 * length + scale * (w1 - w2));
936 double pcnt = ptlength / length;
937 double t = (pcnt * (t2 - t1)) + t1;
938 a_tVals.push_back(t);
940 w1 = w1 * (1 - pcnt) + w2 * pcnt;
964 for (
size_t i = 0; i < a_inPolys.size(); ++i)
977 for (
size_t i = 0; i < a_pts.size(); ++i)
980 Pt3d nextPt(a_pts[0]);
981 if (i + 1 < a_pts.size())
984 nextPt = a_pts[i + 1];
988 dx = a_pts[i].x - nextPt.
x;
989 dy = a_pts[i].y - nextPt.
y;
990 l = sqrt(dx * dx + dy * dy);
1012 a_segLength.assign(a_pts.size() - 1, 0);
1013 a_segTvalues.assign(a_pts.size() - 1, 0);
1014 double totalLength(0);
1015 for (
size_t i = 1; i < a_pts.size(); ++i)
1017 const Pt3d &p0(a_pts[i - 1]), &p1(a_pts[i]);
1018 a_segLength[i - 1] =
Mdist(p0.x, p0.y, p1.
x, p1.
y);
1019 totalLength += a_segLength[i - 1];
1022 for (
size_t i = 1; i < a_pts.size() - 1; ++i)
1024 sumLen += a_segLength[i - 1];
1025 a_segTvalues[i] = sumLen / totalLength;
1049 if (a_segIdx >= a_segTvalues.size())
1052 a_segT0 = a_segTvalues[a_segIdx];
1054 if (a_segIdx + 1 < a_segTvalues.size())
1055 a_segT1 = a_segTvalues[a_segIdx + 1];
1060 if (a_tVal >= a_segT0 && a_tVal <= a_segT1)
1065 a_segT0 = a_segTvalues[a_segIdx];
1067 if (a_segIdx + 1 < a_segTvalues.size())
1068 a_segT1 = a_segTvalues[a_segIdx + 1];
1080 for (
size_t i = 0; i <
m_polys.size(); ++i)
1083 m_polys[i][0] = iPtr[idx + 0];
1084 m_polys[i][1] = iPtr[idx + 1];
1085 m_polys[i][2] = iPtr[idx + 2];
1087 BSHP<GmMultiPolyIntersectionSorterTerse> sorterTerse =
1088 boost::make_shared<GmMultiPolyIntersectionSorterTerse>();
1089 BSHP<GmMultiPolyIntersectionSorter> sorter = BDPC<GmMultiPolyIntersectionSorter>(sorterTerse);
1104 int a_polyOffsetIter)
1106 BSHP<MePolyRedistributePtsImpl> r = BDPC<MePolyRedistributePtsImpl>(a_redist);
1108 r->Redistribute(a_input, a_out, a_polyOffsetIter);
1122 using namespace xms;
1143 VecPt3d outPoly = {{0, 0, 0}, {0, 10, 0}, {10, 10, 0}, {10, 0, 0}};
1146 VecPt3d pts = {{1, 1, 0}, {1, 9, 0}, {9, 9, 0}, {9, 1, 0}};
1149 VecDbl baseLengths = {10.0, 10.0, 10.0, 10.0};
1159 VecPt3d outPoly = {{0, 0, 0}, {0, 2, 0}, {0, 4, 0}, {0, 6, 0},
1160 {0, 8, 0}, {0, 10, 0}, {10, 10, 0}, {10, 0, 0}};
1163 VecPt3d pts = {{1, 1, 0}, {1, 9, 0}, {9, 9, 0}, {9, 1, 0}};
1166 VecDbl baseLengths = {5.00892, 5.00892, 9.79527, 9.79527};
1176 VecPt3d outPoly = {{0, 0, 0}, {0, 2, 0}, {0, 4, 0}, {0, 6, 0},
1177 {0, 8, 0}, {0, 10, 0}, {10, 10, 0}, {10, 0, 0}};
1179 VecPt3d in = {{4.9, 5, 0}, {4.95, 4.9, 0}, {5.05, 4.9, 0},
1180 {5.1, 5, 0}, {5.50, 5.1, 0}, {4.95, 5.1, 0}};
1181 inPolys.push_back(in);
1184 VecPt3d pts = {{1, 1, 0}, {1, 9, 0}, {9, 9, 0}, {9, 1, 0}};
1187 VecDbl baseLengths = {4.96661, 4.96586, 9.71356, 9.71552};
1191 baseLengths = {3.36034, 3.36167, 7.02831, 7.03054};
1201 VecPt3d pts = {{0, 0, 0}, {0, 100, 0}, {100, 100, 0}, {100, 0, 0}};
1204 VecDbl baseLengths(4, 5.0);
1214 VecPt3d pts = {{0, 0, 0}, {0, 100, 0}, {100, 100, 0}, {100, 0, 0}};
1217 VecDbl baseLengths(4, 100.0);
1225 VecPt3d pts = {{0, 0, 0}, {0, 10, 0}, {10, 10, 0}, {10, 0, 0}, {0, 0, 0}};
1226 VecDbl lengths = {5, 5, 5, 5, 5};
1230 VecPt3d basePts = {{0, 0, 0}, {0, 5, 0}, {0, 10, 0}, {5, 10, 0}, {10, 10, 0},
1231 {10, 5, 0}, {10, 0, 0}, {5, 0, 0}, {0, 0, 0}};
1239 VecPt3d pts = {{0, 0, 0}, {0, 10, 0}, {10, 10, 0}, {10, 0, 0}, {0, 0, 0}};
1240 VecDbl lengths = {4, 4, 4, 4, 4};
1244 VecPt3d basePts = {{0, 0, 0}, {0, 4, 0}, {0, 8, 0}, {2, 10, 0}, {6, 10, 0}, {10, 10, 0},
1245 {10, 6, 0}, {10, 2, 0}, {8, 0, 0}, {4, 0, 0}, {0, 0, 0}};
1253 VecPt3d pts = {{0, 0, 0}, {0, 10, 0}, {10, 10, 0}, {10, 0, 0}, {0, 0, 0}};
1254 VecDbl lengths = {3, 3, 3, 3, 3};
1258 VecPt3d basePts = {{0, 0, 0}, {0, 3.08, 0}, {0, 6.15, 0}, {0, 9.23, 0}, {2.31, 10, 0},
1259 {5.38, 10, 0}, {8.46, 10, 0}, {10, 8.46, 0}, {10, 5.38, 0}, {10, 2.31, 0},
1260 {9.23, 0, 0}, {6.15, 0, 0}, {3.08, 0, 0}, {0, 0, 0}};
1268 VecPt3d pts = {{0, 0, 0}, {0, 10, 0}, {10, 10, 0}, {10, 0, 0}, {0, 0, 0}};
1269 VecDbl lengths = {3, 5, 3, 5, 3};
1273 VecPt3d basePts = {{0, 0, 0}, {0, 3.34, 0}, {0, 7.43, 0}, {2.2, 10, 0},
1274 {6.36, 10, 0}, {9.76, 10, 0}, {10, 6.95, 0}, {10, 2.95, 0},
1275 {8.19, 0, 0}, {3.95, 0, 0}, {0, 0, 0}};
1283 VecPt3d pts = {{0, 0, 0}, {0, 10, 0}, {10, 10, 0}, {10, 0, 0}, {0, 0, 0}};
1284 VecDbl lengths = {15, 15, 15, 15, 15};
1288 VecPt3d basePts = {{0, 0, 0}, {3.33, 10, 0}, {10, 3.33, 0}, {0, 0, 0}};
1296 VecPt3d pts = {{0, 0, 0}, {0, 10, 0}, {10, 10, 0}, {10, 0, 0}, {0, 0, 0}};
1297 VecDbl lengths = {20, 20, 20, 20, 20};
1301 VecPt3d basePts = {{0, 0, 0}, {3.33, 10, 0}, {10, 3.33, 0}, {0, 0, 0}};
1310 VecPt3d loop = {{0, 0, 0}, {0, 10, 0}, {10, 10, 0}, {10, 0, 0}};
1311 BSHP<VecPt3d> triPts(
new VecPt3d());
1312 *triPts = {{5, 5, 0}, {-5, -5, 0}, {5, -5, 0}, {15, -5, 0}, {15, 5, 0},
1313 {15, 15, 0}, {5, 15, 0}, {-5, 15, 0}, {-5, 5, 0}};
1314 BSHP<VecInt> triTris(
new VecInt());
1315 *triTris = {0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 5, 0, 5, 6, 0, 6, 7, 0, 7, 8, 0, 8, 1};
1322 VecPt3d baseLoop = {{0, 0, 0}, {0, 5, 0}, {0, 10, 0}, {5, 10, 0},
1323 {10, 10, 0}, {10, 5, 0}, {10, 0, 0}, {5, 0, 0}};
1331 VecPt3d pts = {{0, 0, 0}, {0, 10, 0}, {10, 10, 0}, {10, 0, 0}};
1332 VecDbl lengths = {5, 5, 5, 5};
1336 VecPt3d basePts = {{0, 0, 0}, {0, 5, 0}, {0, 10, 0}, {5, 10, 0},
1337 {10, 10, 0}, {10, 5, 0}, {10, 0, 0}};
1345 VecPt3d pts = {{0, 0, 0}, {0, 10, 0}, {10, 10, 0}, {10, 0, 0}};
1346 VecDbl lengths = {6, 6, 6, 6};
1350 VecPt3d basePts = {{0, 0, 0}, {0, 6, 0}, {2, 10, 0}, {8, 10, 0}, {10, 6, 0}, {10, 0, 0}};
1358 VecPt3d pts = {{0, 0, 0}, {0, 10, 0}, {10, 10, 0}, {10, 0, 0}};
1359 VecDbl lengths = {3, 5, 3, 5};
1363 VecPt3d basePts = {{0, 0, 0}, {0, 3.42, 0}, {0, 7.58, 0}, {2.43, 10, 0}, {6.66, 10, 0},
1364 {10, 9.85, 0}, {10, 6.76, 0}, {10, 3.68, 0}, {10, 0, 0}};
VecPt3d RedistPts(const VecPt3d &a_pts, const VecDbl &lengths)
Uses interpolated lengths to redistribute points on a polyline.
void testRedistPts1()
test redistributing the points on the polygon boundary
Redistributes the point locations on a polygon based on a size function.
void testInterpEdgeLengths1()
tests interpolating the edge length
std::vector< int > VecInt
MePolyRedistributePts()
constructor
double m_meanSpacingCurvature
Used by curvature redistribution. The mean spacing between the distributed points.
double m_constSize
constant size function
VecPt3d RedistPts2(const VecPt3d &a_pts, const VecDbl &lengths)
Uses interpolated lengths to redistribute points on a polyline.
static BSHP< MePolyRedistributePts > New()
Creates an instance of this class.
void SizeFromPolyAddEdgeLengths(const VecPt3d &a_pts)
Calculates average edge lengths at each point in a loop defining a polygon.
bool m_intersectWithTris
flag to indicate that polygon should be intersected with the triangles
void testInterpEdgeLengths2()
tests interpolating the edge length
std::string STRstd(double a_value, int a_n, int width, int flags)
std::vector< double > VecDbl
double m_distSqTol
tolerance used to speed up interpolation
void mePolyPaverRedistribute(BSHP< MePolyRedistributePts > a_redist, const MePolyOffsetterOutput &a_input, MePolyOffsetterOutput &a_out, int a_polyOffsetIter)
Free function access an implement method that needs to be hidden from the public interface.
std::vector< float > VecFlt
double m_sizeBias
transition factor for size function
virtual void SetConstantSizeFunc(double a_size) override
Sets the size function to a constant value.
void SetUseCurvatureRedistribution(double a_featureSize, double a_meanSpacing, double a_minimumCurvature, bool a_smooth) override
Specifies that curvature redistribution will be used.
virtual ~MePolyRedistributePts()
destructor
BSHP< MePolyRedistributePtsCurvature > m_curvatureRedist
Point redistributor that uses curvature.
VecDbl m_polyEdgeLengths
edge lengths of the polygon
double m_minLength
min segment length in polygon
BSHP< VecPt3d > m_polyPts
polygon point locations
static boost::shared_ptr< GmMultiPolyIntersector > New(const std::vector< Pt3d > &a_points, const std::vector< std::vector< int > > &a_polys, boost::shared_ptr< GmMultiPolyIntersectionSorter > a_sorter, int a_startingId=1)
void IntersectWithTris(VecPt3d &a_pts)
Creates a vector of pts from indices into another vector of points.
void testRedistPts5()
test redistributing the points on the polygon boundary
convenience class for holding output data from the MePolyOffsetter
std::vector< Pt3d > m_pts
locations used by polygons
void testRedistPts4()
test redistributing the points on the polygon boundary
void testInterpEdgeLengths()
tests interpolating the edge length
void InterpToPoint(size_t a_idx, const VecPt3d &a_pts, VecDbl &a_lengths, VecDbl &a_wt, VecDbl &a_d2, double &a_bias)
Interpolates to a point from the boundary of the polygon.
void InterpEdgeLengths(const VecPt3d &a_pts, VecDbl &lengths)
Interpolates edge lengths to each of the points that make up a polyline.
void GetSegmentFromTval(const VecDbl &a_segTvalues, double a_tVal, size_t &a_segIdx, double &a_segT0, double &a_segT1)
Finds the segment that contains a_tVal.
void testInterpEdgeLengths4()
tests interpolating the edge length
std::vector< VecInt > VecInt2d
Redistributes points along polylines using a size function.
void testRedistPolyLine1()
test redistributing the points on a polyline
BSHP< GmMultiPolyIntersector > m_polyIntersector
used to intersect the polygon with m_sizeTris
BSHP< InterpBase > m_interp
interpolation class given to this class
void CreatePolyIntersector()
Creates the poly intersector class member variable.
std::vector< std::size_t > VecSizet
double MdistSq(_T x1, _U y1, _V x2, _W y2)
void SizeFromPolyCalcAveEdgeLengthAtPts(const VecPt3d &a_outPoly, const VecPt3d2d &a_inPolys)
Calculates average edge lengths at each point in a loop defining a polygon.
double m_maxLength
max segment length in polygon
#define XM_ENSURE_TRUE(...)
void testIntersectWithTris()
tests intersecting the polygon with the triangles from the interp size function
virtual void SetSizeFunc(BSHP< InterpBase > a_interp) override
Sets the size function interpolator.
void testCreateClass()
tests creating the class
void testRedistPts()
test redistributing the points on the polygon boundary
BSHP< VecPt3d > m_sizePts
points from the m_interp class
void testInterpEdgeLengths3()
tests interpolating the edge length
virtual std::string ToPyRepr() const override
returns a string for use in the python repr attribute
double m_featureSizeCurvature
std::vector< VecPt3d > VecPt3d2d
VecPt3d LoopToVecPt3d(const VecSizet &a_idx, const VecPt3d &a_pts)
Creates a vector of pts from indices into another vector of points.
void Redistribute(const MePolyOffsetterOutput &a_input, MePolyOffsetterOutput &a_out, int a_polyOffsetIter)
Redistributes points on closed loop polylines. The length of edges in the redistribution comes from a...
std::vector< int > m_loopTypes
type of loop
static BSHP< MePolyRedistributePtsCurvature > New()
Creates an instance of this class.
virtual double SizeFromLocation(const Pt3d &a_location) override
returns a size based on the xy location
void CalcSegLengths(const VecPt3d &a_pts, VecDbl &a_segLength, VecDbl &_segTvalues)
Calculates the lengths of segments and parametric values of segment endpoints.
double Mdist(_T x1, _U y1, _V x2, _W y2)
std::vector< std::vector< size_t > > m_loops
indexes of points that define loops
virtual void SetConstantSizeBias(double a_sizeBias) override
Sets the bias for constant value size function.
void TvaluesForSeg(size_t a_idx, size_t a_nextIdx, const VecDbl &a_segLengths, const VecDbl &a_segTvalues, const VecDbl &a_interpLengths, double &a_pcntin, VecDbl &a_tVals)
A single segment of a polygon is analyzed to see where points are redistributed on that segment...
BSHP< VecInt > m_sizeTris
triangles from the m_interp class
virtual void SetSizeFuncFromPoly(const VecPt3d &a_outPoly, const VecPt3d2d &a_inPolys, double a_sizeBias) override
Creates an interpolator that uses the spacing on the input polygon as its scalar. ...
void CalcInterpWeights(const Pt3d &a_pt, VecDbl &a_wt, VecDbl &a_d2, double &a_sumWt)
Calculates the interpolation weights of the points used to do the interpolation.
void RedistPtsToOutput(const VecPt3d &a_pts, int a_polyType, MePolyOffsetterOutput &a_out)
Move the redistributed points to the output class.
void testRedistPolyLine2()
test redistributing the points on a polyline
std::vector< Pt4d > VecPt4d
double m_minimumCurvature
void testRedistPts3()
test redistributing the points on the polygon boundary
void testRedistPolyLine()
test redistributing the points on a polyline
bool m_biasConstSize
flag to indicate transitioning to constant size function
std::vector< Pt3d > VecPt3d
void testRedistPts2()
test redistributing the points on the polygon boundary