MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / Distance

Method Distance

src/Mod/Mesh/App/Core/Algorithm.cpp:1852–1876  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1850}
1851
1852bool MeshAlgorithm::Distance(
1853 const Base::Vector3f& rclPt,
1854 FacetIndex ulFacetIdx,
1855 float fMaxDistance,
1856 float& rfDistance
1857) const
1858{
1859 const MeshFacetArray& rclFAry = _rclMesh._aclFacetArray;
1860 const MeshPointArray& rclPAry = _rclMesh._aclPointArray;
1861 const PointIndex* pulIdx = rclFAry[ulFacetIdx]._aulPoints;
1862
1863 BoundBox3f clBB;
1864 clBB.Add(rclPAry[*(pulIdx++)]);
1865 clBB.Add(rclPAry[*(pulIdx++)]);
1866 clBB.Add(rclPAry[*pulIdx]);
1867 clBB.Enlarge(fMaxDistance);
1868
1869 if (!clBB.IsInBox(rclPt)) {
1870 return false;
1871 }
1872
1873 rfDistance = _rclMesh.GetFacet(ulFacetIdx).DistanceToPoint(rclPt);
1874
1875 return rfDistance < fMaxDistance;
1876}
1877
1878float MeshAlgorithm::CalculateMinimumGridLength(
1879 float fLength,

Callers 15

asCircleMethod · 0.45
isCrazyMethod · 0.45
dumpEdgeMethod · 0.45
mouseMoveMethod · 0.45
releaseButtonMethod · 0.45
isPlanarMethod · 0.45
isLinearMethod · 0.45
getPointsMethod · 0.45
IsValidEdgeMethod · 0.45

Calls 5

IsInBoxMethod · 0.80
DistanceToPointMethod · 0.80
AddMethod · 0.45
EnlargeMethod · 0.45
GetFacetMethod · 0.45

Tested by

no test coverage detected