MCPcopy Create free account
hub / github.com/BIMCoderLiang/LNLib / ComputeCurveModifyTolerance

Method ComputeCurveModifyTolerance

src/LNLib/Algorithm/ValidationUtils.cpp:43–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43double LNLib::ValidationUtils::ComputeCurveModifyTolerance(const std::vector<XYZW>& controlPoints)
44{
45 double minWeight = 1.0;
46 double maxDistance = 0.0;
47
48 int size = controlPoints.size();
49 for (int i = 0; i < size; i++)
50 {
51 XYZW temp = controlPoints[i];
52 minWeight = std::min(minWeight, temp.GetW());
53 maxDistance = std::max(maxDistance, temp.ToXYZ(true).Length());
54 }
55
56 return Constants::DistanceEpsilon * minWeight / (1 + std::abs(maxDistance));
57}
58
59
60

Callers

nothing calls this directly

Calls 3

GetWMethod · 0.45
LengthMethod · 0.45
ToXYZMethod · 0.45

Tested by

no test coverage detected