Merge branch 'V9_2_BR'

This commit is contained in:
vsr 2018-12-10 17:29:37 +03:00
commit 05bdaa6d2e
11 changed files with 423 additions and 260 deletions

View File

@ -33,11 +33,11 @@ ENDIF(WIN32)
STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
SET(${PROJECT_NAME_UC}_MAJOR_VERSION 9) SET(${PROJECT_NAME_UC}_MAJOR_VERSION 9)
SET(${PROJECT_NAME_UC}_MINOR_VERSION 1) SET(${PROJECT_NAME_UC}_MINOR_VERSION 2)
SET(${PROJECT_NAME_UC}_PATCH_VERSION 0) SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
SET(${PROJECT_NAME_UC}_VERSION SET(${PROJECT_NAME_UC}_VERSION
${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION}) ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
SET(${PROJECT_NAME_UC}_VERSION_DEV 0) SET(${PROJECT_NAME_UC}_VERSION_DEV 1)
# Common CMake macros # Common CMake macros
# =================== # ===================

View File

@ -24,6 +24,7 @@ SALOME_CONFIGURE_FILE(VERSION.in VERSION INSTALL ${SALOME_INSTALL_BINS})
# scripts / static # scripts / static
SET(_bin_SCRIPTS SET(_bin_SCRIPTS
smesh_setenv.py smesh_setenv.py
smesh_test.py
) )
# --- rules --- # --- rules ---

122
bin/smesh_test.py Normal file
View File

@ -0,0 +1,122 @@
# -*- coding: iso-8859-1 -*-
# Copyright (C) 2018 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
import unittest
class TestMesh(unittest.TestCase):
def setUp(self):
import salome
salome.salome_init()
def processGuiEvents(self):
import salome
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser();
import SalomePyQt
SalomePyQt.SalomePyQt().processEvents()
def test_mesh(self):
"""Quick test for Mesh module"""
print()
print('Testing Mesh module')
# ==== Geometry part ====
from salome.geom import geomBuilder
geompy = geomBuilder.New()
# ---- create box
print('... Create box')
box = geompy.MakeBox(0., 0., 0., 100., 200., 300)
self.assertIsNotNone(box)
self.processGuiEvents()
# ==== Mesh part ====
import SMESH
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New()
lib = 'StdMeshersEngine'
self.processGuiEvents()
# ---- create hypotheses
print('... Create hypotheses')
# **** create local length
print('...... Local Length')
local_length = smesh.CreateHypothesis('LocalLength', lib)
self.assertIsNotNone(local_length)
local_length.SetLength(100)
self.assertEqual(local_length.GetName(), 'LocalLength')
self.assertEqual(local_length.GetLength(), 100)
self.processGuiEvents()
# **** create number of segments
print('...... Number Of Segments')
nb_segments= smesh.CreateHypothesis('NumberOfSegments', lib)
self.assertIsNotNone(nb_segments)
nb_segments.SetNumberOfSegments(7)
self.assertEqual(nb_segments.GetName(), 'NumberOfSegments')
self.assertEqual(nb_segments.GetNumberOfSegments(), 7)
self.processGuiEvents()
# **** create max element area
print('...... Max Element Area')
max_area = smesh.CreateHypothesis('MaxElementArea', lib)
max_area.SetMaxElementArea(2500)
self.assertEqual(max_area.GetName(), 'MaxElementArea')
self.assertEqual(max_area.GetMaxElementArea(), 2500)
self.processGuiEvents()
# ---- create algorithms
print('... Create algorithms')
# **** create regular 1d
print('...... Regular 1D')
regular = smesh.CreateHypothesis('Regular_1D', lib)
listHyp = regular.GetCompatibleHypothesis()
self.assertEqual(regular.GetName(), 'Regular_1D')
self.processGuiEvents()
# **** create mefisto 2d
print('...... Mefisto 2D')
mefisto = smesh.CreateHypothesis( 'MEFISTO_2D', lib )
listHyp = mefisto.GetCompatibleHypothesis()
self.assertEqual(mefisto.GetName(), 'MEFISTO_2D')
self.processGuiEvents()
# ---- create mesh on box
print('... Create mesh on box')
mesh = smesh.CreateMesh(box)
self.assertEqual(mesh.AddHypothesis(box, regular)[0], SMESH.HYP_OK)
self.assertEqual(mesh.AddHypothesis(box, mefisto)[0], SMESH.HYP_OK)
self.assertEqual(mesh.AddHypothesis(box, nb_segments)[0], SMESH.HYP_OK)
self.assertEqual(mesh.AddHypothesis(box, max_area)[0], SMESH.HYP_OK)
self.processGuiEvents()
# ---- compute mesh
print('... Compute mesh')
self.assertEqual(smesh.Compute(mesh, box), True)
self.processGuiEvents()
if __name__ == '__main__':
unittest.main()

View File

@ -3484,9 +3484,9 @@ SMESHGUI_CtrlInfo::SMESHGUI_CtrlInfo( QWidget* parent )
myMainLayout->setColumnStretch( 0, 0 ); myMainLayout->setColumnStretch( 0, 0 );
myMainLayout->setColumnStretch( 1, 5 ); myMainLayout->setColumnStretch( 1, 5 );
myMainLayout->setRowStretch ( 11, 5 ); myMainLayout->setRowStretch ( 12, 5 );
myMainLayout->setRowStretch ( 16, 5 ); myMainLayout->setRowStretch ( 17, 5 );
myMainLayout->setRowStretch ( 17, 1 ); myMainLayout->setRowStretch ( 18, 1 );
clearInternal(); clearInternal();
} }
@ -3628,13 +3628,11 @@ void SMESHGUI_CtrlInfo::showInfo( SMESH::SMESH_IDSource_ptr obj )
myButtons[6]->setEnabled( true ); myButtons[6]->setEnabled( true );
} }
#ifdef DISABLE_PLOT2DVIEWER #ifdef DISABLE_PLOT2DVIEWER
myMainLayout->setRowStretch(12,0);
for( int i=25; i<=27; i++) for( int i=25; i<=27; i++)
myMainLayout->itemAt(i)->widget()->setVisible( false ); myMainLayout->itemAt(i)->widget()->setVisible( false );
#endif #endif
} }
else { else {
myMainLayout->setRowStretch(12,0);
for( int i=18; i<=27; i++) for( int i=18; i<=27; i++)
myMainLayout->itemAt(i)->widget()->setVisible( false ); myMainLayout->itemAt(i)->widget()->setVisible( false );
} }
@ -3655,13 +3653,11 @@ void SMESHGUI_CtrlInfo::showInfo( SMESH::SMESH_IDSource_ptr obj )
myButtons[9]->setEnabled( true ); myButtons[9]->setEnabled( true );
} }
#ifdef DISABLE_PLOT2DVIEWER #ifdef DISABLE_PLOT2DVIEWER
myMainLayout->setRowStretch(17,0);
for( int i=35; i<=37; i++) for( int i=35; i<=37; i++)
myMainLayout->itemAt(i)->widget()->setVisible( false ); myMainLayout->itemAt(i)->widget()->setVisible( false );
#endif #endif
} }
else { else {
myMainLayout->setRowStretch(17,0);
for( int i=28; i<=37; i++) for( int i=28; i<=37; i++)
myMainLayout->itemAt(i)->widget()->setVisible( false ); myMainLayout->itemAt(i)->widget()->setVisible( false );
} }
@ -3799,7 +3795,7 @@ void SMESHGUI_CtrlInfo::computeAspectRatio3D()
*/ */
void SMESHGUI_CtrlInfo::clearInternal() void SMESHGUI_CtrlInfo::clearInternal()
{ {
for( int i=0; i<=35; i++) for( int i=0; i<=37; i++)
myMainLayout->itemAt(i)->widget()->setVisible( true ); myMainLayout->itemAt(i)->widget()->setVisible( true );
for( int i=0; i<=9; i++) for( int i=0; i<=9; i++)
myButtons[i]->setEnabled( false ); myButtons[i]->setEnabled( false );
@ -3810,8 +3806,6 @@ void SMESHGUI_CtrlInfo::clearInternal()
myWidgets[0]->setText( QString() ); myWidgets[0]->setText( QString() );
for ( int i = 1; i < myWidgets.count(); i++ ) for ( int i = 1; i < myWidgets.count(); i++ )
myWidgets[i]->setText( "" ); myWidgets[i]->setText( "" );
myMainLayout->setRowStretch(11,5);
myMainLayout->setRowStretch(16,5);
} }
void SMESHGUI_CtrlInfo::setTolerance( double theTolerance ) void SMESHGUI_CtrlInfo::setTolerance( double theTolerance )

View File

@ -27,6 +27,10 @@
<source>TEXT_FILES_FILTER</source> <source>TEXT_FILES_FILTER</source>
<translation>Fichiers TXT</translation> <translation>Fichiers TXT</translation>
</message> </message>
<message>
<source>MED_VX_FILES_FILTER</source>
<translation>fichiers MED %1</translation>
</message>
<message> <message>
<source>STL_FILES_FILTER</source> <source>STL_FILES_FILTER</source>
<translation>Fichiers STL</translation> <translation>Fichiers STL</translation>
@ -103,6 +107,10 @@
<source>MIN_DIAG_ELEMENTS</source> <source>MIN_DIAG_ELEMENTS</source>
<translation>Diagonale minimum</translation> <translation>Diagonale minimum</translation>
</message> </message>
<message>
<source>MIN_ELEM_EDGE</source>
<translation>Longueur arête Minimum</translation>
</message>
<message> <message>
<source>ASPECTRATIO_3D_ELEMENTS</source> <source>ASPECTRATIO_3D_ELEMENTS</source>
<translation>Rapport de forme 3D</translation> <translation>Rapport de forme 3D</translation>
@ -224,6 +232,10 @@
<source>LENGTH2D_EDGES</source> <source>LENGTH2D_EDGES</source>
<translation>Longueur 2D</translation> <translation>Longueur 2D</translation>
</message> </message>
<message>
<source>DEFLECTION2D_FACES</source>
<translation>Deflection 2D</translation>
</message>
<message> <message>
<source>LENGTH_EDGES</source> <source>LENGTH_EDGES</source>
<translation>Longueur</translation> <translation>Longueur</translation>
@ -238,7 +250,11 @@
</message> </message>
<message> <message>
<source>MAX_ELEMENT_LENGTH_3D</source> <source>MAX_ELEMENT_LENGTH_3D</source>
<translation>Diamètre d&apos;éléments 3D</translation> <translation>Diamètre Element 3D</translation>
</message>
<message>
<source>DEFLECTION_2D</source>
<translation>Deflection 2D</translation>
</message> </message>
<message> <message>
<source>MEN_ADD</source> <source>MEN_ADD</source>
@ -692,6 +708,10 @@
<source>MEN_LENGTH_2D</source> <source>MEN_LENGTH_2D</source>
<translation>Longueur 2D</translation> <translation>Longueur 2D</translation>
</message> </message>
<message>
<source>MEN_DEFLECTION_2D</source>
<translation>Deflection 2D</translation>
</message>
<message> <message>
<source>MEN_MAP</source> <source>MEN_MAP</source>
<translation>Projection de motif</translation> <translation>Projection de motif</translation>
@ -1074,7 +1094,11 @@
</message> </message>
<message> <message>
<source>MEN_SCALE</source> <source>MEN_SCALE</source>
<translation>Transformation d&apos;échelle</translation> <translation>Changement d'échelle</translation>
</message>
<message>
<source>MEN_OFFSET</source>
<translation>Offset</translation>
</message> </message>
<message> <message>
<source>MEN_DUPLICATE_NODES</source> <source>MEN_DUPLICATE_NODES</source>
@ -1914,6 +1938,14 @@ les données exportées ?</translation>
<source>SMESH_HYPOTHESES</source> <source>SMESH_HYPOTHESES</source>
<translation>Hypothèses</translation> <translation>Hypothèses</translation>
</message> </message>
<message>
<source>SMESH_HYPOTHESIS</source>
<translation>Hypothese</translation>
</message>
<message>
<source>SMESH_ALGORITHM</source>
<translation>Algorithme</translation>
</message>
<message> <message>
<source>SMESH_HYP_1</source> <source>SMESH_HYP_1</source>
<translation>Il manque une hypothèse à l&apos;algorithme</translation> <translation>Il manque une hypothèse à l&apos;algorithme</translation>
@ -3272,6 +3304,10 @@ Utilisez le menu &quot;Visualiser une entité&quot; pour les afficher.
<source>STB_LENGTH_2D</source> <source>STB_LENGTH_2D</source>
<translation>Longueur 2D</translation> <translation>Longueur 2D</translation>
</message> </message>
<message>
<source>STB_DEFLECTION_2D</source>
<translation>Deflection 2D</translation>
</message>
<message> <message>
<source>STB_MAP</source> <source>STB_MAP</source>
<translation>Projection de motif</translation> <translation>Projection de motif</translation>
@ -3526,7 +3562,11 @@ Utilisez le menu &quot;Visualiser une entité&quot; pour les afficher.
</message> </message>
<message> <message>
<source>STB_SCALE</source> <source>STB_SCALE</source>
<translation>Mise à l&apos;échelle</translation> <translation>Mise à l'échelle</translation>
</message>
<message>
<source>STB_OFFSET</source>
<translation>Décalage</translation>
</message> </message>
<message> <message>
<source>STB_DUPLICATE_NODES</source> <source>STB_DUPLICATE_NODES</source>
@ -3952,6 +3992,10 @@ Utilisez le menu &quot;Visualiser une entité&quot; pour les afficher.
<source>TOP_LENGTH_2D</source> <source>TOP_LENGTH_2D</source>
<translation>Longueur 2D</translation> <translation>Longueur 2D</translation>
</message> </message>
<message>
<source>TOP_DEFLECTION_2D</source>
<translation>Deflection 2D</translation>
</message>
<message> <message>
<source>TOP_MAP</source> <source>TOP_MAP</source>
<translation>Projection de motif</translation> <translation>Projection de motif</translation>
@ -4202,7 +4246,11 @@ Utilisez le menu &quot;Visualiser une entité&quot; pour les afficher.
</message> </message>
<message> <message>
<source>TOP_SCALE</source> <source>TOP_SCALE</source>
<translation>Mise à l&apos;échelle</translation> <translation>Mise à l'échelle</translation>
</message>
<message>
<source>TOP_OFFSET</source>
<translation>Offset</translation>
</message> </message>
<message> <message>
<source>TOP_DUPLICATE_NODES</source> <source>TOP_DUPLICATE_NODES</source>
@ -4479,6 +4527,21 @@ Il ne peut pas être supprimé.</translation>
<translation>Exporter les champs</translation> <translation>Exporter les champs</translation>
</message> </message>
</context> </context>
<context>
<name>SMESHGUI_OffsetDlg</name>
<message>
<source>SMESH_OFFSET_TITLE</source>
<translation>Offset</translation>
</message>
<message>
<source>SMESH_OFFSET</source>
<translation>Offset</translation>
</message>
<message>
<source>OFFSET_VALUE</source>
<translation>Offset Value</translation>
</message>
</context>
<context> <context>
<name>SMESHGUI_AddMeshElementDlg</name> <name>SMESHGUI_AddMeshElementDlg</name>
<message> <message>
@ -5869,6 +5932,10 @@ Entrez une valeur correcte et essayez de nouveau</translation>
<source>LENGTH2D</source> <source>LENGTH2D</source>
<translation>Longueur 2D</translation> <translation>Longueur 2D</translation>
</message> </message>
<message>
<source>DEFLECTION2D</source>
<translation>Deflection 2D</translation>
</message>
<message> <message>
<source>LESS_THAN</source> <source>LESS_THAN</source>
<translation>Inférieur à ...</translation> <translation>Inférieur à ...</translation>
@ -7210,7 +7277,11 @@ Il y a trop peu de points dans le fichier </translation>
</message> </message>
<message> <message>
<source>ON_ALL_BOUNDARIES</source> <source>ON_ALL_BOUNDARIES</source>
<translation>Sur toutes les frontières</translation> <translation>sur toutes les frontières</translation>
</message>
<message>
<source>GENERATE_GROUPS</source>
<translation>Génerer</translation>
</message> </message>
</context> </context>
<context> <context>
@ -8008,7 +8079,30 @@ en raison de leurs types incompatibles:
</message> </message>
<message> <message>
<source>NEW_NAME</source> <source>NEW_NAME</source>
<translation>Nom du nouveau maillage</translation> <translation>New Mesh Name</translation>
</message>
<message>
<source>NEW_GEOM</source>
<translation>New Geometry</translation>
</message>
<message>
<source>REUSE_HYPOTHESES</source>
<translation>Reuse Hypotheses</translation>
</message>
<message>
<source>COPY_ELEMENTS</source>
<translation>Copy Mesh Elements</translation>
</message>
<message>
<source>OPERATION_FAILED</source>
<translation>Not all mesh sub-objects have been copied</translation>
</message>
<message>
<source>SUBSHAPES_NOT_FOUND_MSG</source>
<translation>
Some sub-shapes not found in the new geometry. They are listed
below along with dependent mesh objects that are marked with
with red in the Object Browser.</translation>
</message> </message>
</context> </context>
<context> <context>

View File

@ -100,7 +100,7 @@ SET(StdMeshers_SCRIPTS
StdMeshersBuilder.py StdMeshersBuilder.py
) )
# --- rules --- # --- rules ---
SALOME_INSTALL_SCRIPTS("${_bin_SCRIPTS}" ${SALOME_INSTALL_SCRIPT_PYTHON} DEF_PERMS) SALOME_INSTALL_SCRIPTS("${_bin_SCRIPTS}" ${SALOME_INSTALL_PYTHON} DEF_PERMS)
SALOME_INSTALL_SCRIPTS("${smesh_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/smesh DEF_PERMS) SALOME_INSTALL_SCRIPTS("${smesh_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/smesh DEF_PERMS)
SALOME_INSTALL_SCRIPTS("${StdMeshers_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/StdMeshers DEF_PERMS) SALOME_INSTALL_SCRIPTS("${StdMeshers_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/StdMeshers DEF_PERMS)
SALOME_INSTALL_SCRIPTS(SMESH_shared_modules.py ${SALOME_INSTALL_PYTHON}/shared_modules DEF_PERMS) SALOME_INSTALL_SCRIPTS(SMESH_shared_modules.py ${SALOME_INSTALL_PYTHON}/shared_modules DEF_PERMS)

View File

@ -339,12 +339,9 @@ class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget):
def getResumeData(self, separator="\n"): def getResumeData(self, separator="\n"):
text="" text=""
if self.RB_Fix1.isChecked(): if self.RB_Fix1.isChecked():
CheckOrFix="fix1pass" CheckOrFix="mode_fix"
else: else:
if self.RB_Fix2.isChecked(): CheckOrFix="mode_check"
CheckOrFix="fix2pass"
else:
CheckOrFix="check"
text+="CheckOrFix="+CheckOrFix+separator text+="CheckOrFix="+CheckOrFix+separator
text+="PreserveTopology="+str(self.CB_PreserveTopology.isChecked())+separator text+="PreserveTopology="+str(self.CB_PreserveTopology.isChecked())+separator
text+="FillHoles="+str(self.CB_FillHoles.isChecked())+separator text+="FillHoles="+str(self.CB_FillHoles.isChecked())+separator
@ -377,11 +374,9 @@ class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget):
tit,value=lig.split("=") tit,value=lig.split("=")
if tit=="CheckOrFix": if tit=="CheckOrFix":
self.RB_Fix1.setChecked(False) self.RB_Fix1.setChecked(False)
self.RB_Fix2.setChecked(False)
self.RB_Check.setChecked(False) self.RB_Check.setChecked(False)
if value=="fix1pass": self.RB_Fix1.setChecked(True) if value=="mode_fix": self.RB_Fix1.setChecked(True)
if value=="fix2pass": self.RB_Fix2.setChecked(True) if value=="mode_check": self.RB_Check.setChecked(True)
if value=="check": self.RB_Check.setChecked(True)
if tit=="PreserveTopology": self.CB_PreserveTopology.setChecked(value=="True") if tit=="PreserveTopology": self.CB_PreserveTopology.setChecked(value=="True")
if tit=="FillHoles": self.CB_FillHoles.setChecked(value=="True") if tit=="FillHoles": self.CB_FillHoles.setChecked(value=="True")
if tit=="MinHoleSize": self.SP_MinHoleSize.setProperty("text", value) if tit=="MinHoleSize": self.SP_MinHoleSize.setProperty("text", value)
@ -563,12 +558,9 @@ class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget):
self.fichierOut=deb[0] + "_fix.mesh" self.fichierOut=deb[0] + "_fix.mesh"
self.commande+=" --out "+self.fichierOut self.commande+=" --out "+self.fichierOut
if self.RB_Fix1.isChecked(): if self.RB_Fix1.isChecked():
self.commande+=" --fix1pass" self.commande+=" --mode fix"
else: else:
if self.RB_Fix2.isChecked(): self.commande+=" --mode check"
self.commande+=" --fix2pass"
else:
self.commande+=" --check"
if self.CB_PreserveTopology.isChecked(): if self.CB_PreserveTopology.isChecked():
self.commande+=" --topology respect" self.commande+=" --topology respect"
else: else:
@ -590,8 +582,7 @@ class MGCleanerMonPlugDialog(Ui_MGCleanerPlugDialog,QWidget):
def clean(self): def clean(self):
self.RB_Check.setChecked(False) self.RB_Check.setChecked(False)
self.RB_Fix1.setChecked(False) self.RB_Fix1.setChecked(True)
self.RB_Fix2.setChecked(True)
self.CB_PreserveTopology.setChecked(False) self.CB_PreserveTopology.setChecked(False)
self.CB_FillHoles.setChecked(False) self.CB_FillHoles.setChecked(False)
self.CB_RemeshPlanes.setChecked(False) self.CB_RemeshPlanes.setChecked(False)

View File

@ -19,7 +19,7 @@
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="2" column="0"> <item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>
<spacer name="horizontalSpacer_xx"> <spacer name="horizontalSpacer_xx">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
@ -34,7 +34,7 @@
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="PB_OK"> <widget class="QPushButton" name="PB_OK">
<property name="text"> <property name="text">
@ -67,12 +67,12 @@
<property name="text"> <property name="text">
<string>Save</string> <string>Save</string>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
<width>18</width> <width>18</width>
<height>18</height> <height>18</height>
</size> </size>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
@ -80,12 +80,12 @@
<property name="text"> <property name="text">
<string>Load</string> <string>Load</string>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
<width>18</width> <width>18</width>
<height>18</height> <height>18</height>
</size> </size>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
@ -120,7 +120,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_xx"> <spacer name="horizontalSpacer_xx">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
@ -135,7 +135,7 @@
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
</layout> </layout>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
@ -164,126 +164,102 @@
<property name="title"> <property name="title">
<string>Options</string> <string>Options</string>
</property> </property>
<layout class="QHBoxLayout" name="RBLayoutopt">
<layout class="QHBoxLayout" name="RBLayoutopt"> <item>
<spacer name="horizontalSpacer_xx">
<item> <property name="orientation">
<spacer name="horizontalSpacer_xx"> <enum>Qt::Horizontal</enum>
<property name="orientation"> </property>
<enum>Qt::Horizontal</enum> <property name="sizeType">
</property> <enum>QSizePolicy::Minimum</enum>
<property name="sizeType"> </property>
<enum>QSizePolicy::Minimum</enum> <property name="sizeHint" stdset="0">
</property> <size>
<property name="sizeHint" stdset="0"> <width>30</width>
<size> <height>20</height>
<width>30</width> </size>
<height>20</height> </property>
</size> </spacer>
</property> </item>
</spacer> <item>
</item> <layout class="QVBoxLayout" name="RBLayout1">
<item>
<item> <widget class="QRadioButton" name="RB_Check">
<layout class="QVBoxLayout" name="RBLayout1"> <property name="toolTip">
<item> <string>Performs checks only (no fixing).
<widget class="QRadioButton" name="RB_Check">
<property name="toolTip">
<string>Performs checks only (no fixing).
Writes diagnostics into the output file. Writes diagnostics into the output file.
Default is to fix with two passes.</string> Default is to fix with two passes.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Only checking</string> <string>Only checking</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QRadioButton" name="RB_Fix1"> <widget class="QRadioButton" name="RB_Fix1">
<property name="toolTip"> <property name="toolTip">
<string>Analyses and fixes mesh with only the first stage of the cleaning procedure. <string>Analyses and fixes mesh with only the first stage of the cleaning procedure.
Does not write diagnostics into the output file. Does not write diagnostics into the output file.
Default is to fix with two passes.</string> Default is to fix with two passes.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Fix problems with one pass</string> <string>Fix problems</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QRadioButton" name="RB_Fix2"> <widget class="QCheckBox" name="CB_PreserveTopology">
<property name="toolTip"> <property name="toolTip">
<string>Analyses and fixes mesh with the two stage cleaning procedure. <string>Disables fixing operations which induce topology modifications.
Does not write diagnostics into the output file.
Default is to fix with two passes.</string>
</property>
<property name="text">
<string>Fix problems with two passes</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="CB_PreserveTopology">
<property name="toolTip">
<string>Disables fixing operations which induce topology modifications.
Default is enable topology modifications. Default is enable topology modifications.
(argument --topology)</string> (argument --topology)</string>
</property> </property>
<property name="text"> <property name="text">
<string>Preserve topology</string> <string>Preserve topology</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="CB_FillHoles"> <widget class="QCheckBox" name="CB_FillHoles">
<property name="toolTip"> <property name="toolTip">
<string>Default is not to fill holes. <string>Default is not to fill holes.
if set: see 'surface size threshold of holes' in 'Advanced remeshing options'.</string> if set: see 'surface size threshold of holes' in 'Advanced remeshing options'.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Fill holes</string> <string>Fill holes</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="CB_RemeshPlanes">
<widget class="QCheckBox" name="CB_RemeshPlanes"> <property name="toolTip">
<property name="toolTip"> <string>Inserts vertices on planes to improve mesh quality .
<string>Inserts vertices on planes to improve mesh quality .
May be useful for poor quality triangulations (eg .STL or .DXF triangulations). May be useful for poor quality triangulations (eg .STL or .DXF triangulations).
Default is not to mesh planes.</string> Default is not to mesh planes.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Remesh planes</string> <string>Remesh planes</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item>
</item> </layout>
</layout>
</widget> </widget>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="geometry"> <property name="geometry">
@ -411,8 +387,10 @@ Default is not to mesh planes.</string>
<property name="title"> <property name="title">
<string>You can control</string> <string>You can control</string>
</property> </property>
#1
<widget class="QLineEdit" name="SP_MinHoleSize"> <widget class="QLineEdit" name="SP_MinHoleSize">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>20</x> <x>20</x>
@ -421,9 +399,6 @@ Default is not to mesh planes.</string>
<height>25</height> <height>25</height>
</rect> </rect>
</property> </property>
<property name="enabled">
<bool>false</bool>
</property>
</widget> </widget>
<widget class="QLabel" name="LA_minHoleSize"> <widget class="QLabel" name="LA_minHoleSize">
<property name="geometry"> <property name="geometry">
@ -442,8 +417,10 @@ Set 'Fill holes' in 'Simple Remeshing Options'.</string>
<string>Surface size threshold of holes to fill (--min_hole_size)</string> <string>Surface size threshold of holes to fill (--min_hole_size)</string>
</property> </property>
</widget> </widget>
#2
<widget class="QLineEdit" name="SP_ToleranceDisplacement"> <widget class="QLineEdit" name="SP_ToleranceDisplacement">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>20</x> <x>20</x>
@ -452,9 +429,6 @@ Set 'Fill holes' in 'Simple Remeshing Options'.</string>
<height>25</height> <height>25</height>
</rect> </rect>
</property> </property>
<property name="enabled">
<bool>false</bool>
</property>
</widget> </widget>
<widget class="QLabel" name="LA_toleranceDisplacement"> <widget class="QLabel" name="LA_toleranceDisplacement">
<property name="geometry"> <property name="geometry">
@ -475,8 +449,7 @@ Unused in collision resolution .
(--tolerance_displacement)</string> (--tolerance_displacement)</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="CB_ComputedToleranceDisplacement">
<widget class="QCheckBox" name="CB_ComputedToleranceDisplacement">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>650</x> <x>650</x>
@ -485,19 +458,20 @@ Unused in collision resolution .
<height>30</height> <height>30</height>
</rect> </rect>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>If set default value is computed from model.</string> <string>If set default value is computed from model.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Computed</string> <string>Computed</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
#3
<widget class="QLineEdit" name="SP_ResolutionLength"> <widget class="QLineEdit" name="SP_ResolutionLength">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>20</x> <x>20</x>
@ -506,9 +480,6 @@ Unused in collision resolution .
<height>25</height> <height>25</height>
</rect> </rect>
</property> </property>
<property name="enabled">
<bool>false</bool>
</property>
</widget> </widget>
<widget class="QLabel" name="LA_resolutionLength"> <widget class="QLabel" name="LA_resolutionLength">
<property name="geometry"> <property name="geometry">
@ -528,7 +499,7 @@ Default is computed from model.</string>
<string>Distance threshold for two points distinct (--resolution_length)</string> <string>Distance threshold for two points distinct (--resolution_length)</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="CB_ComputedResolutionLength"> <widget class="QCheckBox" name="CB_ComputedResolutionLength">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>650</x> <x>650</x>
@ -537,17 +508,16 @@ Default is computed from model.</string>
<height>30</height> <height>30</height>
</rect> </rect>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>If set default value is computed from model.</string> <string>If set default value is computed from model.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Computed</string> <string>Computed</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
#4
<widget class="QDoubleSpinBox" name="SP_FoldingAngle"> <widget class="QDoubleSpinBox" name="SP_FoldingAngle">
<property name="geometry"> <property name="geometry">
<rect> <rect>
@ -557,17 +527,17 @@ Default is computed from model.</string>
<height>25</height> <height>25</height>
</rect> </rect>
</property> </property>
<property name="maximum">
<double>90</double>
</property>
<property name="minimum"> <property name="minimum">
<double>0</double> <double>0.000000000000000</double>
</property>
<property name="maximum">
<double>90.000000000000000</double>
</property> </property>
<property name="singleStep"> <property name="singleStep">
<double>1</double> <double>1.000000000000000</double>
</property> </property>
<property name="value"> <property name="value">
<double>15</double> <double>15.000000000000000</double>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="LA_foldingAngle"> <widget class="QLabel" name="LA_foldingAngle">
@ -589,8 +559,10 @@ Default is 15 degrees.</string>
<string>Angle threshold for two connected triangles overlapping (--folding_angle)</string> <string>Angle threshold for two connected triangles overlapping (--folding_angle)</string>
</property> </property>
</widget> </widget>
#5
<widget class="QLineEdit" name="SP_OverlapDistance"> <widget class="QLineEdit" name="SP_OverlapDistance">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>20</x> <x>20</x>
@ -599,9 +571,6 @@ Default is 15 degrees.</string>
<height>25</height> <height>25</height>
</rect> </rect>
</property> </property>
<property name="enabled">
<bool>false</bool>
</property>
</widget> </widget>
<widget class="QLabel" name="LA_overlapDistance"> <widget class="QLabel" name="LA_overlapDistance">
<property name="geometry"> <property name="geometry">
@ -622,7 +591,7 @@ Default is computed from model.</string>
(--overlap_distance)</string> (--overlap_distance)</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="CB_ComputedOverlapDistance"> <widget class="QCheckBox" name="CB_ComputedOverlapDistance">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>650</x> <x>650</x>
@ -631,17 +600,16 @@ Default is computed from model.</string>
<height>30</height> <height>30</height>
</rect> </rect>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>If set default value is computed from model.</string> <string>If set default value is computed from model.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Computed</string> <string>Computed</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
#6
<widget class="QDoubleSpinBox" name="SP_OverlapAngle"> <widget class="QDoubleSpinBox" name="SP_OverlapAngle">
<property name="geometry"> <property name="geometry">
<rect> <rect>
@ -651,17 +619,17 @@ Default is computed from model.</string>
<height>25</height> <height>25</height>
</rect> </rect>
</property> </property>
<property name="maximum">
<double>90</double>
</property>
<property name="minimum"> <property name="minimum">
<double>0</double> <double>0.000000000000000</double>
</property>
<property name="maximum">
<double>90.000000000000000</double>
</property> </property>
<property name="singleStep"> <property name="singleStep">
<double>1</double> <double>1.000000000000000</double>
</property> </property>
<property name="value"> <property name="value">
<double>15</double> <double>15.000000000000000</double>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="LA_overlapAngle"> <widget class="QLabel" name="LA_overlapAngle">
@ -700,8 +668,7 @@ Default is 15 degrees.</string>
<property name="title"> <property name="title">
<string>MGCleaner Generic Options</string> <string>MGCleaner Generic Options</string>
</property> </property>
<widget class="QSpinBox" name="SP_Verbosity">
<widget class="QSpinBox" name="SP_Verbosity">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>20</x> <x>20</x>
@ -710,15 +677,14 @@ Default is 15 degrees.</string>
<height>25</height> <height>25</height>
</rect> </rect>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>10</number> <number>10</number>
</property> </property>
<property name="value"> <property name="value">
<number>3</number> <number>3</number>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="label">
<widget class="QLabel" name="label">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>130</x> <x>130</x>
@ -732,12 +698,10 @@ Default is 15 degrees.</string>
From 0 (no detail) to 10 (very detailed). From 0 (no detail) to 10 (very detailed).
Default is 3.</string> Default is 3.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Verbosity level</string> <string>Verbosity level</string>
</property> </property>
</widget> </widget>
</widget> </widget>
<widget class="QGroupBox" name="groupBox_6"> <widget class="QGroupBox" name="groupBox_6">
<property name="geometry"> <property name="geometry">
@ -787,8 +751,7 @@ Default is 3.</string>
</rect> </rect>
</property> </property>
</widget> </widget>
<widget class="QPushButton" name="PB_Save">
<widget class="QPushButton" name="PB_Save">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>20</x> <x>20</x>
@ -797,18 +760,17 @@ Default is 3.</string>
<height>31</height> <height>31</height>
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
<string>Save</string> <string>Save</string>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
<width>18</width> <width>18</width>
<height>18</height> <height>18</height>
</size> </size>
</property> </property>
</widget> </widget>
<widget class="QPushButton" name="PB_Load">
<widget class="QPushButton" name="PB_Load">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>120</x> <x>120</x>
@ -817,17 +779,16 @@ Default is 3.</string>
<height>31</height> <height>31</height>
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
<string>Load</string> <string>Load</string>
</property> </property>
<property name="iconSize"> <property name="iconSize">
<size> <size>
<width>18</width> <width>18</width>
<height>18</height> <height>18</height>
</size> </size>
</property> </property>
</widget> </widget>
</widget> </widget>
</widget> </widget>
</widget> </widget>

View File

@ -50,7 +50,7 @@ def MeshCut(context):
infile = fd.selectedFiles()[0] infile = fd.selectedFiles()[0]
self.ui.le_origMeshFile.setText(infile) self.ui.le_origMeshFile.setText(infile)
insplit = os.path.splitext(str(infile).encode()) insplit = os.path.splitext(str(infile).encode())
outfile = insplit[0] + '_cut' + insplit[1] outfile = insplit[0] + '_cut'.encode() + insplit[1]
self.ui.le_cutMeshFile.setText(outfile) self.ui.le_cutMeshFile.setText(outfile)
pass pass

View File

@ -522,7 +522,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
self.commande+= " -O G" # This option has not been updated to the new option style yet self.commande+= " -O G" # This option has not been updated to the new option style yet
deb=os.path.splitext(self.fichierIn) deb=os.path.splitext(self.fichierIn)
self.fichierOut=deb[0] + "_output.mesh" self.fichierOut=deb[0].decode() + "_output.mesh"
tolerance=self.SP_toStr(self.SP_Tolerance) tolerance=self.SP_toStr(self.SP_Tolerance)
if not self.RB_Absolute.isChecked(): if not self.RB_Absolute.isChecked():
@ -540,7 +540,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
if self.SP_Memory.value() != 0 : self.commande+=" --max_memory %d" %self.SP_Memory.value() if self.SP_Memory.value() != 0 : self.commande+=" --max_memory %d" %self.SP_Memory.value()
if self.SP_Verbosity.value() != 3 : self.commande+=" --verbose %d" %self.SP_Verbosity.value() if self.SP_Verbosity.value() != 3 : self.commande+=" --verbose %d" %self.SP_Verbosity.value()
self.commande+=" --in " + self.fichierIn self.commande+=" --in " + self.fichierIn.decode()
self.commande+=" --out " + self.fichierOut self.commande+=" --out " + self.fichierOut
print(self.commande) print(self.commande)

View File

@ -10,7 +10,7 @@ from .orderEdgesFromWire import orderEdgesFromWire
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# --- prolongation d'un wire par deux segments tangents # --- prolongation d'un wire par deux segments tangents
def prolongeWire(aWire, extrem, norms, long): def prolongeWire(aWire, extrem, norms, lg):
""" """
""" """
logging.info("start") logging.info("start")
@ -22,7 +22,7 @@ def prolongeWire(aWire, extrem, norms, long):
uneSeuleEdge = True uneSeuleEdge = True
edgesBout = [] edgesBout = []
for i, v1 in enumerate(extrem): for i, v1 in enumerate(extrem):
exts = [geompy.MakeTranslationVectorDistance(v1, norms[i], l) for l in (-int, int)] exts = [geompy.MakeTranslationVectorDistance(v1, norms[i], l) for l in (-lg, lg)]
dists = [(geompy.MinDistance(v, aWire), i , v) for i, v in enumerate(exts)] dists = [(geompy.MinDistance(v, aWire), i , v) for i, v in enumerate(exts)]
dists.sort() dists.sort()
v2 = dists[-1][-1] v2 = dists[-1][-1]