diff --git a/src/Tools/YamsPlug/YamsPlugDialog.ui b/src/Tools/YamsPlug/YamsPlugDialog.ui
index 2679f857e..1afc115ac 100644
--- a/src/Tools/YamsPlug/YamsPlugDialog.ui
+++ b/src/Tools/YamsPlug/YamsPlugDialog.ui
@@ -243,7 +243,7 @@ resulting mesh.
This option modifies the geometry.
- Smoothing (S)
+ Sandpapering (S)
false
@@ -323,19 +323,40 @@ good quality elements
10
420
- 300
+ 750
70
-
- Units
+
+ This parameter enables the user to bound the maximal chordal deviation allowed,
+that is the maximal distance allowed between the detected curve and the plane P
+of the corresponding mesh face.
+In other words, it avoids having faces too far away from the curve they should represent.
+
+ Chordal deviation Tolerance
+
+
+
+
+ 40
+ 30
+ 110
+ 24
+
+
+
+ If the Units parameter is relative, epsilon max correspond to (per thousand) s*Tolerance/1000, where s is the size of the bounding box of the domain.
+If the Units parameter is absolute, the tolerance parameter is expressed in model units:
+ if P=2 and point coordinates are given in millimeters, the maximal chordal deviation is 2 mm.
+
+
- 10
+ 220
30
- 110
+ 120
24
@@ -343,7 +364,7 @@ good quality elements
Values are expressed in the model units.
- Absolute
+ Absolute units
false
@@ -352,74 +373,23 @@ good quality elements
- 160
+ 350
30
- 110
+ 120
24
- Values are relative to the bounding box size.
+ Values are relative (per thousand) to the bounding box size.
- Relative
+ Relative units
true
-
-
-
- 410
- 420
- 351
- 71
-
-
-
- This parameter enables the user to bound the maximal chordal deviation allowed,
-that is the maximal distance allowed between the detected curve
-and the plane P of the corresponding mesh face.
-In other words, it avoids having faces too far away from the curve they should represent.
-
-
- Chordal deviation Tolerance
-
-
-
-
- 40
- 30
- 81
- 23
-
-
-
-
- PreferDefault
-
-
-
- true
-
-
- If the Units parameter is relative, epsilon max correspond to 0.0001*s*Tolerance, where s is the size of the bounding box of the domain.
-If the Units parameter is absolute, the tolerance parameter is expressed in model units:
- if P=2 and point coordinates are given in millimeters, the maximal chordal deviation is 2 mm.
-
-
- 100000.000000000000000
-
-
- 1.000000000000000
-
-
- 0.100000000000000
-
-
-
diff --git a/src/Tools/YamsPlug/monYamsPlugDialog.py b/src/Tools/YamsPlug/monYamsPlugDialog.py
index 1518ae9f5..6e6088c11 100644
--- a/src/Tools/YamsPlug/monYamsPlugDialog.py
+++ b/src/Tools/YamsPlug/monYamsPlugDialog.py
@@ -72,6 +72,14 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
self.LE_ParamsFile.setText(self.paramsFile)
self.LE_MeshFile.setText("")
self.LE_MeshSmesh.setText("")
+
+ v1=QDoubleValidator(self)
+ v1.setBottom(0.)
+ #v1.setTop(1000.) #per thousand... only if relative
+ v1.setDecimals(2)
+ self.SP_Tolerance.setValidator(v1)
+ self.SP_Tolerance.titleForWarning="Chordal Tolerance"
+
self.resize(800, 600)
self.clean()
@@ -215,16 +223,44 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
self.num+=1
return True
+ def SP_toStr(self, widget):
+ """only for a QLineEdit widget"""
+ #cr, pos=widget.validator().validate(res, 0) #n.b. "1,3" is acceptable !locale!
+ try:
+ val=float(widget.text())
+ except:
+ QMessageBox.warning(self, widget.titleForWarning, "float value is incorrect: '"+widget.text()+"'")
+ res=str(widget.validator().bottom())
+ widget.setProperty("text", res)
+ return res
+ valtest=widget.validator().bottom()
+ if valtest!=None:
+ if valvaltest:
+ QMessageBox.warning(self, widget.titleForWarning, "float value is over maximum: "+str(val)+" > "+str(valtest))
+ res=str(valtest)
+ widget.setProperty("text", res)
+ return res
+ return str(val)
+
def getResumeData(self, separator="\n"):
text=""
for RB in self.GBOptim.findChildren(QRadioButton,):
if RB.isChecked()==True:
text+="Optimisation="+RB.text()+separator
break
- for RB in self.GBUnit.findChildren(QRadioButton,):
- if RB.isChecked()==True:
- text+="Units="+RB.text()+separator
- text+="ChordalToleranceDeviation="+str(self.SP_Tolerance.value())+separator
+ if self.RB_Absolute.isChecked():
+ text+="Units=absolute"+separator
+ else:
+ text+="Units=relative"+separator
+ v=self.SP_toStr(self.SP_Tolerance)
+ text+="ChordalToleranceDeviation="+v+separator
text+="RidgeDetection="+str(self.CB_Ridge.isChecked())+separator
text+="SplitEdge="+str(self.CB_SplitEdge.isChecked())+separator
text+="PointSmoothing="+str(self.CB_Point.isChecked())+separator
@@ -254,7 +290,14 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
if RB.text()==value :
RB.setChecked(True)
break
- if tit=="ChordalToleranceDeviation": self.SP_Tolerance.setProperty("value", float(value))
+ if tit=="Units":
+ if value=="absolute":
+ self.RB_Absolute.setChecked(True)
+ self.RB_Relative.setChecked(False)
+ else:
+ self.RB_Absolute.setChecked(False)
+ self.RB_Relative.setChecked(True)
+ if tit=="ChordalToleranceDeviation": self.SP_Tolerance.setProperty("text", float(value))
if tit=="RidgeDetection": self.CB_Ridge.setChecked(value=="True")
if tit=="SplitEdge": self.CB_SplitEdge.setChecked(value=="True")
if tit=="PointSmoothing": self.CB_Point.setChecked(value=="True")
@@ -408,9 +451,11 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
self.commande+=" -Dabsolute"
else :
self.commande+=" -Drelative"
- self.commande+=",tolerance=%f"%self.SP_Tolerance.value()
- if self.CB_Ridge.isChecked()==False : self.commande+=",nr"
- if self.CB_Point.isChecked()==False : self.commande+=",ns"
+
+ v=self.SP_toStr(self.SP_Tolerance)
+ self.commande+=",tolerance="+v
+ if self.CB_Ridge.isChecked()==False : self.commande+=",-nr"
+ if self.CB_Point.isChecked()==False : self.commande+=",-ns"
if self.SP_Geomapp.value()!=0.04 : self.commande+=",geomapp=%f"%self.SP_Geomapp.value()
if self.SP_Ridge.value()!=45.0 : self.commande+=",ridge=%f"%self.SP_Ridge.value()
if self.SP_MaxSize.value()!=100 : self.commande+=",maxsize=%f"%self.SP_MaxSize.value()
@@ -433,7 +478,7 @@ class MonYamsPlugDialog(Ui_YamsPlugDialog,QWidget):
self.RB_1.setChecked(False)
self.RB_Absolute.setChecked(False)
self.RB_Relative.setChecked(True)
- self.SP_Tolerance.setProperty("value", 0.1)
+ self.SP_Tolerance.setProperty("text", "10.")
self.SP_Geomapp.setProperty("value", 0.04)
self.SP_Ridge.setProperty("value", 45.0)
self.SP_Gradation.setProperty("value", 1.3)