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

Function setDirectionTuple

src/python/PyImath/PyImathLine.cpp:225–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223
224template <class T>
225static void
226setDirectionTuple(Line3<T> &line, const tuple &t)
227{
228 MATH_EXC_ON;
229 Vec3<T> dir;
230 if(t.attr("__len__")() == 3)
231 {
232 dir.x = extract<T>(t[0]);
233 dir.y = extract<T>(t[1]);
234 dir.z = extract<T>(t[2]);
235
236 line.dir = dir.normalized();
237 }
238 else
239 throw std::invalid_argument ( "Line3 expects tuple of length 3");
240}
241
242template <class T>
243static void

Callers

nothing calls this directly

Calls 1

normalizedMethod · 0.80

Tested by

no test coverage detected