Skip to content

Commit

Permalink
Merge pull request #410 from mlampert/issue-2825
Browse files Browse the repository at this point in the history
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 40ad0b7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Mod/Path/Gui/ViewProviderPath.cpp
Expand Up @@ -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 */
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 40ad0b7

Please sign in to comment.