From faa4db15cd1fec17483850191538b25fa4599a16 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 16 Oct 2024 13:42:28 +0200 Subject: [PATCH] Part/PD: Fix cone creation if both radii are equal The cone features in Part and PartDesign automatically create a cylinder if top and bottom radius are identical. However, the algorithm ignores the angle and always creates a full cylinder. --- src/Mod/Part/App/PrimitiveFeature.cpp | 4 ++-- src/Mod/PartDesign/App/FeaturePrimitive.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Mod/Part/App/PrimitiveFeature.cpp b/src/Mod/Part/App/PrimitiveFeature.cpp index 15c04121c8..e2aa490c38 100644 --- a/src/Mod/Part/App/PrimitiveFeature.cpp +++ b/src/Mod/Part/App/PrimitiveFeature.cpp @@ -665,14 +665,14 @@ App::DocumentObjectExecReturn *Cone::execute() //Build a cylinder BRepPrimAPI_MakeCylinder mkCylr(Radius1.getValue(), Height.getValue(), - 2.0 * M_PI); + Base::toRadians(Angle.getValue())); ResultShape = mkCylr.Shape(); } else { // Build a cone BRepPrimAPI_MakeCone mkCone(Radius1.getValue(), Radius2.getValue(), Height.getValue(), - angle/180.0f*M_PI); + Base::toRadians(angle)); ResultShape = mkCone.Shape(); } this->Shape.setValue(ResultShape); diff --git a/src/Mod/PartDesign/App/FeaturePrimitive.cpp b/src/Mod/PartDesign/App/FeaturePrimitive.cpp index 1fa613eecd..44c1eb1b7f 100644 --- a/src/Mod/PartDesign/App/FeaturePrimitive.cpp +++ b/src/Mod/PartDesign/App/FeaturePrimitive.cpp @@ -360,7 +360,7 @@ App::DocumentObjectExecReturn* Cone::execute() //Build a cylinder BRepPrimAPI_MakeCylinder mkCylr(Radius1.getValue(), Height.getValue(), - 2.0 * M_PI); + Base::toRadians(Angle.getValue())); return FeaturePrimitive::execute(mkCylr.Shape()); } // Build a cone