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.
This commit is contained in:
wmayer
2024-10-16 13:42:28 +02:00
committed by Yorik van Havre
parent f2d4d59d6c
commit faa4db15cd
2 changed files with 3 additions and 3 deletions

View File

@@ -665,14 +665,14 @@ App::DocumentObjectExecReturn *Cone::execute()
//Build a cylinder
BRepPrimAPI_MakeCylinder mkCylr(Radius1.getValue(),
Height.getValue(),
2.0 * M_PI);
Base::toRadians<double>(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<double>(angle));
ResultShape = mkCone.Shape();
}
this->Shape.setValue(ResultShape);

View File

@@ -360,7 +360,7 @@ App::DocumentObjectExecReturn* Cone::execute()
//Build a cylinder
BRepPrimAPI_MakeCylinder mkCylr(Radius1.getValue(),
Height.getValue(),
2.0 * M_PI);
Base::toRadians<double>(Angle.getValue()));
return FeaturePrimitive::execute(mkCylr.Shape());
}
// Build a cone