Skip to content
Permalink
Browse files

Merge pull request #410 from mlampert/issue-2825

Path: Setting a minimum # interpolations for displaying an arc - fixes issue 2825
  • Loading branch information...
wwmayer committed Jan 2, 2017
2 parents ab4fe61 + d51188b commit 40ad0b743aabad9e415b921bac9312e34735e0a8
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/Mod/Path/Gui/ViewProviderPath.cpp
@@ -52,6 +52,9 @@
#include <Gui/BitmapFactory.h>
#include <Gui/SoFCBoundingBox.h>


#define ARC_MIN_SEGMENTS 20.0 // minimum # segements to interpolate an arc

#ifndef M_PI
#define M_PI 3.14159265358979323846
#define M_PI 3.14159265358979323846 /* pi */
@@ -306,8 +309,9 @@ void ViewProviderPath::updateData(const App::Property* prop)
angle = M_PI * 2 - angle;
if (angle == 0)
angle = M_PI * 2;
int segments = 3/(deviation/angle); //we use a rather simple rule here, provisorily
int segments = std::max(ARC_MIN_SEGMENTS, 3.0/(deviation/angle)); //we use a rather simple rule here, provisorily
double dZ = (next.z - last.z)/segments; //How far each segment will helix in Z

for (int j = 1; j < segments; j++) {
//std::cout << "vector " << j << std::endl;
Base::Vector3d inter;

0 comments on commit 40ad0b7

Please sign in to comment.
You can’t perform that action at this time.