+ Make extrude again working for shapes without wires but edges
This commit is contained in:
parent
12277cccf2
commit
9414c938c6
|
@ -172,16 +172,28 @@ App::DocumentObjectExecReturn *Extrusion::execute(void)
|
||||||
// #0000910: Circles Extrude Only Surfaces, thus use BRepBuilderAPI_Copy
|
// #0000910: Circles Extrude Only Surfaces, thus use BRepBuilderAPI_Copy
|
||||||
myShape = BRepBuilderAPI_Copy(myShape).Shape();
|
myShape = BRepBuilderAPI_Copy(myShape).Shape();
|
||||||
if (makeSolid && myShape.ShapeType() != TopAbs_FACE) {
|
if (makeSolid && myShape.ShapeType() != TopAbs_FACE) {
|
||||||
|
std::vector<TopoDS_Wire> wires;
|
||||||
TopTools_IndexedMapOfShape mapOfWires;
|
TopTools_IndexedMapOfShape mapOfWires;
|
||||||
TopExp::MapShapes(myShape, TopAbs_WIRE, mapOfWires);
|
TopExp::MapShapes(myShape, TopAbs_WIRE, mapOfWires);
|
||||||
if (!mapOfWires.IsEmpty()) {
|
|
||||||
try {
|
|
||||||
std::vector<TopoDS_Wire> wires;
|
|
||||||
wires.reserve(mapOfWires.Extent());
|
|
||||||
for (int i=1; i<=mapOfWires.Extent(); i++) {
|
|
||||||
wires.push_back(TopoDS::Wire(mapOfWires.FindKey(i)));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// if there are no wires then check also for edges
|
||||||
|
if (mapOfWires.IsEmpty()) {
|
||||||
|
TopTools_IndexedMapOfShape mapOfEdges;
|
||||||
|
TopExp::MapShapes(myShape, TopAbs_EDGE, mapOfEdges);
|
||||||
|
for (int i=1; i<=mapOfEdges.Extent(); i++) {
|
||||||
|
BRepBuilderAPI_MakeWire mkWire(TopoDS::Edge(mapOfEdges.FindKey(i)));
|
||||||
|
wires.push_back(mkWire.Wire());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
wires.reserve(mapOfWires.Extent());
|
||||||
|
for (int i=1; i<=mapOfWires.Extent(); i++) {
|
||||||
|
wires.push_back(TopoDS::Wire(mapOfWires.FindKey(i)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!wires.empty()) {
|
||||||
|
try {
|
||||||
TopoDS_Shape res = makeFace(wires);
|
TopoDS_Shape res = makeFace(wires);
|
||||||
if (!res.IsNull())
|
if (!res.IsNull())
|
||||||
myShape = res;
|
myShape = res;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user