diff --git a/src/Mod/MeshPart/App/AppMeshPartPy.cpp b/src/Mod/MeshPart/App/AppMeshPartPy.cpp index bfcedd1b0e4a..e09f6e2ae4be 100644 --- a/src/Mod/MeshPart/App/AppMeshPartPy.cpp +++ b/src/Mod/MeshPart/App/AppMeshPartPy.cpp @@ -135,30 +135,111 @@ wireFromSegment(PyObject *self, PyObject *args) } static PyObject * -meshFromShape(PyObject *self, PyObject *args) +meshFromShape(PyObject *self, PyObject *args, PyObject* kwds) { - PyObject *shape; - float maxLength=1.0f/*0.5f*/; - float maxArea=0/*1.0f*/; - float localLen=0/*0.1f*/; - float deflection=0/*0.01f*/; - if (!PyArg_ParseTuple(args, "O!|ffff", &(Part::TopoShapePy::Type), &shape, - &maxLength,&maxArea,&localLen,&deflection)) - return 0; - try { - MeshPart::Mesher mesher(static_cast(shape)->getTopoShapePtr()->_Shape); - mesher.setMaxLength(maxLength); - mesher.setMaxArea(maxArea); - mesher.setLocalLength(localLen); - mesher.setDeflection(deflection); - mesher.setRegular(true); - return new Mesh::MeshPy(mesher.createMesh()); + PyObject *shape; + + static char* kwds_maxLength[] = {"Shape", "MaxLength",NULL}; + PyErr_Clear(); + double maxLength=0; + if (PyArg_ParseTupleAndKeywords(args, kwds, "O!d", kwds_maxLength, + &(Part::TopoShapePy::Type), &shape, &maxLength)) { + MeshPart::Mesher mesher(static_cast(shape)->getTopoShapePtr()->_Shape); + mesher.setMaxLength(maxLength); + mesher.setRegular(true); + return new Mesh::MeshPy(mesher.createMesh()); + } + + static char* kwds_maxArea[] = {"Shape", "MaxArea",NULL}; + PyErr_Clear(); + double maxArea=0; + if (PyArg_ParseTupleAndKeywords(args, kwds, "O!d", kwds_maxArea, + &(Part::TopoShapePy::Type), &shape, &maxArea)) { + MeshPart::Mesher mesher(static_cast(shape)->getTopoShapePtr()->_Shape); + mesher.setMaxArea(maxArea); + mesher.setRegular(true); + return new Mesh::MeshPy(mesher.createMesh()); + } + + static char* kwds_localLen[] = {"Shape", "LocalLength",NULL}; + PyErr_Clear(); + double localLen=0; + if (PyArg_ParseTupleAndKeywords(args, kwds, "O!d", kwds_localLen, + &(Part::TopoShapePy::Type), &shape, &localLen)) { + MeshPart::Mesher mesher(static_cast(shape)->getTopoShapePtr()->_Shape); + mesher.setLocalLength(localLen); + mesher.setRegular(true); + return new Mesh::MeshPy(mesher.createMesh()); + } + + static char* kwds_deflection[] = {"Shape", "Deflection",NULL}; + PyErr_Clear(); + double deflection=0; + if (PyArg_ParseTupleAndKeywords(args, kwds, "O!d", kwds_deflection, + &(Part::TopoShapePy::Type), &shape, &deflection)) { + MeshPart::Mesher mesher(static_cast(shape)->getTopoShapePtr()->_Shape); + mesher.setDeflection(deflection); + mesher.setRegular(true); + return new Mesh::MeshPy(mesher.createMesh()); + } + + static char* kwds_minmaxLen[] = {"Shape", "MinLength","MaxLength",NULL}; + PyErr_Clear(); + double minLen=0, maxLen=0; + if (PyArg_ParseTupleAndKeywords(args, kwds, "O!dd", kwds_minmaxLen, + &(Part::TopoShapePy::Type), &shape, &minLen, &maxLen)) { + MeshPart::Mesher mesher(static_cast(shape)->getTopoShapePtr()->_Shape); + mesher.setMinMaxLengths(minLen, maxLen); + mesher.setRegular(true); + return new Mesh::MeshPy(mesher.createMesh()); + } + + static char* kwds_fineness[] = {"Shape", "Fineness", "SecondOrder", "Optimize", "AllowQuad",NULL}; + PyErr_Clear(); + int fineness=0, secondOrder=0, optimize=1, allowquad=0; + if (PyArg_ParseTupleAndKeywords(args, kwds, "O!i|iii", kwds_fineness, + &(Part::TopoShapePy::Type), &shape, &fineness, + &secondOrder, &optimize, &allowquad)) { + MeshPart::Mesher mesher(static_cast(shape)->getTopoShapePtr()->_Shape); + mesher.setFineness(fineness); + mesher.setSecondOrder(secondOrder > 0); + mesher.setOptimize(optimize > 0); + mesher.setQuadAllowed(allowquad > 0); + return new Mesh::MeshPy(mesher.createMesh()); + } + + static char* kwds_user[] = {"Shape", "GrowthRate", "SegPerEdge", "SegPerRadius", "SecondOrder", "Optimize", "AllowQuad",NULL}; + PyErr_Clear(); + double growthRate=0, nbSegPerEdge=0, nbSegPerRadius=0; + if (PyArg_ParseTupleAndKeywords(args, kwds, "O!|dddiii", kwds_user, + &(Part::TopoShapePy::Type), &shape, + &growthRate, &nbSegPerEdge, &nbSegPerRadius, + &secondOrder, &optimize, &allowquad)) { + MeshPart::Mesher mesher(static_cast(shape)->getTopoShapePtr()->_Shape); + mesher.setGrowthRate(growthRate); + mesher.setNbSegPerEdge(nbSegPerEdge); + mesher.setNbSegPerRadius(nbSegPerRadius); + mesher.setSecondOrder(secondOrder > 0); + mesher.setOptimize(optimize > 0); + mesher.setQuadAllowed(allowquad > 0); + return new Mesh::MeshPy(mesher.createMesh()); + } + + PyErr_Clear(); + if (PyArg_ParseTuple(args, "O!", &(Part::TopoShapePy::Type), &shape)) { + MeshPart::Mesher mesher(static_cast(shape)->getTopoShapePtr()->_Shape); + mesher.setRegular(true); + return new Mesh::MeshPy(mesher.createMesh()); + } } catch (const Base::Exception& e) { PyErr_SetString(PyExc_Exception, e.what()); return 0; } + + PyErr_SetString(PyExc_Exception,"Wrong arguments"); + return 0; } /* registration table */ @@ -166,7 +247,7 @@ struct PyMethodDef MeshPart_methods[] = { {"loftOnCurve",loftOnCurve, METH_VARARGS, loft_doc}, {"wireFromSegment",wireFromSegment, METH_VARARGS, "Create wire(s) from boundary of segment"}, - {"meshFromShape",meshFromShape, METH_VARARGS, + {"meshFromShape",(PyCFunction)meshFromShape, METH_VARARGS|METH_KEYWORDS, "Create mesh from shape"}, {NULL, NULL} /* end of table marker */ }; diff --git a/src/Mod/MeshPart/App/Mesher.cpp b/src/Mod/MeshPart/App/Mesher.cpp index 0c5d713ce900..2ff6adda8771 100644 --- a/src/Mod/MeshPart/App/Mesher.cpp +++ b/src/Mod/MeshPart/App/Mesher.cpp @@ -90,7 +90,9 @@ int MeshingOutput::sync() Mesher::Mesher(const TopoDS_Shape& s) : shape(s), maxLength(0), maxArea(0), localLength(0), - deflection(0), minLen(0), maxLen(0), regular(false) + deflection(0), minLen(0), maxLen(0), regular(false), + fineness(5), growthRate(0), nbSegPerEdge(0), nbSegPerRadius(0), + secondOrder(false), optimize(true), allowquad(false) { } @@ -112,37 +114,22 @@ Mesh::MeshObject* Mesher::createMesh() const #if defined(_MSC_VER) NETGENPlugin_Hypothesis_2D* hyp2d = new NETGENPlugin_Hypothesis_2D(hyp++,0,meshgen); - //TODO: Try to find values so that we get similar results as with Mefisto meshing - double growth = 0; - if (maxLength > 0 && localLength > 0) { - growth = std::min(maxLength, localLength); + if (fineness >=0 && fineness < 5) { + hyp2d->SetFineness(NETGENPlugin_Hypothesis_2D::Fineness(fineness)); } - else if (maxLength > 0) { - growth = maxLength; - } - else if (localLength > 0) { - growth = localLength; + // user defined values + else { + if (growthRate > 0) + hyp2d->SetGrowthRate(growthRate); + if (nbSegPerEdge > 0) + hyp2d->SetNbSegPerEdge(nbSegPerEdge); + if (nbSegPerRadius > 0) + hyp2d->SetNbSegPerRadius(nbSegPerRadius); } - if (growth == 0.0) - hyp2d->SetFineness(NETGENPlugin_Hypothesis_2D::Moderate); - else if (growth <= 0.1) - hyp2d->SetFineness(NETGENPlugin_Hypothesis_2D::VeryFine); - else if (growth <= 0.2f) - hyp2d->SetFineness(NETGENPlugin_Hypothesis_2D::Fine); - else if (growth <= 0.5f) - hyp2d->SetFineness(NETGENPlugin_Hypothesis_2D::Moderate); - else if (growth <= 0.7f) - hyp2d->SetFineness(NETGENPlugin_Hypothesis_2D::Coarse); - else - hyp2d->SetFineness(NETGENPlugin_Hypothesis_2D::VeryCoarse); - - //hyp2d->SetGrowthRate(growth); - //hyp2d->SetNbSegPerEdge(5); - //hyp2d->SetNbSegPerRadius(10); - hyp2d->SetQuadAllowed(false); - hyp2d->SetOptimize(true); - hyp2d->SetSecondOrder(true); // apply bisecting to create four triangles out of one + hyp2d->SetQuadAllowed(allowquad); + hyp2d->SetOptimize(optimize); + hyp2d->SetSecondOrder(secondOrder); // apply bisecting to create four triangles out of one hypoth.push_back(hyp2d); NETGENPlugin_NETGEN_2D* alg2d = new NETGENPlugin_NETGEN_2D(hyp++,0,meshgen); @@ -285,6 +272,53 @@ Mesh::MeshObject* Mesher::createMesh() const faces.push_back(f3); faces.push_back(f4); } +#if 0 // FIXME: how does the structure look like? + else if (aFace->NbNodes() == 8) { + MeshCore::MeshFacet f1, f2, f3, f4, f5, f6; + const SMDS_MeshNode* node0 = aFace->GetNode(0); + const SMDS_MeshNode* node1 = aFace->GetNode(1); + const SMDS_MeshNode* node2 = aFace->GetNode(2); + const SMDS_MeshNode* node3 = aFace->GetNode(3); + const SMDS_MeshNode* node4 = aFace->GetNode(4); + const SMDS_MeshNode* node5 = aFace->GetNode(5); + const SMDS_MeshNode* node6 = aFace->GetNode(5); + const SMDS_MeshNode* node7 = aFace->GetNode(5); + + f1._aulPoints[0] = mapNodeIndex[node0]; + f1._aulPoints[1] = mapNodeIndex[node4]; + f1._aulPoints[2] = mapNodeIndex[node7]; + + f2._aulPoints[0] = mapNodeIndex[node1]; + f2._aulPoints[1] = mapNodeIndex[node5]; + f2._aulPoints[2] = mapNodeIndex[node4]; + + f3._aulPoints[0] = mapNodeIndex[node2]; + f3._aulPoints[1] = mapNodeIndex[node6]; + f3._aulPoints[2] = mapNodeIndex[node5]; + + f4._aulPoints[0] = mapNodeIndex[node3]; + f4._aulPoints[1] = mapNodeIndex[node7]; + f4._aulPoints[2] = mapNodeIndex[node6]; + + f5._aulPoints[0] = mapNodeIndex[node4]; + f5._aulPoints[1] = mapNodeIndex[node6]; + f5._aulPoints[2] = mapNodeIndex[node7]; + + f6._aulPoints[0] = mapNodeIndex[node4]; + f6._aulPoints[1] = mapNodeIndex[node5]; + f6._aulPoints[2] = mapNodeIndex[node6]; + + faces.push_back(f1); + faces.push_back(f2); + faces.push_back(f3); + faces.push_back(f4); + faces.push_back(f5); + faces.push_back(f6); + } +#endif + else { + Base::Console().Warning("Face with %d nodes ignored\n", aFace->NbNodes()); + } } // clean up diff --git a/src/Mod/MeshPart/App/Mesher.h b/src/Mod/MeshPart/App/Mesher.h index 5fad63b02047..f3ac74f2b761 100644 --- a/src/Mod/MeshPart/App/Mesher.h +++ b/src/Mod/MeshPart/App/Mesher.h @@ -37,6 +37,8 @@ class Mesher Mesher(const TopoDS_Shape&); ~Mesher(); + /** @name Mefisto settings */ + //@{ void setMaxLength(double s) { maxLength = s; } double getMaxLength() const @@ -61,6 +63,39 @@ class Mesher { regular = s; } bool isRegular() const { return regular; } + //@} + + /** @name Netgen settings */ + //@{ + void setFineness(int s) + { fineness = s; } + int getFineness() const + { return fineness; } + void setGrowthRate(double r) + { growthRate = r; } + double getGrowthRate() const + { return growthRate; } + void setNbSegPerEdge(double v) + { nbSegPerEdge = v;} + double getNbSegPerEdge() const + { return nbSegPerEdge; } + void setNbSegPerRadius(double v) + { nbSegPerRadius = v; } + double getNbSegPerRadius() const + { return nbSegPerRadius; } + void setSecondOrder(bool on) + { secondOrder = on; } + bool getSecondOrder() const + { return secondOrder; } + void setOptimize(bool on) + { optimize = on;} + bool getOptimize() const + { return optimize; } + void setQuadAllowed(bool on) + { allowquad = on;} + bool isQuadAllowed() const + { return allowquad; } + //@} Mesh::MeshObject* createMesh() const; @@ -72,6 +107,13 @@ class Mesher double deflection; double minLen, maxLen; bool regular; + int fineness; + double growthRate; + double nbSegPerEdge; + double nbSegPerRadius; + bool secondOrder; + bool optimize; + bool allowquad; }; class MeshingOutput : public std::streambuf diff --git a/src/Mod/MeshPart/Gui/CMakeLists.txt b/src/Mod/MeshPart/Gui/CMakeLists.txt index dfc68c4a6cc3..e2f4e874c65f 100644 --- a/src/Mod/MeshPart/Gui/CMakeLists.txt +++ b/src/Mod/MeshPart/Gui/CMakeLists.txt @@ -4,6 +4,10 @@ else(MSVC) add_definitions(-DHAVE_LIMITS_H -DHAVE_CONFIG_H) endif(MSVC) +if(FREECAD_BUILD_FEM_NETGEN) + add_definitions(-DHAVE_NETGEN) +endif(FREECAD_BUILD_FEM_NETGEN) + include_directories( ${CMAKE_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR} diff --git a/src/Mod/MeshPart/Gui/Tessellation.cpp b/src/Mod/MeshPart/Gui/Tessellation.cpp index 5b1094a7eadb..4731b453800b 100644 --- a/src/Mod/MeshPart/Gui/Tessellation.cpp +++ b/src/Mod/MeshPart/Gui/Tessellation.cpp @@ -49,6 +49,31 @@ Tessellation::Tessellation(QWidget* parent) : QWidget(parent), ui(new Ui_Tessellation) { ui->setupUi(this); + + buttonGroup = new QButtonGroup(this); + buttonGroup->addButton(ui->radioButtonStandard, 0); + buttonGroup->addButton(ui->radioButtonMefisto, 1); + buttonGroup->addButton(ui->radioButtonNetgen, 2); + connect(buttonGroup, SIGNAL(buttonClicked(int)), + this, SLOT(meshingMethod(int))); + + // set the standard method + ui->radioButtonStandard->setChecked(true); + ui->comboFineness->setCurrentIndex(2); + on_comboFineness_currentIndexChanged(2); + +#if defined (_MSC_VER) + ui->radioButtonMefisto->setDisabled(true); +#else + ui->radioButtonMefisto->setChecked(true); +#endif +#if !defined (HAVE_NETGEN) + ui->radioButtonNetgen->setDisabled(true); +#else + ui->radioButtonNetgen->setChecked(true); +#endif + meshingMethod(buttonGroup->checkedId()); + Gui::Command::doCommand(Gui::Command::Doc, "import Mesh, MeshPart"); findShapes(); } @@ -57,24 +82,73 @@ Tessellation::~Tessellation() { } -void Tessellation::on_checkSimpleMethod_toggled(bool on) +void Tessellation::meshingMethod(int id) { - if (!on) { - if (ui->checkMaxEdgeLength->isChecked()) { - ui->checkMaxEdgeLength->setEnabled(true); - ui->spinMaxEdgeLength->setEnabled(true); - } + ui->stackedWidget->setCurrentIndex(id); +} + +void Tessellation::on_comboFineness_currentIndexChanged(int index) +{ + if (index == 5) { + ui->doubleGrading->setEnabled(true); + ui->spinEdgeElements->setEnabled(true); + ui->spinCurvatureElements->setEnabled(true); } else { - ui->checkMaxEdgeLength->setEnabled(false); - ui->spinMaxEdgeLength->setEnabled(false); + ui->doubleGrading->setEnabled(false); + ui->spinEdgeElements->setEnabled(false); + ui->spinCurvatureElements->setEnabled(false); + } + + switch (index) { + case 0: // Very coarse + ui->doubleGrading->setValue(0.7); + ui->spinEdgeElements->setValue(0.3); + ui->spinCurvatureElements->setValue(1.0); + break; + case 1: // Coarse + ui->doubleGrading->setValue(0.5); + ui->spinEdgeElements->setValue(0.5); + ui->spinCurvatureElements->setValue(1.5); + break; + case 2: // Moderate + ui->doubleGrading->setValue(0.3); + ui->spinEdgeElements->setValue(1.0); + ui->spinCurvatureElements->setValue(2.0); + break; + case 3: // Fine + ui->doubleGrading->setValue(0.2); + ui->spinEdgeElements->setValue(2.0); + ui->spinCurvatureElements->setValue(3.0); + break; + case 4: // Very fine + ui->doubleGrading->setValue(0.1); + ui->spinEdgeElements->setValue(3.0); + ui->spinCurvatureElements->setValue(5.0); + break; + default: + break; } } +void Tessellation::on_checkSecondOrder_toggled(bool on) +{ + if (on) + ui->checkQuadDominated->setChecked(false); +} + +void Tessellation::on_checkQuadDominated_toggled(bool on) +{ + if (on) + ui->checkSecondOrder->setChecked(false); +} + void Tessellation::changeEvent(QEvent *e) { if (e->type() == QEvent::LanguageChange) { + int index = ui->comboFineness->currentIndex(); ui->retranslateUi(this); + ui->comboFineness->setCurrentIndex(index); } QWidget::changeEvent(e); } @@ -123,7 +197,7 @@ void Tessellation::findShapes() } } - ui->spinMaxEdgeLength->setValue(edgeLen/10); + ui->spinMaximumEdgeLength->setValue(edgeLen/10); if (foundSelection) ui->treeWidget->hide(); } @@ -147,17 +221,7 @@ bool Tessellation::accept() QString shape, label; Gui::WaitCursor wc; - bool simple = ui->checkSimpleMethod->isChecked(); - double devFace = ui->spinDeviation->value(); - if (!ui->spinDeviation->isEnabled()) { - if (simple) - devFace = 0.1; - else - devFace = 0; - } - double maxEdge = ui->spinMaxEdgeLength->value(); - if (!ui->spinMaxEdgeLength->isEnabled()) - maxEdge = 0; + int method = buttonGroup->checkedId(); activeDoc->openTransaction("Meshing"); QList items = ui->treeWidget->selectedItems(); @@ -167,32 +231,81 @@ bool Tessellation::accept() label = (*it)->text(0); QString cmd; - if (simple) { + if (method == 0) { // Standard + double devFace = ui->spinSurfaceDeviation->value(); cmd = QString::fromAscii( "__doc__=FreeCAD.getDocument(\"%1\")\n" "__mesh__=__doc__.addObject(\"Mesh::Feature\",\"Mesh\")\n" "__mesh__.Mesh=Mesh.Mesh(__doc__.getObject(\"%2\").Shape.tessellate(%3))\n" "__mesh__.Label=\"%4 (Meshed)\"\n" + "__mesh__.ViewObject.CreaseAngle=25.0\n" "del __doc__, __mesh__\n") .arg(this->document) .arg(shape) .arg(devFace) .arg(label); } - else { + else if (method == 1) { // Mefisto + double maxEdge = ui->spinMaximumEdgeLength->value(); + if (!ui->spinMaximumEdgeLength->isEnabled()) + maxEdge = 0; cmd = QString::fromAscii( "__doc__=FreeCAD.getDocument(\"%1\")\n" "__mesh__=__doc__.addObject(\"Mesh::Feature\",\"Mesh\")\n" - "__mesh__.Mesh=MeshPart.meshFromShape(__doc__.getObject(\"%2\").Shape,%3,0,0,%4)\n" - "__mesh__.Label=\"%5 (Meshed)\"\n" + "__mesh__.Mesh=MeshPart.meshFromShape(Shape=__doc__.getObject(\"%2\").Shape,MaxLength=%3)\n" + "__mesh__.Label=\"%4 (Meshed)\"\n" "__mesh__.ViewObject.CreaseAngle=25.0\n" "del __doc__, __mesh__\n") .arg(this->document) .arg(shape) .arg(maxEdge) - .arg(devFace) .arg(label); } + else if (method == 2) { // Netgen + int fineness = ui->comboFineness->currentIndex(); + double growthRate = ui->doubleGrading->value(); + double nbSegPerEdge = ui->spinEdgeElements->value(); + double nbSegPerRadius = ui->spinCurvatureElements->value(); + bool secondOrder = ui->checkSecondOrder->isChecked(); + bool optimize = ui->checkOptimizeSurface->isChecked(); + bool allowquad = ui->checkQuadDominated->isChecked(); + if (fineness < 5) { + cmd = QString::fromAscii( + "__doc__=FreeCAD.getDocument(\"%1\")\n" + "__mesh__=__doc__.addObject(\"Mesh::Feature\",\"Mesh\")\n" + "__mesh__.Mesh=MeshPart.meshFromShape(Shape=__doc__.getObject(\"%2\").Shape," + "Fineness=%3,SecondOrder=%4,Optimize=%5,AllowQuad=%6)\n" + "__mesh__.Label=\"%7 (Meshed)\"\n" + "__mesh__.ViewObject.CreaseAngle=25.0\n" + "del __doc__, __mesh__\n") + .arg(this->document) + .arg(shape) + .arg(fineness) + .arg(secondOrder ? 1 : 0) + .arg(optimize ? 1 : 0) + .arg(allowquad ? 1 : 0) + .arg(label); + } + else { + cmd = QString::fromAscii( + "__doc__=FreeCAD.getDocument(\"%1\")\n" + "__mesh__=__doc__.addObject(\"Mesh::Feature\",\"Mesh\")\n" + "__mesh__.Mesh=MeshPart.meshFromShape(Shape=__doc__.getObject(\"%2\").Shape," + "GrowthRate=%3,SegPerEdge=%4,SegPerRadius=%5,SecondOrder=%6,Optimize=%7,AllowQuad=%8)\n" + "__mesh__.Label=\"%9 (Meshed)\"\n" + "__mesh__.ViewObject.CreaseAngle=25.0\n" + "del __doc__, __mesh__\n") + .arg(this->document) + .arg(shape) + .arg(growthRate) + .arg(nbSegPerEdge) + .arg(nbSegPerRadius) + .arg(secondOrder ? 1 : 0) + .arg(optimize ? 1 : 0) + .arg(allowquad ? 1 : 0) + .arg(label); + } + } Gui::Command::doCommand(Gui::Command::Doc, (const char*)cmd.toAscii()); } activeDoc->commitTransaction(); diff --git a/src/Mod/MeshPart/Gui/Tessellation.h b/src/Mod/MeshPart/Gui/Tessellation.h index 81e2627d4f69..e28ae08cd48a 100644 --- a/src/Mod/MeshPart/Gui/Tessellation.h +++ b/src/Mod/MeshPart/Gui/Tessellation.h @@ -29,6 +29,8 @@ #include #include +class QButtonGroup; + namespace MeshPartGui { class Ui_Tessellation; @@ -48,10 +50,14 @@ class Tessellation : public QWidget void findShapes(); private Q_SLOTS: - void on_checkSimpleMethod_toggled(bool); + void meshingMethod(int id); + void on_comboFineness_currentIndexChanged(int); + void on_checkSecondOrder_toggled(bool); + void on_checkQuadDominated_toggled(bool); private: QString document; + QButtonGroup* buttonGroup; std::auto_ptr ui; }; diff --git a/src/Mod/MeshPart/Gui/Tessellation.ui b/src/Mod/MeshPart/Gui/Tessellation.ui index 12e8c01a9b6d..463619ef367b 100644 --- a/src/Mod/MeshPart/Gui/Tessellation.ui +++ b/src/Mod/MeshPart/Gui/Tessellation.ui @@ -6,14 +6,14 @@ 0 0 - 329 - 431 + 363 + 508 Tessellation - + @@ -27,73 +27,312 @@ - + - Settings + Meshing options - + - - - - - Surface deviation: - - - true - - - - - - - 3 - - - 0.001000000000000 - - - 0.100000000000000 - - - 0.100000000000000 - - - - - - - Use simplified mesh generation method - - - - - - - Max. edge length: - - - true - - - - - - - 3 - - - 0.001000000000000 - - - 0.100000000000000 - - - 1.000000000000000 - - - - + + + Standard + + + + + + + Mefisto + + + + + + + Netgen + + + + + + + 0 + + + + + + + + + Surface deviation: + + + + + + + 3 + + + 0.001000000000000 + + + 0.100000000000000 + + + 0.100000000000000 + + + + + + + + + Qt::Vertical + + + + 20 + 189 + + + + + + + + + + + + + + Maximum edge length: + + + true + + + + + + + 3 + + + 0.100000000000000 + + + 1.000000000000000 + + + + + + + + + Qt::Vertical + + + + 20 + 189 + + + + + + + + + + + + + + Fineness: + + + + + + + + 0 + 0 + + + + 2 + + + + Very coarse + + + + + Coarse + + + + + Moderate + + + + + Fine + + + + + Very fine + + + + + User defined + + + + + + + + + + Mesh size grading: + + + + + + + false + + + 1 + + + 0.100000000000000 + + + 1.000000000000000 + + + 0.100000000000000 + + + 0.300000000000000 + + + + + + + Elements per edge: + + + + + + + false + + + 1 + + + 0.200000000000000 + + + 10.000000000000000 + + + 0.100000000000000 + + + 1.000000000000000 + + + + + + + Elements per curvature radius: + + + + + + + false + + + 1 + + + 0.200000000000000 + + + 10.000000000000000 + + + 0.100000000000000 + + + 2.000000000000000 + + + + + + + + + Optimize surface + + + true + + + + + + + Second order elements + + + + + + + Quad dominated + + + + + + + + + Qt::Vertical + + + + 20 + 37 + + + + + + + @@ -102,43 +341,22 @@ treeWidget - checkDeviation - spinDeviation - checkSimpleMethod - checkMaxEdgeLength - spinMaxEdgeLength - checkDeviation - toggled(bool) - spinDeviation - setEnabled(bool) - - - 104 - 359 - - - 308 - 360 - - - - - checkMaxEdgeLength + checkMaximumEdgeLength toggled(bool) - spinMaxEdgeLength + spinMaximumEdgeLength setEnabled(bool) - 112 - 396 + 81 + 343 - 197 - 399 + 208 + 350