PartDesign: [skip ci] for PartDesign::Torus primitive use TopoShape::makeTorus

This commit is contained in:
wmayer
2020-12-03 15:06:22 +01:00
parent d90b2d0acf
commit eac5b9466f

View File

@@ -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());
}