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

Method setAxes

src/Base/CoordinateSystem.cpp:41–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39{}
40
41void CoordinateSystem::setAxes(const Axis& vec, const Vector3d& xd)
42{
43 if (xd.Sqr() < Base::Vector3d::epsilon()) {
44 throw Base::ValueError("Direction is null vector");
45 }
46 Vector3d yd = vec.getDirection() % xd;
47 if (yd.Sqr() < Base::Vector3d::epsilon()) {
48 throw Base::ValueError("Direction is parallel to Z-direction");
49 }
50 ydir = yd;
51 ydir.Normalize();
52 xdir = ydir % vec.getDirection();
53 xdir.Normalize();
54 axis.setBase(vec.getBase());
55 Base::Vector3d zdir = vec.getDirection();
56 zdir.Normalize();
57 axis.setDirection(zdir);
58}
59
60void CoordinateSystem::setAxes(const Vector3d& n, const Vector3d& xd)
61{

Callers 3

activatedMethod · 0.45
TESTFunction · 0.45

Calls 6

NormalizeMethod · 0.80
SqrMethod · 0.45
getDirectionMethod · 0.45
setBaseMethod · 0.45
getBaseMethod · 0.45
setDirectionMethod · 0.45

Tested by

no test coverage detected