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

Method distanceToPoint

src/Base/VectorPyImp.cpp:572–585  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

570}
571
572PyObject* VectorPy::distanceToPoint(PyObject* args) const
573{
574 PyObject* pnt = nullptr;
575 if (!PyArg_ParseTuple(args, "O!", &(VectorPy::Type), &pnt)) {
576 return nullptr;
577 }
578
579 VectorPy* base_vec = static_cast<VectorPy*>(pnt);
580 VectorPy::PointerType this_ptr = getVectorPtr();
581 VectorPy::PointerType base_ptr = base_vec->getVectorPtr();
582
583 Py::Float dist(Distance(*this_ptr, *base_ptr));
584 return Py::new_reference_to(dist);
585}
586
587PyObject* VectorPy::distanceToLine(PyObject* args) const
588{

Callers 15

testCoincidentMethod · 0.80
testPointOnObjectMethod · 0.80
testTangentMethod · 0.80
testSymmetricMethod · 0.80
getCoincidentVertexesFunction · 0.80
testCircleToNurbsMethod · 0.80
testEllipseToNurbsMethod · 0.80
testderivativesMethod · 0.80
setUpClassMethod · 0.80
test44Method · 0.80
test02Method · 0.80
cmdsForEdgeFunction · 0.80

Calls 2

new_reference_toFunction · 0.85
DistanceFunction · 0.70

Tested by 14

testCoincidentMethod · 0.64
testPointOnObjectMethod · 0.64
testTangentMethod · 0.64
testSymmetricMethod · 0.64
getCoincidentVertexesFunction · 0.64
testCircleToNurbsMethod · 0.64
testEllipseToNurbsMethod · 0.64
testderivativesMethod · 0.64
setUpClassMethod · 0.64
test44Method · 0.64
test02Method · 0.64
check_wireMethod · 0.64