From eac5b9466f4ec9106dffaec19327e94d673d77f6 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 3 Dec 2020 15:06:22 +0100 Subject: [PATCH] PartDesign: [skip ci] for PartDesign::Torus primitive use TopoShape::makeTorus --- src/Mod/PartDesign/App/FeaturePrimitive.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Mod/PartDesign/App/FeaturePrimitive.cpp b/src/Mod/PartDesign/App/FeaturePrimitive.cpp index b2a57c627f..f8f79bfea2 100644 --- a/src/Mod/PartDesign/App/FeaturePrimitive.cpp +++ b/src/Mod/PartDesign/App/FeaturePrimitive.cpp @@ -502,16 +502,24 @@ App::DocumentObjectExecReturn* Torus::execute(void) if (Radius2.getValue() < Precision::Confusion()) return new App::DocumentObjectExecReturn("Radius of torus too small"); try { - + // https://forum.freecadweb.org/viewtopic.php?f=3&t=52719 +#if 0 BRepPrimAPI_MakeTorus mkTorus(Radius1.getValue(), Radius2.getValue(), Angle1.getValue()/180.0f*M_PI, Angle2.getValue()/180.0f*M_PI, Angle3.getValue()/180.0f*M_PI); return FeaturePrimitive::execute(mkTorus.Solid()); +#else + Part::TopoShape shape; + return FeaturePrimitive::execute(shape.makeTorus(Radius1.getValue(), + Radius2.getValue(), + Angle1.getValue(), + Angle2.getValue(), + Angle3.getValue())); +#endif } catch (Standard_Failure& e) { - return new App::DocumentObjectExecReturn(e.GetMessageString()); }