PD: fixes #0004567: Pattern from a feature type UpToFace and Offset > copy whole body
This commit is contained in:
@@ -274,8 +274,8 @@ App::DocumentObjectExecReturn *Pad::execute(void)
|
||||
return new App::DocumentObjectExecReturn("Pad: Up to face: Could not extrude the sketch!");
|
||||
prism = PrismMaker.Shape();
|
||||
#else
|
||||
Standard_Integer fuse = fabs(Offset.getValue()) > Precision::Confusion() ? 1 : 2;
|
||||
generatePrism(prism, method, base, sketchshape, supportface, upToFace, dir, fuse, Standard_True);
|
||||
PrismMode mode = PrismMode::None;
|
||||
generatePrism(prism, method, base, sketchshape, supportface, upToFace, dir, mode, Standard_True);
|
||||
#endif
|
||||
base.Nullify();
|
||||
} else {
|
||||
@@ -300,8 +300,8 @@ App::DocumentObjectExecReturn *Pad::execute(void)
|
||||
return new App::DocumentObjectExecReturn("Pad: Up to face: Could not extrude the sketch!");
|
||||
prism = PrismMaker.Shape();
|
||||
#else
|
||||
Standard_Integer fuse = fabs(Offset.getValue()) > Precision::Confusion() ? 1 : 2;
|
||||
generatePrism(prism, method, base, sketchshape, supportface, upToFace, dir, fuse, Standard_True);
|
||||
PrismMode mode = PrismMode::None;
|
||||
generatePrism(prism, method, base, sketchshape, supportface, upToFace, dir, mode, Standard_True);
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -189,7 +189,8 @@ App::DocumentObjectExecReturn *Pocket::execute(void)
|
||||
TopoDS_Shape prism = PrismMaker.Shape();
|
||||
#else
|
||||
TopoDS_Shape prism;
|
||||
generatePrism(prism, method, base, profileshape, supportface, upToFace, dir, 0, Standard_True);
|
||||
PrismMode mode = PrismMode::CutFromBase;
|
||||
generatePrism(prism, method, base, profileshape, supportface, upToFace, dir, mode, Standard_True);
|
||||
#endif
|
||||
|
||||
// And the really expensive way to get the SubShape...
|
||||
|
||||
@@ -540,6 +540,12 @@ void ProfileBased::addOffsetToFace(TopoDS_Face& upToFace, const gp_Dir& dir, dou
|
||||
mov.SetTranslation(offset * gp_Vec(dir));
|
||||
TopLoc_Location loc(mov);
|
||||
upToFace.Move(loc);
|
||||
|
||||
// When using the face with BRepFeat_MakePrism::Perform(const TopoDS_Shape& Until)
|
||||
// then the algorithm expects that the 'NaturalRestriction' flag is set in order
|
||||
// to work as expected (see generatePrism())
|
||||
BRep_Builder builder;
|
||||
builder.NaturalRestriction(upToFace, Standard_True);
|
||||
} else {
|
||||
throw Base::TypeError("SketchBased: Up to Face: Offset not supported yet for non-planar faces");
|
||||
}
|
||||
@@ -617,7 +623,7 @@ void ProfileBased::generatePrism(TopoDS_Shape& prism,
|
||||
const TopoDS_Face& supportface,
|
||||
const TopoDS_Face& uptoface,
|
||||
const gp_Dir& direction,
|
||||
Standard_Integer Mode,
|
||||
PrismMode Mode,
|
||||
Standard_Boolean Modify)
|
||||
{
|
||||
if (method == "UpToFirst" || method == "UpToFace" || method == "UpToLast") {
|
||||
@@ -630,8 +636,8 @@ void ProfileBased::generatePrism(TopoDS_Shape& prism,
|
||||
throw Base::RuntimeError("ProfileBased: Up to face: Could not extrude the sketch!");
|
||||
|
||||
base = PrismMaker.Shape();
|
||||
if (Mode == 2)
|
||||
Mode = 1;
|
||||
if (Mode == PrismMode::None)
|
||||
Mode = PrismMode::FuseWithBase;
|
||||
}
|
||||
|
||||
prism = base;
|
||||
|
||||
@@ -148,6 +148,12 @@ protected:
|
||||
const double L2,
|
||||
const bool midplane,
|
||||
const bool reversed);
|
||||
// See BRepFeat_MakePrism
|
||||
enum PrismMode {
|
||||
CutFromBase = 0,
|
||||
FuseWithBase = 1,
|
||||
None = 2
|
||||
};
|
||||
/**
|
||||
* Generate a linear prism
|
||||
* It will be a stand-alone solid created with BRepFeat_MakePrism
|
||||
@@ -159,7 +165,7 @@ protected:
|
||||
const TopoDS_Face& sketchface,
|
||||
const TopoDS_Face& uptoface,
|
||||
const gp_Dir& direction,
|
||||
Standard_Integer Mode,
|
||||
PrismMode Mode,
|
||||
Standard_Boolean Modify);
|
||||
|
||||
/// Check whether the wire after projection on the face is inside the face
|
||||
|
||||
Reference in New Issue
Block a user