From d51188bd07e32e74af674890b711b68664fe7572 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Sun, 1 Jan 2017 22:41:28 -0800 Subject: [PATCH] Setting a minimum # interpolations for displaying an arc. --- src/Mod/Path/Gui/ViewProviderPath.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Mod/Path/Gui/ViewProviderPath.cpp b/src/Mod/Path/Gui/ViewProviderPath.cpp index e2c4322f8c82..74e1df69061b 100644 --- a/src/Mod/Path/Gui/ViewProviderPath.cpp +++ b/src/Mod/Path/Gui/ViewProviderPath.cpp @@ -52,6 +52,9 @@ #include #include + +#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;