Skip to content

Commit

Permalink
Merge branch 'PartFaceMakers3_fixup2' of https://github.com/DeepSOIC/…
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Oct 4, 2016
2 parents ebc1d92 + d21f339 commit 024fe26
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/Mod/Part/App/FeatureExtrusion.cpp
Expand Up @@ -296,10 +296,11 @@ TopoShape Extrusion::extrudeShape(const TopoShape source, Extrusion::ExtrusionPa

//make faces from wires
if (params.solid) {
if (myShape.ShapeType() == TopAbs_FACE && params.faceMakerClass == "Part::FaceMakerExtrusion"){
//legacy exclusion: ignore "solid" if extruding a face.
//test if we need to make faces from wires. If there are faces - we don't.
TopExp_Explorer xp(myShape, TopAbs_FACE);
if (xp.More()){
//source shape has faces. Just extrude as-is.
} else {
//new strict behavior. If solid==True => make faces from wires, and if myShape not wires - fail!
std::unique_ptr<FaceMaker> mkFace = FaceMaker::ConstructFromType(params.faceMakerClass.c_str());

if (myShape.ShapeType() == TopAbs_COMPOUND)
Expand Down
12 changes: 11 additions & 1 deletion src/Mod/Part/App/FeatureRevolution.cpp
Expand Up @@ -28,6 +28,7 @@
# include <BRepAdaptor_Curve.hxx>
# include <gp_Lin.hxx>
# include <gp_Circ.hxx>
# include <TopExp_Explorer.hxx>
#endif


Expand Down Expand Up @@ -166,8 +167,15 @@ App::DocumentObjectExecReturn *Revolution::execute(void)
sourceShape.setShape(sourceShape.getShape().Moved(loc));
}

//do it!
//"make solid" processing: make faces from wires.
Standard_Boolean makeSolid = Solid.getValue() ? Standard_True : Standard_False;
if (makeSolid){
//test if we need to make faces from wires. If there are faces - we don't.
TopExp_Explorer xp(sourceShape.getShape(), TopAbs_FACE);
if (xp.More())
//source shape has faces. Just revolve as-is.
makeSolid = Standard_False;
}
if (makeSolid && strlen(this->FaceMakerClass.getValue())>0){
//new facemaking behavior: use facemaker class
std::unique_ptr<FaceMaker> mkFace = FaceMaker::ConstructFromType(this->FaceMakerClass.getValue());
Expand All @@ -183,6 +191,8 @@ App::DocumentObjectExecReturn *Revolution::execute(void)

makeSolid = Standard_False;//don't ask TopoShape::revolve to make solid, as we've made faces...
}

// actual revolution!
TopoDS_Shape revolve = sourceShape.revolve(revAx, angle, makeSolid);

if (revolve.IsNull())
Expand Down

0 comments on commit 024fe26

Please sign in to comment.