allow to add faces to fillet and chamfer
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
# include <TopTools_IndexedMapOfShape.hxx>
|
||||
# include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
|
||||
# include <TopTools_ListOfShape.hxx>
|
||||
#include <BRep_Tool.hxx>
|
||||
#endif
|
||||
|
||||
#include <Base/Console.h>
|
||||
@@ -74,8 +75,10 @@ App::DocumentObjectExecReturn *Chamfer::execute(void)
|
||||
return new App::DocumentObjectExecReturn(e.what());
|
||||
}
|
||||
|
||||
const std::vector<std::string>& SubVals = Base.getSubValuesStartsWith("Edge");
|
||||
if (SubVals.size() == 0)
|
||||
std::vector<std::string> SubNames = std::vector<std::string>(Base.getSubValues());
|
||||
getContiniusEdges(TopShape, SubNames);
|
||||
|
||||
if (SubNames.size() == 0)
|
||||
return new App::DocumentObjectExecReturn("No edges specified");
|
||||
|
||||
double size = Size.getValue();
|
||||
@@ -92,7 +95,7 @@ App::DocumentObjectExecReturn *Chamfer::execute(void)
|
||||
TopExp::MapShapesAndAncestors(baseShape._Shape, TopAbs_EDGE, TopAbs_FACE, mapEdgeFace);
|
||||
TopExp::MapShapes(baseShape._Shape, TopAbs_EDGE, mapOfEdges);
|
||||
|
||||
for (std::vector<std::string>::const_iterator it=SubVals.begin(); it != SubVals.end(); ++it) {
|
||||
for (std::vector<std::string>::const_iterator it=SubNames.begin(); it != SubNames.end(); ++it) {
|
||||
TopoDS_Edge edge = TopoDS::Edge(baseShape.getSubShape(it->c_str()));
|
||||
const TopoDS_Face& face = TopoDS::Face(mapEdgeFace.FindFromKey(edge).First());
|
||||
mkChamfer.Add(size, edge, face);
|
||||
@@ -106,11 +109,11 @@ App::DocumentObjectExecReturn *Chamfer::execute(void)
|
||||
if (shape.IsNull())
|
||||
return new App::DocumentObjectExecReturn("Resulting shape is null");
|
||||
|
||||
TopTools_ListOfShape aLarg;
|
||||
aLarg.Append(baseShape._Shape);
|
||||
if (!BRepAlgo::IsValid(aLarg, shape, Standard_False, Standard_False)) {
|
||||
return new App::DocumentObjectExecReturn("Resulting shape is invalid");
|
||||
}
|
||||
TopTools_ListOfShape aLarg;
|
||||
aLarg.Append(baseShape._Shape);
|
||||
if (!BRepAlgo::IsValid(aLarg, shape, Standard_False, Standard_False)) {
|
||||
return new App::DocumentObjectExecReturn("Resulting shape is invalid");
|
||||
}
|
||||
|
||||
this->Shape.setValue(shape);
|
||||
return App::DocumentObject::StdReturn;
|
||||
|
||||
Reference in New Issue
Block a user