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

Method setXDirection

src/Base/CoordinateSystem.cpp:83–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83void CoordinateSystem::setXDirection(const Vector3d& dir)
84{
85 Vector3d yd = axis.getDirection() % dir;
86 if (yd.Sqr() < Base::Vector3d::epsilon()) {
87 throw Base::ValueError("Direction is parallel to Z-direction");
88 }
89 ydir = yd;
90 ydir.Normalize();
91 xdir = ydir % axis.getDirection();
92 xdir.Normalize();
93}
94
95void CoordinateSystem::setYDirection(const Vector3d& dir)
96{

Callers 1

TESTFunction · 0.45

Calls 3

NormalizeMethod · 0.80
getDirectionMethod · 0.45
SqrMethod · 0.45

Tested by

no test coverage detected