diff --git a/src/Mod/Part/App/FeatureRevolution.cpp b/src/Mod/Part/App/FeatureRevolution.cpp
index 16024f3ad..1e4a096f7 100644
--- a/src/Mod/Part/App/FeatureRevolution.cpp
+++ b/src/Mod/Part/App/FeatureRevolution.cpp
@@ -35,6 +35,7 @@
#include
#include
#include
+#include "FaceMaker.h"
using namespace Part;
@@ -52,6 +53,7 @@ Revolution::Revolution()
Angle.setConstraints(&angleRangeU);
ADD_PROPERTY_TYPE(Symmetric,(false),"Revolve",App::Prop_None,"Extend revolution symmetrically from the profile.");
ADD_PROPERTY_TYPE(Solid,(false),"Revolve",App::Prop_None,"Make revolution a solid if possible");
+ ADD_PROPERTY_TYPE(FaceMakerClass,(""),"Revolve",App::Prop_None,"Facemaker to use if Solid is true."); //default for old documents. For default for new objects, refer to setupObject().
}
short Revolution::mustExecute() const
@@ -62,7 +64,8 @@ short Revolution::mustExecute() const
Source.isTouched() ||
Solid.isTouched() ||
AxisLink.isTouched() ||
- Symmetric.isTouched())
+ Symmetric.isTouched() ||
+ FaceMakerClass.isTouched())
return 1;
return 0;
}
@@ -165,6 +168,21 @@ App::DocumentObjectExecReturn *Revolution::execute(void)
//do it!
Standard_Boolean makeSolid = Solid.getValue() ? Standard_True : Standard_False;
+ if (makeSolid && strlen(this->FaceMakerClass.getValue())>0){
+ //new facemaking behavior: use facemaker class
+ std::unique_ptr fm_instance = FaceMaker::ConstructFromType(this->FaceMakerClass.getValue());
+ FaceMaker* mkFace = &(*(fm_instance));
+ TopoDS_Shape myShape = sourceShape.getShape();
+ if(myShape.ShapeType() == TopAbs_COMPOUND)
+ mkFace->useCompound(TopoDS::Compound(myShape));
+ else
+ mkFace->addShape(myShape);
+ mkFace->Build();
+ myShape = mkFace->Shape();
+ sourceShape = TopoShape(myShape);
+
+ makeSolid = Standard_False;//don't ask TopoShape::revolve to make solid, as we've made faces...
+ }
TopoDS_Shape revolve = sourceShape.revolve(revAx, angle, makeSolid);
if (revolve.IsNull())
@@ -177,3 +195,11 @@ App::DocumentObjectExecReturn *Revolution::execute(void)
return new App::DocumentObjectExecReturn(e->GetMessageString());
}
}
+
+
+
+void Part::Revolution::setupObject()
+{
+ Part::Feature::setupObject();
+ this->FaceMakerClass.setValue("Part::FaceMakerBullseye"); //default for newly created features
+}
diff --git a/src/Mod/Part/App/FeatureRevolution.h b/src/Mod/Part/App/FeatureRevolution.h
index 4fa6d6055..b75958960 100644
--- a/src/Mod/Part/App/FeatureRevolution.h
+++ b/src/Mod/Part/App/FeatureRevolution.h
@@ -45,6 +45,7 @@ public:
App::PropertyFloatConstraint Angle;
App::PropertyBool Symmetric; //like "Midplane" in PartDesign
App::PropertyBool Solid;
+ App::PropertyString FaceMakerClass;
/** @name methods override feature */
//@{
@@ -79,6 +80,9 @@ public:
private:
static App::PropertyFloatConstraint::Constraints angleRangeU;
+
+protected:
+ virtual void setupObject();
};
} //namespace Part