MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/Imath / closestVertexTuple

Function closestVertexTuple

src/python/PyImath/PyImathLine.cpp:280–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

278
279template <class T>
280static Vec3<T>
281closestVertexTuple(Line3<T> &line, const tuple &t0, const tuple &t1, const tuple &t2)
282{
283 MATH_EXC_ON;
284 if(t0.attr("__len__")() == 3 && t1.attr("__len__")() == 3 && t2.attr("__len__")() == 3)
285 {
286 Vec3<T> v0, v1, v2;
287 v0.x = extract<T>(t0[0]);
288 v0.y = extract<T>(t0[1]);
289 v0.z = extract<T>(t0[2]);
290
291 v1.x = extract<T>(t1[0]);
292 v1.y = extract<T>(t1[1]);
293 v1.z = extract<T>(t1[2]);
294
295 v2.x = extract<T>(t2[0]);
296 v2.y = extract<T>(t2[1]);
297 v2.z = extract<T>(t2[2]);
298
299 return IMATH_NAMESPACE::closestVertex(v0, v1, v2, line);
300 }
301 else
302 throw std::invalid_argument ( "Line3 expects tuple of length 3");
303}
304
305template <class T>
306static bool

Callers

nothing calls this directly

Calls 1

closestVertexFunction · 0.70

Tested by

no test coverage detected