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
(cherry picked from commit c8efc26982)
This commit is contained in:
committed by
github-actions[bot]
parent
35ef0a3fd3
commit
706dc3a66a
@@ -542,6 +542,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;
|
||||
@@ -634,6 +638,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()
|
||||
@@ -1727,6 +1732,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;
|
||||
|
||||
|
||||
@@ -271,6 +271,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;
|
||||
|
||||
Reference in New Issue
Block a user