Toposhape/Part: Transfer in FeatureFillet, FeatureChamfer and dependencies
This commit is contained in:
@@ -48,13 +48,15 @@ App::DocumentObjectExecReturn *Fillet::execute()
|
||||
if (!link)
|
||||
return new App::DocumentObjectExecReturn("No object linked");
|
||||
|
||||
auto baseShape = Feature::getShape(link);
|
||||
|
||||
try {
|
||||
#if defined(__GNUC__) && defined (FC_OS_LINUX)
|
||||
Base::SignalException se;
|
||||
#endif
|
||||
auto baseShape = Feature::getShape(link);
|
||||
TopoShape baseTopoShape = Feature::getTopoShape(link);
|
||||
BRepFilletAPI_MakeFillet mkFillet(baseShape);
|
||||
#ifndef FC_USE_TNP_FIX
|
||||
TopTools_IndexedMapOfShape mapOfShape;
|
||||
TopExp::MapShapes(baseShape, TopAbs_EDGE, mapOfShape);
|
||||
|
||||
@@ -92,6 +94,35 @@ App::DocumentObjectExecReturn *Fillet::execute()
|
||||
prop.touch();
|
||||
|
||||
return App::DocumentObject::StdReturn;
|
||||
#else
|
||||
const auto &vals = EdgeLinks.getSubValues();
|
||||
const auto &subs = EdgeLinks.getShadowSubs();
|
||||
if(subs.size()!=(size_t)Edges.getSize())
|
||||
return new App::DocumentObjectExecReturn("Edge link size mismatch");
|
||||
size_t i=0;
|
||||
for(const auto &info : Edges.getValues()) {
|
||||
auto &sub = subs[i];
|
||||
auto &ref = sub.first.size()?sub.first:vals[i];
|
||||
++i;
|
||||
TopoDS_Shape edge;
|
||||
try {
|
||||
edge = baseTopoShape.getSubShape(ref.c_str());
|
||||
}catch(...){}
|
||||
if(edge.IsNull())
|
||||
return new App::DocumentObjectExecReturn("Invalid edge link");
|
||||
double radius1 = info.radius1;
|
||||
double radius2 = info.radius2;
|
||||
mkFillet.Add(radius1, radius2, TopoDS::Edge(edge));
|
||||
}
|
||||
|
||||
TopoDS_Shape shape = mkFillet.Shape();
|
||||
if (shape.IsNull())
|
||||
return new App::DocumentObjectExecReturn("Resulting shape is null");
|
||||
|
||||
TopoShape res(0,getDocument()->getStringHasher());
|
||||
this->Shape.setValue(res.makEShape(mkFillet,baseTopoShape,Part::OpCodes::Fillet));
|
||||
return Part::Feature::execute();
|
||||
#endif
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
return new App::DocumentObjectExecReturn(e.GetMessageString());
|
||||
|
||||
Reference in New Issue
Block a user