Part_Loft add ability to use a Facefor a profile
Part Loft internally uses either a vertices and/or wires as profiles. If an edge is selected always was converted into a wire for MakeLoft. This commit allows a face to be selected and then uses ShapeAnalysis::OuterWire to aquire a wire (from the outer edges of the face) to pass to MakeLoft.
This commit is contained in:
committed by
Yorik van Havre
parent
5fc802dfa1
commit
0a7a9d9cf2
@@ -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"));
|
||||
d->ui.selector->setAvailableLabel(tr("Vertex/Wire/Face"));
|
||||
d->ui.selector->setSelectedLabel(tr("Loft"));
|
||||
|
||||
connect(d->ui.selector->availableTreeWidget(), SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)),
|
||||
@@ -98,7 +98,8 @@ void LoftWidget::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());
|
||||
@@ -132,7 +133,7 @@ bool LoftWidget::accept()
|
||||
|
||||
int count = d->ui.selector->selectedTreeWidget()->topLevelItemCount();
|
||||
if (count < 2) {
|
||||
QMessageBox::critical(this, tr("Too few elements"), tr("At least two vertices, edges or wires are required."));
|
||||
QMessageBox::critical(this, tr("Too few elements"), tr("At least two vertices, edges, wires or Faces are required."));
|
||||
return false;
|
||||
}
|
||||
for (int i=0; i<count; i++) {
|
||||
@@ -187,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"));
|
||||
d->ui.selector->setAvailableLabel(tr("Vertex/Wire/Face"));
|
||||
d->ui.selector->setSelectedLabel(tr("Loft"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user