MCPcopy Create free account
hub / github.com/andrewwillmott/splines-lib / SubdivideForLength

Function SubdivideForLength

Splines.cpp:1370–1385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1368namespace
1369{
1370 void SubdivideForLength(const Spline2& s, vector<Spline2>* splines, float tolerance)
1371 {
1372 float error;
1373 float length = LengthEstimate(s, &error);
1374
1375 if (error <= tolerance * length)
1376 splines->push_back(s);
1377 else
1378 {
1379 Spline2 s1, s2;
1380 Split(s, &s1, &s2);
1381
1382 SubdivideForLength(s1, splines, tolerance);
1383 SubdivideForLength(s2, splines, tolerance);
1384 }
1385 }
1386}
1387
1388void SL::SubdivideForLength(vector<Spline2>* splinesIn, float tolerance)

Callers 1

SubdivideForLengthMethod · 0.85

Calls 1

SplitFunction · 0.85

Tested by

no test coverage detected