allow to add faces to fillet and chamfer

This commit is contained in:
Stefan Tröger
2015-05-20 21:51:19 +02:00
parent 329064d671
commit fc1e8b8d17
13 changed files with 551 additions and 517 deletions

View File

@@ -23,18 +23,23 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <BRepAlgo.hxx>
# include <BRepFilletAPI_MakeFillet.hxx>
# include <TopExp_Explorer.hxx>
# include <TopoDS.hxx>
# include <TopoDS_Edge.hxx>
<<<<<<< 2c7cc8276bd6dd4ccc4aa28daa809a688bd493c5
# include <TopTools_ListOfShape.hxx>
=======
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopExp.hxx>
#include <BRep_Tool.hxx>
>>>>>>> allow to add faces to fillet and chamfer
#endif
<<<<<<< 50287516b47694e57429cc98f6d5596a06a635d6
#include <Base/Console.h>
#include <Base/Reader.h>
=======
#include <Base/Exception.h>
>>>>>>> Some code unification for DressUp features
#include <Base/Reader.h>
#include <Mod/Part/App/TopoShape.h>
#include "FeatureFillet.h"
@@ -69,11 +74,12 @@ App::DocumentObjectExecReturn *Fillet::execute(void)
} catch (Base::Exception& e) {
return new App::DocumentObjectExecReturn(e.what());
}
std::vector<std::string> SubNames = std::vector<std::string>(Base.getSubValues());
getContiniusEdges(TopShape, SubNames);
const std::vector<std::string>& SubVals = Base.getSubValuesStartsWith("Edge");
if (SubVals.size() == 0)
return new App::DocumentObjectExecReturn("No edges specified");
if (SubNames.size() == 0)
return new App::DocumentObjectExecReturn("Fillet not possible on selected shapes");
double radius = Radius.getValue();
this->positionByBaseFeature();
@@ -84,7 +90,7 @@ App::DocumentObjectExecReturn *Fillet::execute(void)
try {
BRepFilletAPI_MakeFillet mkFillet(baseShape._Shape);
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()));
mkFillet.Add(radius, edge);
}
@@ -97,6 +103,12 @@ App::DocumentObjectExecReturn *Fillet::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");
}
this->Shape.setValue(shape);
return App::DocumentObject::StdReturn;
}