Commit Graph

20 Commits

Author SHA1 Message Date
wmayer
52916175ed start to replace old C-style casts with static_cast or reinterpret_cast, avoid implicit casts 2019-09-16 17:59:18 +02:00
wmayer
3726006942 fix implementation of Rotation::isSame(const Rotation& q, double tol) and extend Python bindings 2019-09-10 14:17:07 +02:00
Zheng, Lei
2d9ca92594 Base: misc patches
Convenience macros/function (in Interpreter.h)

* FC_PY_GetObject/Callable(), look for callables in a python object,
  which will be used in future patch to improve performance in various
  python observer/features.

* pyCall(WithKeywords)(), helper function to invoke the callable

Matrix4D:

* hasScale(), check if there is any scale in the transformation. If so,
  further check if the scale is uniform or not. This will be used in
  future patch for Part::TopoShape to decide which type of transform to
  apply.

Placement:

* translate/rotate(), new convenience API

Rotation:

* isSame/multiVec(), new convenience API

Polygon2d:

* Intersect(), GetCenter(), new convenience API.

FlagToggler:

* New class for exception safe flag toggling, similar to StateLocker
  but with template (actually, FlagToggler is added earlier by me).

BitsetLocker:

* New class for exception manipulation of a std::bitset variable.
2019-08-17 14:52:08 +02:00
wmayer
d1b47718cf handle gimbal lock when converting between quaternion and Euler angles (issue #0004062) 2019-07-22 16:31:42 +02:00
wmayer
6b37fdc1a8 PVS issues:
consistently define copy constructor and assignment operator
remove superfluous casts
initialize member variables in constructor
avoid double assignment
2019-03-04 11:53:49 +01:00
luz.paz
436444b424 Misc. typos 2018-01-27 19:43:18 +01:00
wmayer
b9975a5e14 fix OpenSCAD importer 2018-01-01 16:45:06 +01:00
wmayer
7991e1ae7e fix invalid syntax 2017-12-13 17:24:39 +01:00
wmayer
df0a3ded78 rename Placement.isNull to Placement.isIdentity
implement Rotation.isNull and Rotation.isIdentity
2017-12-13 17:00:38 +01:00
wmayer
ab908bf22d preserve length of rotation axis 2017-12-13 17:00:38 +01:00
wmayer
3692861136 improve whitespaces 2017-12-13 17:00:38 +01:00
plgarcia
a0ea3ceec9 Improvement of rotations
Rotation:
-	Add a private attribute Vector to store the direction of the rotation, and manage not to erase this direction when the angle id 0.
-	Add a private attribute to store the angle as defined (no modulo etc)
-	Keep the quaternion for calculations

PropertyGeo
-	Saves the rotation with angle and direction instead of saving the quaternion.
-	Attribute name chosen: Ox, Oy and Oz for the coordinates of the axis and A for the angle in radians. This has to be validated.
-	Backward compatibility with the saved files with quaternion (test presence of A to determine which of  the Quaternion (old way) or the direction and angle is stored (new way). New files can be opened by old FreeCAD and vice-versa.

The only side effect I can imagine is that it was possible to set a vector to 0, 0, 0 if the angle was not 0, what is somehow non sense. Now when setting to 0, 0 0 the last not null vector is kept. The vector can not be null any longer.
2017-12-13 17:00:38 +01:00
DeepSOIC
62b0d35270 Base: new Rotation constructor - on vectors
The new constructor accepts wanted directions of x,y,z axes of rotated
frame, and a priority string that affects how the vectors are made
perpendicular to each other.

Example - construct placement for sketch on XZ plane:

v = App.Vector
App.Rotation(v(1,0,0),v(0,0,1),v())
2017-09-10 18:31:40 +02:00
wmayer
4d77921111 use a stricter tolerance to check for equal points
add method IsEqual to Vector3 class to support user-defined tolerance
2016-08-15 14:09:26 +02:00
wmayer
f3226a0867 + fix == operator of Rotation class, + add method isSame() 2016-05-18 18:08:40 +02:00
wmayer
859d76faf8 + fixes #0002075: Analysis of FreeCAD by PVS-Studio static analyzer 2015-05-01 16:56:31 +02:00
wmayer
9d70e9c0ce + issue #0002007: Base::Rotation::get/setYawPitchRoll uses wrong euler convention 2015-03-15 18:53:03 +01:00
wmayer
0b0a57a4eb + Replace floats with doubles 2014-02-26 16:27:28 +01:00
wmayer
5a94eed5c0 + fix bug in Rotation::normalize()
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5155 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-11-22 12:51:50 +00:00
wmayer
120ca87015 + unify DLL export defines to namespace names
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5000 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-10-10 13:44:52 +00:00