PartDesign: fix the range of the custom clearance of threads (#26296)

* PartDesign: fix the range of the custom clearance of threads

* PartDesign: hole ensure diameter is on the correct range
This commit is contained in:
Alfredo Monclus
2026-03-16 14:02:31 -03:00
committed by GitHub
parent 9abe7b4af1
commit c8efc26982
2 changed files with 13 additions and 0 deletions
+10
View File
@@ -544,6 +544,10 @@ const App::PropertyAngle::Constraints Hole::floatAngle = {
const App::PropertyQuantityConstraint::Constraints diameterRange
= {10 * Precision::Confusion(), std::numeric_limits<float>::max(), 1.0};
// Custom clearance can be negative or positive to adjust for manufacturing
const App::PropertyQuantityConstraint::Constraints clearanceRange
= {std::numeric_limits<float>::lowest(), std::numeric_limits<float>::max(), 0.1};
Hole::Hole()
{
addSubType = FeatureAddSub::Subtractive;
@@ -636,6 +640,7 @@ Hole::Hole()
App::Prop_None,
"Custom thread clearance (overrides ThreadClass)"
);
CustomThreadClearance.setConstraints(&clearanceRange);
// Defaults to circles & arcs so that older files are kept intact
// while new file get points, circles and arcs set in setupObject()
@@ -1729,6 +1734,11 @@ App::DocumentObjectExecReturn* Hole::execute()
}
try {
if (Diameter.getValue() < diameterRange.LowerBound) {
return new App::DocumentObjectExecReturn(
QT_TRANSLATE_NOOP("Exception", "Hole error: Diameter too small")
);
}
std::string method(DepthType.getValueAsString());
double length = 0.0;
@@ -273,6 +273,9 @@ TaskHoleParameters::TaskHoleParameters(ViewProviderHole* HoleView, QWidget* pare
this->groupLayout()->addWidget(proxy);
setupGizmos(HoleView);
ui->CustomThreadClearance->setMinimum(pcHole->CustomThreadClearance.getMinimum());
ui->CustomThreadClearance->setMaximum(pcHole->CustomThreadClearance.getMaximum());
}
TaskHoleParameters::~TaskHoleParameters() = default;