From 00a124cea11c7305e5d098ecd44b05842bef2b65 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 16 May 2015 14:19:20 +0200 Subject: [PATCH] + Pad type UpToFirst and UpToFace doesn't produce expected results. --- src/Mod/PartDesign/App/FeaturePad.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/Mod/PartDesign/App/FeaturePad.cpp b/src/Mod/PartDesign/App/FeaturePad.cpp index 47efde145..ca291fd2c 100644 --- a/src/Mod/PartDesign/App/FeaturePad.cpp +++ b/src/Mod/PartDesign/App/FeaturePad.cpp @@ -33,6 +33,7 @@ # include # include # include +# include # include # include # include @@ -144,15 +145,22 @@ App::DocumentObjectExecReturn *Pad::execute(void) // because the feature does not add any material. This only happens with the "2" option, though // Note: It might be possible to pass a shell or a compound containing multiple faces // as the Until parameter of Perform() - // Note: Multiple independent wires are not supported, we should check for that and - // warn the user - BRepFeat_MakePrism PrismMaker; - PrismMaker.Init(support, sketchshape, supportface, dir, 2, 1); - PrismMaker.Perform(upToFace); + // Note: Multiple independent wires are not supported, that's why we have to iterate over them. + TopoDS_Compound comp; + BRep_Builder builder; + builder.MakeCompound(comp); - if (!PrismMaker.IsDone()) - return new App::DocumentObjectExecReturn("Pad: Up to face: Could not extrude the sketch!"); - prism = PrismMaker.Shape(); + for (TopExp_Explorer xp(sketchshape, TopAbs_FACE); xp.More(); xp.Next()) { + BRepFeat_MakePrism PrismMaker; + PrismMaker.Init(support, xp.Current(), supportface, dir, 2, 1); + PrismMaker.Perform(upToFace); + + if (!PrismMaker.IsDone()) + return new App::DocumentObjectExecReturn("Pad: Up to face: Could not extrude the sketch!"); + builder.Add(comp, PrismMaker.Shape()); + } + + prism = comp; } else { generatePrism(prism, sketchshape, method, dir, L, L2, Midplane.getValue(), Reversed.getValue());