Allow faces to be profiles for a sweep & minor fix loft
Allow faces to be used as the profiles for a Part_Sweep some minor fixes for Part_Loft
This commit is contained in:
parent
0a7a9d9cf2
commit
a3ef789f5a
|
@ -189,7 +189,7 @@ App::DocumentObjectExecReturn *Loft::execute(void)
|
|||
profiles.Append(shape);
|
||||
}
|
||||
else {
|
||||
return new App::DocumentObjectExecReturn("Linked shape is not a vertex, edge nor wire.");
|
||||
return new App::DocumentObjectExecReturn("Linked shape is not a vertex, edge, wire nor face.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -290,7 +290,11 @@ App::DocumentObjectExecReturn *Sweep::execute(void)
|
|||
// There is a weird behaviour of BRepOffsetAPI_MakePipeShell when trying to add the wire as is.
|
||||
// If we re-create the wire then everything works fine.
|
||||
// https://sourceforge.net/apps/phpbb/free-cad/viewtopic.php?f=10&t=2673&sid=fbcd2ff4589f0b2f79ed899b0b990648#p20268
|
||||
if (shape.ShapeType() == TopAbs_WIRE) {
|
||||
if (shape.ShapeType() == TopAbs_FACE) {
|
||||
TopoDS_Wire faceouterWire = ShapeAnalysis::OuterWire(TopoDS::Face(shape));
|
||||
profiles.Append(faceouterWire);
|
||||
}
|
||||
else if (shape.ShapeType() == TopAbs_WIRE) {
|
||||
BRepBuilderAPI_MakeWire mkWire(TopoDS::Wire(shape));
|
||||
profiles.Append(mkWire.Wire());
|
||||
}
|
||||
|
@ -302,7 +306,7 @@ App::DocumentObjectExecReturn *Sweep::execute(void)
|
|||
profiles.Append(shape);
|
||||
}
|
||||
else {
|
||||
return new App::DocumentObjectExecReturn("Linked shape is not a vertex, edge nor wire.");
|
||||
return new App::DocumentObjectExecReturn("Linked shape is not a vertex, edge, wire nor face.");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ LoftWidget::LoftWidget(QWidget* parent)
|
|||
Gui::Application::Instance->runPythonCode("import Part");
|
||||
|
||||
d->ui.setupUi(this);
|
||||
d->ui.selector->setAvailableLabel(tr("Vertex/Wire/Face"));
|
||||
d->ui.selector->setAvailableLabel(tr("Vertex/Edge/Wire/Face"));
|
||||
d->ui.selector->setSelectedLabel(tr("Loft"));
|
||||
|
||||
connect(d->ui.selector->availableTreeWidget(), SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)),
|
||||
|
@ -188,7 +188,7 @@ void LoftWidget::changeEvent(QEvent *e)
|
|||
QWidget::changeEvent(e);
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
d->ui.retranslateUi(this);
|
||||
d->ui.selector->setAvailableLabel(tr("Vertex/Wire/Face"));
|
||||
d->ui.selector->setAvailableLabel(tr("Vertex/Edge/Wire/Face"));
|
||||
d->ui.selector->setSelectedLabel(tr("Loft"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ SweepWidget::SweepWidget(QWidget* parent)
|
|||
Gui::Application::Instance->runPythonCode("import Part");
|
||||
|
||||
d->ui.setupUi(this);
|
||||
d->ui.selector->setAvailableLabel(tr("Vertex/Wire"));
|
||||
d->ui.selector->setAvailableLabel(tr("Vertex/Edge/Wire/Face"));
|
||||
d->ui.selector->setSelectedLabel(tr("Sweep"));
|
||||
|
||||
connect(d->ui.selector->availableTreeWidget(), SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)),
|
||||
|
@ -99,7 +99,8 @@ void SweepWidget::findShapes()
|
|||
const TopoDS_Shape& shape = (*it)->Shape.getValue();
|
||||
if (shape.IsNull()) continue;
|
||||
|
||||
if (shape.ShapeType() == TopAbs_WIRE ||
|
||||
if (shape.ShapeType() == TopAbs_FACE ||
|
||||
shape.ShapeType() == TopAbs_WIRE ||
|
||||
shape.ShapeType() == TopAbs_EDGE ||
|
||||
shape.ShapeType() == TopAbs_VERTEX) {
|
||||
QString label = QString::fromUtf8((*it)->Label.getValue());
|
||||
|
|
Loading…
Reference in New Issue
Block a user