[PD] Fix Pad uptoface with custom direction (#16539)

* [PD] Fix Pad uptoface with custom direction

* Add unit test
This commit is contained in:
Florian Foinant-Willig
2024-09-24 18:30:01 +02:00
committed by GitHub
parent 0ff7c3a38f
commit 490d6c5abc
4 changed files with 52 additions and 38 deletions

View File

@@ -625,7 +625,7 @@ App::DocumentObjectExecReturn* FeatureExtrude::buildExtrusion(ExtrudeOptions opt
}
if (faceCount == 1) {
getUpToFace(upToShape, base, supportface, sketchshape, method, dir);
getUpToFace(upToShape, base, sketchshape, method, dir);
addOffsetToFace(upToShape, dir, Offset.getValue());
}
else{

View File

@@ -848,7 +848,6 @@ void ProfileBased::getUpToFace(TopoDS_Face& upToFace,
void ProfileBased::getUpToFace(TopoShape& upToFace,
const TopoShape& support,
const TopoShape& supportface,
const TopoShape& sketchshape,
const std::string& method,
gp_Dir& dir)
@@ -887,13 +886,11 @@ void ProfileBased::getUpToFace(TopoShape& upToFace,
TopoDS_Face face = TopoDS::Face(upToFace.getShape());
// Check that the upToFace does not intersect the sketch face and
// is not parallel to the extrusion direction (for simplicity, supportface is used instead of
// sketchshape)
BRepAdaptor_Surface adapt1(TopoDS::Face(supportface.getShape()));
BRepAdaptor_Surface adapt2(face);
// is not parallel to the extrusion direction
BRepAdaptor_Surface adapt(face);
if (adapt2.GetType() == GeomAbs_Plane) {
if (adapt1.Plane().Axis().IsNormal(adapt2.Plane().Axis(), Precision::Confusion())) {
if (adapt.GetType() == GeomAbs_Plane) {
if (dir.IsNormal(adapt.Plane().Axis().Direction(), Precision::Confusion())) {
throw Base::ValueError(
"SketchBased: Up to face: Must not be parallel to extrusion direction!");
}

View File

@@ -173,7 +173,6 @@ protected:
/// Find a valid face to extrude up to
static void getUpToFace(TopoShape& upToFace,
const TopoShape& support,
const TopoShape& supportface,
const TopoShape& sketchshape,
const std::string& method,
gp_Dir& dir);