diff --git a/src/Mod/Drawing/App/FeatureViewPart.cpp b/src/Mod/Drawing/App/FeatureViewPart.cpp index 1c99ff63d..c1d7527da 100644 --- a/src/Mod/Drawing/App/FeatureViewPart.cpp +++ b/src/Mod/Drawing/App/FeatureViewPart.cpp @@ -84,7 +84,8 @@ FeatureViewPart::FeatureViewPart(void) ADD_PROPERTY_TYPE(Source ,(0),group,App::Prop_None,"Shape to view"); ADD_PROPERTY_TYPE(ShowHiddenLines ,(false),group,App::Prop_None,"Control the appearance of the dashed hidden lines"); ADD_PROPERTY_TYPE(ShowSmoothLines ,(false),group,App::Prop_None,"Control the appearance of the smooth lines"); - ADD_PROPERTY_TYPE(LineWidth,(0.35),vgroup,App::Prop_None,"The thickness of the resulting lines"); + ADD_PROPERTY_TYPE(LineWidth,(0.35),vgroup,App::Prop_None,"The thickness of the viewed lines"); + ADD_PROPERTY_TYPE(HiddenWidth,(0.15),vgroup,App::Prop_None,"The thickness of the hidden lines, if enabled"); ADD_PROPERTY_TYPE(Tolerance,(0.05),vgroup,App::Prop_None,"The tessellation tolerance"); Tolerance.setConstraints(&floatRange); } @@ -202,7 +203,7 @@ App::DocumentObjectExecReturn *FeatureViewPart::execute(void) ProjectionAlgos::ExtractionType type = ProjectionAlgos::Plain; if (hidden) type = (ProjectionAlgos::ExtractionType)(type|ProjectionAlgos::WithHidden); if (smooth) type = (ProjectionAlgos::ExtractionType)(type|ProjectionAlgos::WithSmooth); - result << Alg.getSVG(type, this->LineWidth.getValue() / this->Scale.getValue(), this->Tolerance.getValue()); + result << Alg.getSVG(type, this->LineWidth.getValue() / this->Scale.getValue(), this->Tolerance.getValue(), this->HiddenWidth.getValue() / this->Scale.getValue()); result << "" << endl; diff --git a/src/Mod/Drawing/App/FeatureViewPart.h b/src/Mod/Drawing/App/FeatureViewPart.h index 6a47fbcb4..9238f6bcb 100644 --- a/src/Mod/Drawing/App/FeatureViewPart.h +++ b/src/Mod/Drawing/App/FeatureViewPart.h @@ -53,6 +53,7 @@ public: App::PropertyBool ShowHiddenLines; App::PropertyBool ShowSmoothLines; App::PropertyFloat LineWidth; + App::PropertyFloat HiddenWidth; App::PropertyFloatConstraint Tolerance; diff --git a/src/Mod/Drawing/App/ProjectionAlgos.cpp b/src/Mod/Drawing/App/ProjectionAlgos.cpp index 92ba3283a..3d4822099 100644 --- a/src/Mod/Drawing/App/ProjectionAlgos.cpp +++ b/src/Mod/Drawing/App/ProjectionAlgos.cpp @@ -146,14 +146,13 @@ void ProjectionAlgos::execute(void) } -std::string ProjectionAlgos::getSVG(ExtractionType type, double scale, double tolerance) +std::string ProjectionAlgos::getSVG(ExtractionType type, double scale, double tolerance, double hiddenscale) { std::stringstream result; SVGOutput output; - float hfactor = 0.5f; // hidden line size factor, was 0.15f / 0.35f; if (!H.IsNull() && (type & WithHidden)) { - double width = hfactor * scale; + double width = hiddenscale; BRepMesh::Mesh(H,tolerance); result << "" << endl; } if (!HO.IsNull() && (type & WithHidden)) { - double width = hfactor * scale; + double width = hiddenscale; BRepMesh::Mesh(HO,tolerance); result << "" << endl; } if (!H1.IsNull() && (type & WithSmooth) && (type & WithHidden)) { - double width = hfactor * scale; + double width = hiddenscale; BRepMesh::Mesh(H1,tolerance); result << "" << endl; } - /*result << "0" << endl - << "SECTION" << endl - << "2" << endl - << "ENTITIES" << endl;*/ return result.str(); } diff --git a/src/Mod/Drawing/App/ProjectionAlgos.h b/src/Mod/Drawing/App/ProjectionAlgos.h index 34f9be2f0..8f040dc85 100644 --- a/src/Mod/Drawing/App/ProjectionAlgos.h +++ b/src/Mod/Drawing/App/ProjectionAlgos.h @@ -51,7 +51,7 @@ public: WithSmooth = 2 }; - std::string getSVG(ExtractionType type, double scale, double tolerance); + std::string getSVG(ExtractionType type, double scale=0.35, double tolerance=0.05, double hiddenscale=0.15); std::string getDXF(ExtractionType type, double scale, double tolerance);//added by Dan Falck 2011/09/25