We set it to off by default in Salome so that the cleanup is done only if the user explicitly asks to.
Otherwise, this option is on by default when calling CADSurf.
\image html blsurf_parameters_advanced.png
-- <b>PreCAD options</b> -if checked, the PreCAD module will be used. This module has
-two main goals:
+- <b>CAD preprocessor options</b>. The CAD preprocessor (formerly known as PreCAD) has two main goals:
- Complete missing or inadequate CAD descriptions.
- Perform topology reconstruction and specific geometry
enhancement for mesh generation.
- \n This module requires a specific licence. The following PreCAD
- options are the most significant and important ones:
+ \n The following preprocessor options are the most significant and important ones.
+ All options are unchecked by default. No cleanup is made by default so that the mesh matches the shape.
+ If the user has a bad shape (e.g. imported shape), he can activate some options to improve the mesh.
- - <b>Merge Edges</b> - allows PreCAD to optimize the geometry by merging some
- edges. This option is checked by default.
+ - <b>Merge Edges</b> - optimize the geometry by merging some
+ edges. This option is unchecked by default.
- - <b>Process 3D topology</b> - allows PreCAD to perform the cleanup processing.
- This option is checked by default.
+ - <b>Remove tiny UV edges</b> - optimize the geometry by removing small
+ tiny edges on the UV face. This option is unchecked by default.
- - <b>Discard input topology</b> - computes the CAD topology from scratch,
+ - <b>Process 3D topology</b> - perform the cleanup processing.
+ This option is unchecked by default.
+
+ - <b>Discard input topology</b> - compute the CAD topology from scratch,
without considering the topological information contained in the original CAD
(useful for iges files). This option is unchecked by default.
+ - <b>Remove duplicate CAD faces</b> - optimize the geometry by merging the
+ duplicate CAD faces. This option is unchecked by default.
+
- <b>Verbosity level</b> - defines the percentage of "verbosity" of
-MeshGems-CADSurf and MeshGems-PreCAD [0-10].
+MeshGems-CADSurf [0-10].
- <b>ExportGMF</b> - saves the computed mesh into a GMF file (.mesh or .meshb).
the local mesh quality, without taking into account the tags (attributes) specifications.
By default this option is 0.
-- \b remove_duplicate_cad_faces (bool) - Defines the behavior of MeshGems-PreCAD regarding the duplicate
-CAD faces. By default, MG-PreCAD merges the duplicate CAD faces. This behavior can be deactivated by using this option.
-By default this option is 1.
-
- \b tiny_edge_avoid_surface_intersections (bool) - This option defines the priority between the tiny feature
suppression and the surface intersection prevention. By default, MeshGems-CADSurf gives the priority
to the surface intersection prevention rather than to tiny edge or bad surface element removal. These
void SetPreCADMergeEdges(in boolean toMergeEdges);
boolean GetPreCADMergeEdges();
+ /*!
+ * To remove tiny UV edges edges.
+ */
+ void SetPreCADRemoveTinyUVEdges(in boolean toRemoveTinyUVEdges);
+ boolean GetPreCADRemoveTinyUVEdges();
+
/*!
* To remove duplicate CAD faces.
*/
## To optimize merges edges.
# @param toMergeEdges "merge edges" flag value
def SetPreCADMergeEdges(self, toMergeEdges=False):
- if self.Parameters().GetTopology() != PreCAD:
- self.SetTopology(PreCAD)
self.Parameters().SetPreCADMergeEdges(toMergeEdges)
pass
+ ## To remove tiny UV edges.
+ # @param toRemoveTinyUVEdges "remove_tiny_uv_edges" flag value
+ def SetPreCADRemoveTinyUVEdges(self, toRemoveTinyUVEdges=False):
+ self.Parameters().SetPreCADRemoveTinyUVEdges(toRemoveTinyUVEdges)
+ pass
+
## To remove duplicate CAD Faces
- # @param toRemoveDuplicateCADFaces "merge edges" flag value
+ # @param toRemoveDuplicateCADFaces "remove_duplicate_cad_faces" flag value
def SetPreCADRemoveDuplicateCADFaces(self, toRemoveDuplicateCADFaces=False):
- if self.Parameters().GetTopology() != PreCAD:
- self.SetTopology(PreCAD)
self.Parameters().SetPreCADRemoveDuplicateCADFaces(toRemoveDuplicateCADFaces)
pass
## To process 3D topology.
# @param toProcess "PreCAD process 3D" flag value
def SetPreCADProcess3DTopology(self, toProcess=False):
- if self.Parameters().GetTopology() != PreCAD:
- self.SetTopology(PreCAD)
self.Parameters().SetPreCADProcess3DTopology(toProcess)
pass
## To compute topology from scratch
# @param toDiscardInput "discard input" flag value
def SetPreCADDiscardInput(self, toDiscardInput=False):
- if self.Parameters().GetTopology() != PreCAD:
- self.SetTopology(PreCAD)
self.Parameters().SetPreCADDiscardInput(toDiscardInput)
pass
# @param optionName name of the option
# @param optionValue value of the option
def SetPreCADOptionValue(self, optionName, optionValue):
- if self.Parameters().GetTopology() != PreCAD:
- self.SetTopology(PreCAD)
self.Parameters().SetPreCADOptionValue(optionName,optionValue)
pass
# @param optionName custom name of the option
# @param optionValue value of the option
def AddPreCADOption(self, optionName, optionValue):
- if self.Parameters().GetTopology() != PreCAD:
- self.SetTopology(PreCAD)
self.Parameters().AddPreCADOption(optionName,optionValue)
pass
// PreCAD
int _precadMergeEdges = BLSURFPlugin_Hypothesis::GetDefaultPreCADMergeEdges();
+ int _precadRemoveTinyUVEdges = BLSURFPlugin_Hypothesis::GetDefaultPreCADRemoveTinyUVEdges();
int _precadRemoveDuplicateCADFaces = BLSURFPlugin_Hypothesis::GetDefaultPreCADRemoveDuplicateCADFaces();
int _precadProcess3DTopology = BLSURFPlugin_Hypothesis::GetDefaultPreCADProcess3DTopology();
int _precadDiscardInput = BLSURFPlugin_Hypothesis::GetDefaultPreCADDiscardInput();
_topology = (int) hyp->GetTopology();
// PreCAD
_precadMergeEdges = hyp->GetPreCADMergeEdges();
+ _precadRemoveTinyUVEdges = hyp->GetPreCADRemoveTinyUVEdges();
_precadRemoveDuplicateCADFaces = hyp->GetPreCADRemoveDuplicateCADFaces();
_precadProcess3DTopology = hyp->GetPreCADProcess3DTopology();
_precadDiscardInput = hyp->GetPreCADDiscardInput();
// PreProcessor (formerly PreCAD)
set_param(css, "merge_edges", _precadMergeEdges ? "yes" : "no");
+ set_param(css, "remove_tiny_uv_edges", _precadRemoveTinyUVEdges ? "yes" : "no");
set_param(css, "remove_duplicate_cad_faces", _precadRemoveDuplicateCADFaces ? "yes" : "no");
set_param(css, "process_3d_topology", _precadProcess3DTopology ? "1" : "0");
set_param(css, "discard_input_topology", _precadDiscardInput ? "1" : "0");
_verb(GetDefaultVerbosity()),
_topology(GetDefaultTopology()),
_preCADMergeEdges(GetDefaultPreCADMergeEdges()),
+ _preCADRemoveTinyUVEdges(GetDefaultPreCADRemoveTinyUVEdges()),
_preCADRemoveDuplicateCADFaces(GetDefaultPreCADRemoveDuplicateCADFaces()),
_preCADProcess3DTopology(GetDefaultPreCADProcess3DTopology()),
_preCADDiscardInput(GetDefaultPreCADDiscardInput()),
"rectify_jacobian", // default = 1
"respect_geometry", // default = 1
"optimise_tiny_edges", // default = 0
- "remove_duplicate_cad_faces", // default = 1
"tiny_edge_avoid_surface_intersections", // default = 1
"tiny_edge_respect_geometry", // default = 0
"" // mark of end
}
}
+//=============================================================================
+void BLSURFPlugin_Hypothesis::SetPreCADRemoveTinyUVEdges(bool theVal) {
+ if (theVal != _preCADRemoveTinyUVEdges) {
+// SetTopology(PreCAD);
+ _preCADRemoveTinyUVEdges = theVal;
+ NotifySubMeshesHypothesisModification();
+ }
+}
+
//=============================================================================
void BLSURFPlugin_Hypothesis::SetPreCADRemoveDuplicateCADFaces(bool theVal) {
if (theVal != _preCADRemoveDuplicateCADFaces) {
save << " " << (int) _phySizeRel << " " << (int) _minSizeRel << " " << (int) _maxSizeRel << " " << _chordalError ;
save << " " << (int) _anisotropic << " " << _anisotropicRatio << " " << (int) _removeTinyEdges << " " << _tinyEdgeLength ;
save << " " << (int) _badElementRemoval << " " << _badElementAspectRatio << " " << (int) _optimizeMesh << " " << (int) _quadraticMesh ;
- save << " " << (int) _preCADProcess3DTopology << " " << (int) _preCADRemoveDuplicateCADFaces;
+ save << " " << (int) _preCADProcess3DTopology << " " << (int) _preCADRemoveDuplicateCADFaces << " " << (int) _preCADRemoveTinyUVEdges;
op_val = _option2value.begin();
if (op_val != _option2value.end()) {
else
load.clear(std::ios::badbit | load.rdstate());
+ isOK = static_cast<bool>(load >> i);
+ if (isOK)
+ _preCADRemoveTinyUVEdges = (bool) i;
+ else
+ load.clear(std::ios::badbit | load.rdstate());
+
}
void SetPreCADMergeEdges(bool theVal);
bool GetPreCADMergeEdges() const { return _preCADMergeEdges; }
+ void SetPreCADRemoveTinyUVEdges(bool theVal);
+ bool GetPreCADRemoveTinyUVEdges() const { return _preCADRemoveTinyUVEdges; }
+
void SetPreCADRemoveDuplicateCADFaces(bool theVal);
bool GetPreCADRemoveDuplicateCADFaces() const { return _preCADRemoveDuplicateCADFaces; }
static Topology GetDefaultTopology() { return FromCAD; }
// PreCAD
static bool GetDefaultPreCADMergeEdges() { return false; }
+ static bool GetDefaultPreCADRemoveTinyUVEdges() { return false; }
static bool GetDefaultPreCADRemoveDuplicateCADFaces() { return false; }
static bool GetDefaultPreCADProcess3DTopology() { return false; }
static bool GetDefaultPreCADDiscardInput() { return false; }
Topology _topology;
bool _preCADMergeEdges;
+ bool _preCADRemoveTinyUVEdges;
bool _preCADRemoveDuplicateCADFaces;
bool _preCADProcess3DTopology;
bool _preCADDiscardInput;
return this->GetImpl()->GetPreCADMergeEdges();
}
+//=============================================================================
+/*!
+ * BLSURFPlugin_Hypothesis_i::SetPreCADRemoveTinyUVEdges
+ *
+ * Set true or false
+ */
+//=============================================================================
+void BLSURFPlugin_Hypothesis_i::SetPreCADRemoveTinyUVEdges(CORBA::Boolean theValue) {
+ // MESSAGE("BLSURFPlugin_Hypothesis_i::SetPreCADRemoveTinyUVEdges");
+ ASSERT(myBaseImpl);
+ this->GetImpl()->SetPreCADRemoveTinyUVEdges(theValue);
+ std::string theValueStr = theValue ? "True" : "False";
+ SMESH::TPythonDump() << _this() << ".SetPreCADRemoveTinyUVEdges( " << theValueStr.c_str() << " )";
+}
+
+//=============================================================================
+/*!
+ * BLSURFPlugin_Hypothesis_i::GetPreCADRemoveTinyUVEdges
+ *
+ * Get true or false
+ */
+//=============================================================================
+CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADRemoveTinyUVEdges() {
+ // MESSAGE("BLSURFPlugin_Hypothesis_i::GetPreCADRemoveTinyUVEdges");
+ ASSERT(myBaseImpl);
+ return this->GetImpl()->GetPreCADRemoveTinyUVEdges();
+}
+
//=============================================================================
/*!
* BLSURFPlugin_Hypothesis_i::SetPreCADRemoveDuplicateCADFaces
void SetPreCADMergeEdges(CORBA::Boolean theValue);
CORBA::Boolean GetPreCADMergeEdges();
+ void SetPreCADRemoveTinyUVEdges(CORBA::Boolean theValue);
+ CORBA::Boolean GetPreCADRemoveTinyUVEdges();
+
void SetPreCADRemoveDuplicateCADFaces(CORBA::Boolean theValue);
CORBA::Boolean GetPreCADRemoveDuplicateCADFaces();
</property>
</widget>
</item>
- <item row="1" column="0">
+ <item row="1" column="0" colspan="2">
+ <widget class="QCheckBox" name="myPreCADRemoveTinyUVEdges">
+ <property name="text">
+ <string>BLSURF_PRECAD_REMOVE_TINY_UV_EDGES</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
<widget class="QCheckBox" name="myPreCADProcess3DTopology">
<property name="text">
<string>BLSURF_PRECAD_PROCESS_3D_TOPOLOGY</string>
</property>
</widget>
</item>
- <item row="2" column="0" colspan="2">
+ <item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="myPreCADDiscardInput">
<property name="text">
<string>BLSURF_PRECAD_DISCARD_INPUT</string>
</property>
</widget>
</item>
- <item row="3" column="0" colspan="2">
+ <item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="myPreCADRemoveDuplicateCADFaces">
<property name="text">
<string>BLSURF_PRECAD_REMOVE_DUPLICATE_CAD_FACES</string>
<tabstop>rmBtn</tabstop>
<tabstop>myPreCADGroupBox</tabstop>
<tabstop>myPreCADMergeEdges</tabstop>
+ <tabstop>myPreCADRemoveTinyUVEdges</tabstop>
<tabstop>myPreCADRemoveDuplicateCADFaces</tabstop>
<tabstop>myPreCADProcess3DTopology</tabstop>
<tabstop>myPreCADDiscardInput</tabstop>
myAdvWidget->myVerbosity->setValue( data.myVerbosity );
myAdvWidget->myPreCADGroupBox->setChecked(data.myTopology == PreCAD);
myAdvWidget->myPreCADMergeEdges->setChecked( data.myPreCADMergeEdges );
+ myAdvWidget->myPreCADRemoveTinyUVEdges->setChecked( data.myPreCADRemoveTinyUVEdges );
myAdvWidget->myPreCADRemoveDuplicateCADFaces->setChecked( data.myPreCADRemoveDuplicateCADFaces );
myAdvWidget->myPreCADProcess3DTopology->setChecked( data.myPreCADProcess3DTopology );
myAdvWidget->myPreCADDiscardInput->setChecked( data.myPreCADDiscardInput );
h_data.myVerbosity = h->GetVerbosity();
h_data.myTopology = (int) h->GetTopology();
h_data.myPreCADMergeEdges = h->GetPreCADMergeEdges();
+ h_data.myPreCADRemoveTinyUVEdges = h->GetPreCADRemoveTinyUVEdges();
h_data.myPreCADRemoveDuplicateCADFaces = h->GetPreCADRemoveDuplicateCADFaces();
h_data.myPreCADProcess3DTopology = h->GetPreCADProcess3DTopology();
h_data.myPreCADDiscardInput = h->GetPreCADDiscardInput();
h->SetTopology( (int) h_data.myTopology );
if ( h->GetPreCADMergeEdges() != h_data.myPreCADMergeEdges )
h->SetPreCADMergeEdges( h_data.myPreCADMergeEdges );
+ if ( h->GetPreCADRemoveTinyUVEdges() != h_data.myPreCADRemoveTinyUVEdges )
+ h->SetPreCADRemoveTinyUVEdges( h_data.myPreCADRemoveTinyUVEdges );
if ( h->GetPreCADRemoveDuplicateCADFaces() != h_data.myPreCADRemoveDuplicateCADFaces )
h->SetPreCADRemoveDuplicateCADFaces( h_data.myPreCADRemoveDuplicateCADFaces );
if ( h->GetPreCADProcess3DTopology() != h_data.myPreCADProcess3DTopology )
h_data.myVerbosity = myAdvWidget->myVerbosity->value();
h_data.myTopology = myAdvWidget->myPreCADGroupBox->isChecked() ? PreCAD : FromCAD;
h_data.myPreCADMergeEdges = myAdvWidget->myPreCADMergeEdges->isChecked();
+ h_data.myPreCADRemoveTinyUVEdges = myAdvWidget->myPreCADRemoveTinyUVEdges->isChecked();
h_data.myPreCADRemoveDuplicateCADFaces = myAdvWidget->myPreCADRemoveDuplicateCADFaces->isChecked();
h_data.myPreCADProcess3DTopology = myAdvWidget->myPreCADProcess3DTopology->isChecked();
h_data.myPreCADDiscardInput = myAdvWidget->myPreCADDiscardInput->isChecked();
guiHyp += tr("BLSURF_TOPOLOGY") + " = " + QString::number( h_data.myTopology ) + "; ";
guiHyp += tr("BLSURF_PRECAD_MERGE_EDGES") + " = " + QString(h_data.myPreCADMergeEdges ? "yes" : "no") + "; ";
+ guiHyp += tr("BLSURF_PRECAD_REMOVE_TINY_UV_EDGES") + " = " + QString(h_data.myPreCADRemoveTinyUVEdges ? "yes" : "no") + "; ";
guiHyp += tr("BLSURF_PRECAD_REMOVE_DUPLICATE_CAD_FACES") + " = " + QString(h_data.myPreCADRemoveDuplicateCADFaces ? "yes" : "no") + "; ";
guiHyp += tr("BLSURF_PRECAD_REMOVE_NANO_EDGES") + " = " + QString(h_data.myPreCADProcess3DTopology ? "yes" : "no") + "; ";
guiHyp += tr("BLSURF_PRECAD_DISCARD_INPUT") + " = " + QString(h_data.myPreCADDiscardInput ? "yes" : "no") + "; ";
double myAnisotropicRatio, myTinyEdgeLength, myBadElementAspectRatio;
bool myOptimizeMesh, myQuadraticMesh;
bool myAllowQuadrangles, mySmpsurface,mySmpedge,mySmppoint,myEnforcedVertex,myInternalEnforcedVerticesAllFaces;
- bool myPreCADMergeEdges, myPreCADRemoveDuplicateCADFaces, myPreCADProcess3DTopology, myPreCADDiscardInput;
+ bool myPreCADMergeEdges, myPreCADRemoveTinyUVEdges, myPreCADRemoveDuplicateCADFaces, myPreCADProcess3DTopology, myPreCADDiscardInput;
// bool myGMFFileMode;
std::string myGMFFileName, myInternalEnforcedVerticesAllFacesGroup;
TEnfVertexList enfVertexList;
</message>
<message>
<source>BLSURF_PRECAD_GROUP</source>
- <translation>PreCAD options</translation>
+ <translation>CAD preprocessor options</translation>
</message>
<message>
<source>BLSURF_PRECAD_MERGE_EDGES</source>
<translation>Merge edges</translation>
</message>
+ <message>
+ <source>BLSURF_PRECAD_REMOVE_TINY_UV_EDGES</source>
+ <translation>Remove tiny UV edges</translation>
+ </message>
<message>
<source>BLSURF_PRECAD_REMOVE_DUPLICATE_CAD_FACES</source>
<translation>Remove duplicate CAD Faces</translation>
</message>
<message>
<source>BLSURF_PRECAD_GROUP</source>
- <translation>Options PreCAD</translation>
+ <translation>Options du préprocesseur CAO</translation>
</message>
<message>
<source>BLSURF_PRECAD_MERGE_EDGES</source>
<translation>Fusionner des arêtes</translation>
</message>
+ <message>
+ <source>BLSURF_PRECAD_REMOVE_TINY_UV_EDGES</source>
+ <translation>Supprime les petites arêtes UV</translation>
+ </message>
<message>
<source>BLSURF_PRECAD_REMOVE_DUPLICATE_CAD_FACES</source>
<translation>Supprime les faces CAO en double</translation>
test_enforced_internal_vertex.py
test_enforced_vertex.py
test_periodicity_2D_precad.py
- test_periodicity_2D.py
test_periodicity_precad.py
- test_periodicity.py
test_periodicity_reflexion_2D_precad.py
- test_periodicity_reflexion_2D.py
test_periodicity_reflexion_precad.py
- test_periodicity_reflexion.py
test_periodicity_with_points_2D_precad.py
test_precad_intersections.py
test_sphere.py