[PD] better solution for reversed pad/pocket handling

- let FeatureExtrude set the right direction
- use the UI as once intended: custom vector values are always taken as they are, so reversing a custom direction will not lead to a negation of the custom vector in the UI. The logic is: "take the vector as it is, and when Reversed is on, negate it additionally"
This commit is contained in:
Uwe
2021-11-23 04:22:37 +01:00
parent 165a09b3ed
commit a09e18b3bb
5 changed files with 26 additions and 29 deletions

View File

@@ -126,6 +126,16 @@ Base::Vector3d FeatureExtrude::computeDirection(const Base::Vector3d& sketchVect
// explicitly set the Direction so that the dialog shows also the used direction
// if the sketch's normal vector was used
Direction.setValue(extrudeDirection);
// for a custom vector we cannot negate it since the Ui takes always the currently
// shown vector values as final direction,
// and when Reversed, it will be negated additionally
if (!UseCustomVector.getValue()) {
if (Reversed.getValue())
Direction.setValue(-extrudeDirection);
else
Direction.setValue(extrudeDirection);
}
// don't return the direction including reversed since this is handled in
// FeatureSketchBased.cpp afterwards
return extrudeDirection;
}