geompy.addToStudyInFather(Face_2,Wire_1, "Wire_1")
# create a mesh on the box
-blsurfMesh = smesh.Mesh(box,"box: BLSurf mesh")
+cadsurfMesh = smesh.Mesh(box,"box: MG-CADSurf mesh")
# create a BLSurf algorithm for faces
-algo2d = blsurfMesh.Triangle(algo=smeshBuilder.BLSURF)
+algo2d = cadsurfMesh.Triangle(algo=smeshBuilder.MG_CADSurf)
# ----------------------------------------------
# blsurf_construct_mesh_sizemaps Adding sizemaps
algo2d.SetSizeMap(Vertex_1, 'def f(): return 2' )
# compute the mesh
-blsurfMesh.Compute()
+cadsurfMesh.Compute()
# ----------------------------------------------------------------
# blsurf_construct_mesh_enforced_vertices Adding enforced vertices
print enfList
# compute the mesh
-blsurfMesh.Compute()
+cadsurfMesh.Compute()
# Remove an enforced vertex and print the list
algo2d.UnsetEnforcedVertex(Face_1, 50, 50, 50)
print enfList
# compute the mesh
-blsurfMesh.Compute()
+cadsurfMesh.Compute()
# Remove all enforced vertices defined on Face_1
algo2d.UnsetEnforcedVertices(Face_1)
# compute the mesh
-blsurfMesh.Compute()
+cadsurfMesh.Compute()
# ---------------------------------------------------
# blsurf_construct_mesh_attractor Adding an attractor
algo2d.SetGradation( 2.5 )
# compute the mesh
-blsurfMesh.Compute()
+cadsurfMesh.Compute()
# ---------------------------------------------------------------
# blsurf_construct_mesh_internal_vertices Using internal vertices
geompy.addToStudy( Multi_Translation_1, 'Multi-Translation_1' )
# The mesh on the geometry with internal vertices
-blsurfMesh_internal = smesh.Mesh(Multi_Translation_1, "blsurfMesh_internal")
-algo2d = blsurfMesh_internal.Triangle(algo=smeshBuilder.BLSURF)
+cadsurfMesh_internal = smesh.Mesh(Multi_Translation_1, "cadsurfMesh_internal")
+algo2d = cadsurfMesh_internal.Triangle(algo=smeshBuilder.MG_CADSurf)
algo2d.SetPhySize( 0.1 )
-# Allows BLSURF to take into account internal vertices
+# Allow MG-CADSURF to take into account internal vertices
algo2d.SetInternalEnforcedVertexAllFaces( True )
# Add the created nodes into a group
algo2d.SetInternalEnforcedVertexAllFacesGroup( "my group" )
# compute the mesh
-blsurfMesh_internal.Compute()
+cadsurfMesh_internal.Compute()
# End of script
Mesh = smesh.Mesh(part, "Mesh")
-algo2d = Mesh.Triangle(algo=smeshBuilder.BLSURF)
+algo2d = Mesh.Triangle(algo=smeshBuilder.MG_CADSurf)
algo2d.SetGeometricMesh( 1 )
algo2d.SetAngleMesh( 4 )
algo2d.SetPhySize( 8 )
Mesh = smesh.Mesh(part, "Mesh")
-algo2d = Mesh.Triangle(algo=smeshBuilder.BLSURF)
+algo2d = Mesh.Triangle(algo=smeshBuilder.MG_CADSurf)
algo2d.SetGeometricMesh( 1 )
algo2d.SetAngleMesh( 4 )
algo2d.SetPhySize( 8 )
Mesh = smesh.Mesh(part, "Mesh")
-algo2d = Mesh.Triangle(algo=smeshBuilder.BLSURF)
+algo2d = Mesh.Triangle(algo=smeshBuilder.MG_CADSurf)
algo2d.SetGeometricMesh( 1 )
algo2d.SetAngleMesh( 4 )
algo2d.SetPhySize( 8 )
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = "BLSURFPLUGIN Module Reference Manual v.@SALOMEBLSURFPLUGIN_VERSION@"
+PROJECT_NAME = "MG-CADSurf Module Reference Manual v.@SALOMEBLSURFPLUGIN_VERSION@"
OUTPUT_DIRECTORY = BLSURFPLUGIN
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = "SALOME BLSURFPLUGIN User's Guide"
+PROJECT_NAME = "SALOME MG-CADSurf plug-in User's Guide"
OUTPUT_DIRECTORY = BLSURFPLUGIN
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
/*!
-\page blsurf_hypo_page MG-CADSurf Parameters hypothesis (former BLSURF
-Parameters)
+\page blsurf_hypo_page MG-CADSurf Parameters hypothesis
\anchor blsurf_top
\subsection periodicity_tui_precad_usage TUI PreCAD usage
-The two methods to define periodicity with PreCAD are:
+The two methods to define periodicity with PreCAD are
+(the former name of <em>MG-CADSurf</em> is \a BLSURF and names
+of the corresponding classes and modules still include \a "BLSURF"):
- BLSURFPluginBuilder.BLSURF_Algorithm.AddPreCadFacesPeriodicity
- BLSURFPluginBuilder.BLSURF_Algorithm.AddPreCadEdgesPeriodicity
\page blsurfplugin_python_interface_page Python Interface
-Python package BLSURFPluginBuilder defines several classes, destined for creation of the 2D meshes.
+\note The former name of MG-CADSurf mesher is \a BLSURF and names
+of the corresponding classes and modules still include \a "BLSURF".
-BLSURF meshing plugin dynamically adds several methods to the smeshBuilder.Mesh to create meshing algorithms.
+Python package BLSURFPluginBuilder defines
+BLSURFPluginBuilder.BLSURF_Algorithm class providing access
+to the MG-CADSurf meshing algorithm and its parameters.
-Below you can see an example of usage of the BLSURFPluginBuilder Python API for mesh generation:
+You can get an instance of this class by calling
+smeshBuilder.Mesh.Triangle(algo=smeshBuilder.MG_CADSurf) or
+smeshBuilder.Mesh.Triangle(algo=smeshBuilder.BLSURF). This call
+creates an algorithm (if not yet exist), assigns it to the mesh and
+returns an instance of BLSURFPluginBuilder.BLSURF_Algorithm to the caller.
-\anchor tui_blsurf
+The class of algorithm has methods to set up meshing parameters.
+
+Below you can see examples of usage of this class for 2D mesh generation.
-\section blsurf_construct_mesh Construction of Mesh using MG-CADSurf
-(former BLSURF) algorithm
+\anchor tui_blsurf
\anchor example_BLSURFPlugin
<h2>Example of mesh generation with MG-CADSurf algorithm:</h2>
/*!
-\mainpage Introduction to BLSURFPLUGIN
+\mainpage Introduction to MG-CADSurf plug-in
-\b BLSURFPLUGIN SALOME module represents a meshing plug-in that can be
-used within the SALOME Mesh module for generation of 2D mesh.
+\b MG-CADSurf plug-in adds MG-CADSurf (former BLSURF) meshing
+algorithm to the SALOME Mesh module.
-\note BLSURFPLUGIN plugin uses DISTENE MG-CADSurf commercial meshing
-software and requires a license at the run time (to work within the
-Mesh module). To obtain a licence, visit http://www.distene.com/en/corp/eval-distene.html
+\b MG-CADSurf meshing algorithm is destined for:
+- generation of 2D meshes basing on the 2D geometric entities (faces).
-\b BLSURFPLUGIN plugin is destined for:
-- Meshing of the 2D geometric entities.
+\note MG-CADSurf plug-in uses DISTENE MG-CADSurf commercial meshing
+software and requires a license at the run time (to work within the
+Mesh module). To obtain a license, visit http://www.meshgems.com/meshgems-products.html
To manage parameters of the MG-CADSurf mesher, use \subpage blsurf_hypo_page.
Also, all MG-CADSurf functionalities are accessible via the
-\subpage blsurfplugin_python_interface_page "BLSURFPLUGIN Python interface".
+\subpage blsurfplugin_python_interface_page "MG-CADSurf Python interface".
*/
<parameter name="plugins" value="NETGENPlugin,GHS3DPlugin,BLSURFPlugin"/>
</section>
<section name="smesh_help" >
- <parameter name="Plug-ins/BLSURF plugin User's Guide" value="${BLSURFPLUGIN_ROOT_DIR}/share/doc/salome/gui/BLSURFPLUGIN/index.html"/>
+ <parameter name="Plug-ins/MG-CADSurf plugin User's Guide" value="${BLSURFPLUGIN_ROOT_DIR}/share/doc/salome/gui/BLSURFPLUGIN/index.html"/>
</section>
</document>
##
# @package BLSURFPluginBuilder
-# Python API for the BLSURF meshing plug-in module.
+# Python API for the MG-CADSurf meshing plug-in module.
from salome.smesh.smesh_algorithm import Mesh_Algorithm
-# Topology treatment way of BLSURF
+# Topology treatment way of MG-CADSurf
FromCAD, PreProcess, PreProcessPlus, PreCAD = 0,1,2,3
-# Element size flag of BLSURF
-DefaultSize, DefaultGeom, BLSURF_GlobalSize, BLSURF_LocalSize = 0,0,1,2
+# Element size flag of MG-CADSurf
+DefaultSize, DefaultGeom, MG_CADSURF_GlobalSize, MG_CADSURF_LocalSize = 0,0,1,2
# Retrocompatibility
-BLSURF_Custom, SizeMap = BLSURF_GlobalSize, BLSURF_LocalSize
+MG_CADSURF_Custom, SizeMap = MG_CADSURF_GlobalSize, MG_CADSURF_LocalSize
# import BLSURFPlugin module if possible
# Algorithms
#----------------------
-## BLSurf 2D algorithm.
+## MG-CADSurf 2D algorithm.
#
-# It can be created by calling smeshBuilder.Mesh.Triangle(smeshBuilder.BLSURF,geom=0)
+# It can be created by calling smeshBuilder.Mesh.Triangle(smeshBuilder.MG-CADSurf,geom=0)
#
class BLSURF_Algorithm(Mesh_Algorithm):
meshMethod = "Triangle"
## type of algorithm used with helper function in smeshBuilder.Mesh class
# @internal
- algoType = BLSURF
+ algoType = MG_CADSurf
## doc string of the method
# @internal
docHelper = "Creates triangle algorithm for faces"
pass
## Sets a way to define size of mesh elements to generate.
- # @param thePhysicalMesh is: DefaultSize, BLSURF_Custom or SizeMap.
+ # @param thePhysicalMesh is: DefaultSize, MG_CADSURF_Custom or SizeMap.
def SetPhysicalMesh(self, thePhysicalMesh=DefaultSize):
physical_size_mode = thePhysicalMesh
if self.Parameters().GetGeometricMesh() == DefaultGeom:
if physical_size_mode == DefaultSize:
- physical_size_mode = BLSURF_GlobalSize
+ physical_size_mode = MG_CADSURF_GlobalSize
self.Parameters().SetPhysicalMesh(physical_size_mode)
pass
## Sets a way to define maximum angular deflection of mesh from CAD model.
- # @param theGeometricMesh is: DefaultGeom (0)) or BLSURF_GlobalSize (1))
+ # @param theGeometricMesh is: DefaultGeom (0)) or MG_CADSURF_GlobalSize (1))
def SetGeometricMesh(self, theGeometricMesh=DefaultGeom):
geometric_size_mode = theGeometricMesh
if self.Parameters().GetPhysicalMesh() == DefaultSize:
if geometric_size_mode == DefaultGeom:
- geometric_size_mode = BLSURF_GlobalSize
+ geometric_size_mode = MG_CADSURF_GlobalSize
self.Parameters().SetGeometricMesh(geometric_size_mode)
pass
# @param isRelative : if True, the value is relative to the length of the diagonal of the bounding box
def SetPhySize(self, theVal, isRelative = False):
if self.Parameters().GetPhysicalMesh() == DefaultSize:
- self.SetPhysicalMesh(BLSURF_GlobalSize)
+ self.SetPhysicalMesh(MG_CADSURF_GlobalSize)
if isRelative:
self.Parameters().SetPhySizeRel(theVal)
else:
# @param theVal value of angular deflection
def SetAngleMesh(self, theVal=_geometric_approximation):
if self.Parameters().GetGeometricMesh() == DefaultGeom:
- self.SetGeometricMesh(BLSURF_GlobalSize)
+ self.SetGeometricMesh(MG_CADSURF_GlobalSize)
self.Parameters().SetAngleMesh(theVal)
pass
## Define periodicity between two groups of edges, without faces, given a transformation function.
# This uses the basic BLSURF API for each edge and each vertex.
- # @param theFace1 : GEOM edge (or group, compound) to associate with theEdge2
- # @param theFace2 : GEOM edge (or group, compound) associated with theEdge1
+ # @param theEdge1 : GEOM edge (or group, compound) to associate with theEdge2
+ # @param theEdge2 : GEOM edge (or group, compound) associated with theEdge1
# @param f_transf : python function defining the transformation between an object of theEdge1
# into an object of theFace2
def AddAdvancedEdgesPeriodicity(self, theEdge1, theEdge2, f_transf):
double BLSURFPlugin_Attractor::_distanceFromMap(double u, double v){
- // BLSURF seems to perform a linear interpolation so it's sufficient to give it a non-continuous distance map
+ // MG-CADSurf seems to perform a linear interpolation so it's sufficient to give it a non-continuous distance map
int i = floor ( (u - _u1) * _gridU / (_u2 - _u1) + 0.5 );
int j = floor ( (v - _v1) * _gridV / (_v2 - _v1) + 0.5 );
//=============================================================================
/*!
- * Pass parameters to BLSURF
+ * Pass parameters to MG-CADSurf
*/
//=============================================================================
{
// --------------------------------------------------------------------------
/*!
- * \brief Class correctly terminating usage of BLSURF library at destruction
+ * \brief Class correctly terminating usage of MG-CADSurf library at destruction
*/
class BLSURF_Cleaner
{
}
}
// make nodes created on the boundary of viscous layer replace nodes created
- // by BLSURF as their SMDS_Position is more correct
+ // by MG-CADSurf as their SMDS_Position is more correct
nodes.sort( ShapeTypeCompare() );
nodeGroupsToMerge.push_back( nodes );
}
//_proxyFace = TopoDS::Face( fExp.Current() );
- // Make input mesh for BLSURF: segments on EDGE's of newFace
+ // Make input mesh for MG-CADSurf: segments on EDGE's of newFace
// make nodes and fill in _tmp2origNN
//
//--------------------------------------------------------------------------------
/*!
- * \brief Fill in the origMesh with faces computed by BLSURF in this tmp mesh
+ * \brief Fill in the origMesh with faces computed by MG-CADSurf in this tmp mesh
*/
//--------------------------------------------------------------------------------
if ( !viscousMesh )
return false; // error in StdMeshers_ViscousLayers2D::Compute()
- // Compute BLSURF mesh on viscous layers
+ // Compute MG-CADSurf mesh on viscous layers
if ( viscousMesh->NbProxySubMeshes() > 0 )
{
}
}
- // Re-compute BLSURF mesh on the rest faces if the mesh was cleared
+ // Re-compute MG-CADSurf mesh on the rest faces if the mesh was cleared
for (TopExp_Explorer face_iter(aShape,TopAbs_FACE);face_iter.More();face_iter.Next())
{
if (e.Orientation() == TopAbs_INTERNAL)
cad_edge_set_property(edg, EDGE_PROPERTY_INTERNAL);
- // pass existing nodes of sub-meshes to BLSURF
+ // pass existing nodes of sub-meshes to MG-CADSurf
if ( nodeData )
{
const std::vector<UVPtStruct>& nodeDataVec = nodeData->GetUVPtStruct();
}
if (cleandc) {
- cout << "Give the pre-processed dcad object to the current BLSurf session \n";
+ cout << "Give the pre-processed dcad object to the current MG-CADSurf session \n";
cadsurf_data_set_dcad(css, cleandc);
}
else {
}
if (cleanc) {
- // Give the pre-processed CAD object to the current BLSurf session
- cout << "Give the pre-processed CAD object to the current BLSurf session \n";
+ // Give the pre-processed CAD object to the current MG-CADSurf session
+ cout << "Give the pre-processed CAD object to the current MG-CADSurf session \n";
cadsurf_data_set_cad(css, cleanc);
}
else {
/* release the mesh object, the rest is released by cleaner */
cadsurf_data_regain_mesh(css, msh);
- if ( needMerge ) // sew mesh computed by BLSURF with pre-existing mesh
+ if ( needMerge ) // sew mesh computed by MG-CADSurf with pre-existing mesh
{
SMESH_MeshEditor editor( &aMesh );
SMESH_MeshEditor::TListOfListOfNodes nodeGroupsToMerge;
TSubMeshSet::iterator smIt;
SMESHDS_SubMesh* smDS;
- // merge nodes on EDGE's with ones computed by BLSURF
+ // merge nodes on EDGE's with ones computed by MG-CADSurf
for ( smIt = mergeSubmeshes.begin(); smIt != mergeSubmeshes.end(); ++smIt )
{
if (! (smDS = *smIt) ) continue;
status_t curv_fun(real t, real *uv, real *dt, real *dtt, void *user_data)
{
/* t is given. It contains the t (time) 1D parametric coordintaes
- of the point PreCAD/BLSurf is querying on the curve */
+ of the point PreCAD/MG-CADSurf is querying on the curve */
- /* user_data identifies the edge PreCAD/BLSurf is querying
+ /* user_data identifies the edge PreCAD/MG-CADSurf is querying
* (see cad_edge_new later in this example) */
const Geom2d_Curve*pargeo = (const Geom2d_Curve*) user_data;
if (uv){
- /* BLSurf is querying the function evaluation */
+ /* MG-CADSurf is querying the function evaluation */
gp_Pnt2d P;
P=pargeo->Value(t);
uv[0]=P.X(); uv[1]=P.Y();
real *duu, real *duv, real *dvv, void *user_data)
{
/* uv[2] is given. It contains the u,v coordinates of the point
- * PreCAD/BLSurf is querying on the surface */
+ * PreCAD/MG-CADSurf is querying on the surface */
- /* user_data identifies the face PreCAD/BLSurf is querying (see
+ /* user_data identifies the face PreCAD/MG-CADSurf is querying (see
* cad_face_new later in this example)*/
const Geom_Surface* geometry = (const Geom_Surface*) user_data;
}
/*
- * The following function will be called for PreCAD/BLSurf message
+ * The following function will be called for PreCAD/MG-CADSurf message
* printing. See context_set_message_callback (later in this
* template) for how to set user_data.
*/
return STATUS_OK;
}
-/* This is the interrupt callback. PreCAD/BLSurf will call this
+/* This is the interrupt callback. PreCAD/MG-CADSurf will call this
* function regularily. See the file meshgems/interrupt.h
*/
status_t interrupt_cb(integer *interrupt_status, void *user_data)
*interrupt_status = INTERRUPT_CONTINUE;
return STATUS_OK;
}
- else /* you want to stop BLSurf */
+ else /* you want to stop MG-CADSurf */
{
*interrupt_status = INTERRUPT_STOP;
return STATUS_ERROR;
throw (std::invalid_argument) {
TOptionValues::iterator op_val = _option2value.find(optionName);
if (op_val == _option2value.end()) {
- std::string msg = "Unknown BLSURF option: '" + optionName + "'";
+ std::string msg = "Unknown MG-CADSurf option: '" + optionName + "'";
throw std::invalid_argument(msg);
}
if (op_val->second != optionValue) {
throw (std::invalid_argument) {
TOptionValues::iterator op_val = _preCADoption2value.find(optionName);
if (op_val == _preCADoption2value.end()) {
- std::string msg = "Unknown BLSURF option: '" + optionName + "'";
+ std::string msg = "Unknown MG-CADSurf option: '" + optionName + "'";
throw std::invalid_argument(msg);
}
if (op_val->second != optionValue) {
std::string BLSURFPlugin_Hypothesis::GetOptionValue(const std::string& optionName) throw (std::invalid_argument) {
TOptionValues::iterator op_val = _option2value.find(optionName);
if (op_val == _option2value.end()) {
- std::string msg = "Unknown BLSURF option: <";
+ std::string msg = "Unknown MG-CADSurf option: <";
msg += optionName + ">";
throw std::invalid_argument(msg);
}
//=============================================================================
std::ostream & BLSURFPlugin_Hypothesis::SaveTo(std::ostream & save) {
// We must keep at least the same number of arguments when increasing the SALOME version
- // When BLSURF becomes CADMESH, some parameters were fused into a single one. Thus the same
+ // When MG-CADSurf becomes CADMESH, some parameters were fused into a single one. Thus the same
// parameter can be written several times to keep the old global number of parameters.
// Treat old options which are now in the advanced options
#include <utilities.h>
#include "BLSURFPlugin_Attractor.hxx"
-// Parameters for work of BLSURF
+// Parameters for work of MG-CADSurf
class BLSURFPlugin_Hypothesis: public SMESH_Hypothesis
{
/*!
- * \brief Class for creation of BLSURF hypotheses
+ * \brief Class for creation of MG-CADSurf hypotheses
*/
class BLSURFPLUGIN_GUI_EXPORT BLSURFPluginGUI_HypothesisCreator : public SMESHGUI_GenericHypothesisCreator
{
</message>
<message>
<source>OPTION_MENU_BLSURF</source>
- <translation>BLSURF</translation>
+ <translation>MG-CADSurf</translation>
</message>
<message>
<source>OPTION_MENU_PRECAD</source>
</message>
<message>
<source>BLSURF_HYPOTHESIS</source>
- <translation>BLSURF 2D</translation>
+ <translation>MG-CADSurf 2D</translation>
</message>
<message>
<source>BLSURF_ADV_ARGS</source>
</message>
<message>
<source>OPTION_MENU_BLSURF</source>
- <translation>BLSURF</translation>
+ <translation>MG-CADSurf</translation>
</message>
<message>
<source>OPTION_MENU_PRECAD</source>
</message>
<message>
<source>BLSURF_HYPOTHESIS</source>
- <translation>BLSURF 2次元</translation>
+ <translation>MG-CADSurf 2次元</translation>
</message>
<message>
<source>BLSURF_ADV_ARGS</source>
</message>
<message>
<source>OPTION_MENU_BLSURF</source>
- <translation>BLSURF</translation>
+ <translation>MG-CADSurf</translation>
</message>
<message>
<source>OPTION_MENU_PRECAD</source>