Fix: edges of a solid can be used as surface input

Edges of a solid can be used as surface input. The real subName is
passed instead of the constant 'Edge1'
This commit is contained in:
balazs-bamer
2015-02-16 22:05:20 +01:00
committed by wmayer
parent dd6775e0f2
commit bb6620aa85
2 changed files with 12 additions and 4 deletions

View File

@@ -106,7 +106,6 @@ void ShapeValidator::checkAndAdd(const TopoDS_Shape &shape, Handle(ShapeExtend_W
void ShapeValidator::checkAndAdd(const Part::TopoShape &ts, const char *subName, Handle(ShapeExtend_WireData) *aWD)
{
try {
// unwrap the wire
if((!ts._Shape.IsNull()) && ts._Shape.ShapeType() == TopAbs_WIRE)

View File

@@ -198,8 +198,9 @@ void CmdSurfaceBSurf::createSurface(const char *surfaceNamePrefix, const char *c
bspListCmd << "FreeCAD.ActiveDocument.ActiveObject.BoundaryList = [";
for (std::vector<Gui::SelectionSingleton::SelObj>::iterator it = Sel.begin(); it != Sel.end(); ++it)
{
Part::TopoShape ts = static_cast<Part::Feature*>((*it).pObject)->Shape.getShape();
bspListCmd << "(App.activeDocument()." << it->FeatName;
Gui::SelectionSingleton::SelObj selObj = *it;
Part::TopoShape ts = static_cast<Part::Feature*>(selObj.pObject)->Shape.getShape();
bspListCmd << "(App.activeDocument()." << selObj.FeatName;
// if it is wire, add as wire
if((!ts._Shape.IsNull()) && ts._Shape.ShapeType() == TopAbs_WIRE)
{
@@ -207,7 +208,15 @@ void CmdSurfaceBSurf::createSurface(const char *surfaceNamePrefix, const char *c
}
else
{
bspListCmd << ", \'Edge1\'),";
const char *subName = selObj.SubName;
if(subName != NULL && *subName != 0)
{
bspListCmd << ", \'" << subName << "\'),";
}
else
{
bspListCmd << ", \'Edge1\'),";
}
}
}
bspListCmd << "]";