From 50c280fdb69f03c79b35a5202972c2f74028a627 Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 5 Jan 2018 19:35:21 +0100 Subject: [PATCH] fixes #0003141: Unexpected behaviour using pad to face on padded shape binder --- src/Mod/PartDesign/App/FeatureSketchBased.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/Mod/PartDesign/App/FeatureSketchBased.cpp b/src/Mod/PartDesign/App/FeatureSketchBased.cpp index 120c548c92..3e48eb727d 100644 --- a/src/Mod/PartDesign/App/FeatureSketchBased.cpp +++ b/src/Mod/PartDesign/App/FeatureSketchBased.cpp @@ -436,10 +436,28 @@ void ProfileBased::getUpToFace(TopoDS_Face& upToFace, } } + // It must also be checked that all projected inner wires of the upToFace + // lie outside the sketch shape. If this is not the case then the sketch + // shape is not completely covered by the upToFace. See #0003141 + if (!remove_limits) { + TopoDS_Wire outerWire = ShapeAnalysis::OuterWire(upToFace); + for (Ex.Init(upToFace, TopAbs_WIRE); Ex.More(); Ex.Next()) { + if (!outerWire.IsSame(Ex.Current())) { + BRepProj_Projection proj(TopoDS::Wire(Ex.Current()), sketchshape, -dir); + if (proj.More()) { + remove_limits = true; + break; + } + } + } + } + if (remove_limits) { // Note: Using an unlimited face every time gives unnecessary failures for concave faces TopLoc_Location loc = upToFace.Location(); BRepAdaptor_Surface adapt(upToFace, Standard_False); + // use the placement of the adapter, not of the upToFace + loc = TopLoc_Location(adapt.Trsf()); BRepBuilderAPI_MakeFace mkFace(adapt.Surface().Surface() #if OCC_VERSION_HEX >= 0x060502 , Precision::Confusion()