diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-05-25 11:16:00 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-05-25 14:47:49 +0400 |
commit | 08528f577dcb47f570413ce600137f3729a35d94 (patch) | |
tree | 6a3a3b792795383fb9180ec7c730eca2b050bbbf /source/blender/freestyle/intern/view_map | |
parent | aef443ab2d27a79160cca0588bc221457572cead (diff) |
Freestyle: Partial fix for thinning strokes due to flipping stroke directions at TVertices.
A description of the problem is found in https://developer.blender.org/T36425#19 .
The cause of the issue was identified as roudning errors in Operators::createStroke() due
to insufficient numerical precision. Precision promotion from float to double was done in
the return values of getPoint3D/2D methods in Interface0D and its subclasses in C++
(data members stored in the 0D classes have already been in double precision).
Diffstat (limited to 'source/blender/freestyle/intern/view_map')
4 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/freestyle/intern/view_map/Interface0D.cpp b/source/blender/freestyle/intern/view_map/Interface0D.cpp index 135a935d2fe..1d8515700d3 100644 --- a/source/blender/freestyle/intern/view_map/Interface0D.cpp +++ b/source/blender/freestyle/intern/view_map/Interface0D.cpp @@ -48,7 +48,7 @@ real Interface0D::getZ() const return 0; } -Geometry::Vec3f Interface0D::getPoint3D() const +Geometry::Vec3r Interface0D::getPoint3D() const { PyErr_SetString(PyExc_TypeError, "method getPoint3D() not properly overridden"); return 0; @@ -72,7 +72,7 @@ real Interface0D::getProjectedZ() const return 0; } -Geometry::Vec2f Interface0D::getPoint2D() const +Geometry::Vec2r Interface0D::getPoint2D() const { PyErr_SetString(PyExc_TypeError, "method getPoint2D() not properly overridden"); return 0; diff --git a/source/blender/freestyle/intern/view_map/Interface0D.h b/source/blender/freestyle/intern/view_map/Interface0D.h index e59ed4c96c8..123253bf3e1 100644 --- a/source/blender/freestyle/intern/view_map/Interface0D.h +++ b/source/blender/freestyle/intern/view_map/Interface0D.h @@ -86,7 +86,7 @@ public: virtual real getZ() const; /*! Returns the 3D point. */ - virtual Geometry::Vec3f getPoint3D() const; + virtual Geometry::Vec3r getPoint3D() const; /*! Returns the 2D x coordinate of the point. */ virtual real getProjectedX() const; @@ -98,7 +98,7 @@ public: virtual real getProjectedZ() const; /*! Returns the 2D point. */ - virtual Geometry::Vec2f getPoint2D() const; + virtual Geometry::Vec2r getPoint2D() const; /*! Returns the FEdge that lies between this Interface0D and the Interface0D given as argument. */ virtual FEdge *getFEdge(Interface0D&); diff --git a/source/blender/freestyle/intern/view_map/Silhouette.h b/source/blender/freestyle/intern/view_map/Silhouette.h index e747f9c3e68..2d0acde3f2b 100644 --- a/source/blender/freestyle/intern/view_map/Silhouette.h +++ b/source/blender/freestyle/intern/view_map/Silhouette.h @@ -103,7 +103,7 @@ public: // Implementation of Interface0D } /*! Returns the 3D point. */ - virtual Vec3f getPoint3D() const + virtual Vec3r getPoint3D() const { return _Point3D; } @@ -127,9 +127,9 @@ public: // Implementation of Interface0D } /*! Returns the 2D point. */ - virtual Vec2f getPoint2D() const + virtual Vec2r getPoint2D() const { - return Vec2f((float)_Point2D.x(), (float)_Point2D.y()); + return Vec2f(_Point2D.x(), _Point2D.y()); } /*! Returns the FEdge that lies between this Svertex and the Interface0D given as argument. */ diff --git a/source/blender/freestyle/intern/view_map/ViewMap.h b/source/blender/freestyle/intern/view_map/ViewMap.h index eeaeada5dc6..d87341503fa 100644 --- a/source/blender/freestyle/intern/view_map/ViewMap.h +++ b/source/blender/freestyle/intern/view_map/ViewMap.h @@ -419,7 +419,7 @@ public: // Implementation of Interface0D } /*! Returns the 3D point. */ - virtual Vec3f getPoint3D() const + virtual Vec3r getPoint3D() const { cerr << "Warning: getPoint3D() undefined for this point" << endl; return _FrontSVertex->getPoint3D(); @@ -443,7 +443,7 @@ public: // Implementation of Interface0D } /*! Returns the 2D point. */ - virtual Vec2f getPoint2D() const + virtual Vec2r getPoint2D() const { return _FrontSVertex->getPoint2D(); } @@ -692,7 +692,7 @@ public: // Implementation of Interface0D } /*! Returns the 3D point. */ - virtual Vec3f getPoint3D() const + virtual Vec3r getPoint3D() const { return _SVertex->getPoint3D(); } @@ -716,7 +716,7 @@ public: // Implementation of Interface0D } /*! Returns the 2D point. */ - virtual Vec2f getPoint2D() const + virtual Vec2r getPoint2D() const { return _SVertex->getPoint2D(); } |