from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(salome.myStudy)
+from salome.BLSURFPlugin import BLSURFPluginBuilder
+
Mesh = smesh.Mesh(part, "Mesh")
algo2d = Mesh.Triangle(algo=smeshBuilder.MG_CADSurf)
algo2d.SetAngleMesh( 4 )
algo2d.SetPhySize( 8 )
algo2d.SetOptionValue( 'periodic_tolerance', '1e-2' )
+# Deactivate PreCAD
+algo2d.SetTopology(BLSURFPluginBuilder.FromCAD)
def proj_x(shape1):
shape2 = geompy.MakeTranslation(shape1, 100, 0., 0)
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(salome.myStudy)
+from salome.BLSURFPlugin import BLSURFPluginBuilder
+
Mesh = smesh.Mesh(part, "Mesh")
algo2d = Mesh.Triangle(algo=smeshBuilder.MG_CADSurf)
algo2d.SetAngleMesh( 4 )
algo2d.SetPhySize( 8 )
algo2d.SetOptionValue( 'periodic_tolerance', '1e-2' )
+# Deactivate PreCAD
+algo2d.SetTopology(BLSURFPluginBuilder.FromCAD)
def rota_z(shape1):
shape2 = geompy.MakeRotation(shape1, axe, -math.pi/2)
In GUI, periodicity association uses PreCAD (optional MG-CADSurf add-on). Be sure to have a PreCAD license to be able to use it. Otherwise, use \ref periodicity_tui_basic_api_usage "the basic API in TUI" or the \ref periodicity_tui_advanced_api_usage "the advanced API in TUI".
+Remark: to use the basic API to define periodicity, you have to disable PreCAD.
+
\image html blsurf_periodicity_translation.png "Two periodic faces (translation)"
\image html blsurf_periodicity_reflexion.png "Two periodic faces (reflexion)"
# <li>PreProcess or PreProcessPlus - by pre-processing a CAD model (OBSOLETE: FromCAD will be used)</li>
# <li>PreCAD - by pre-processing with PreCAD a CAD model</li></ul>
def SetTopology(self, way):
- if way != PreCAD:
+ if way != PreCAD and way != FromCAD:
print "Warning: topology mode %d is no longer supported. Mode FromCAD is used."%way
way = FromCAD
self.Parameters().SetTopology(way)
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(box, "Mesh")
-algo2d = Mesh.Triangle(algo=smeshBuilder.BLSURF)
+algo2d = Mesh.Triangle(algo=smeshBuilder.MG_CADSurf)
algo2d.SetGeometricMesh( 1 )
algo2d.SetAngleMesh( 4 )
algo2d.SetPhySize( 8 )
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(salome.myStudy)
+from salome.BLSURFPlugin import BLSURFPluginBuilder
+
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 )
algo2d.SetOptionValue( 'periodic_tolerance', '1e-2' )
+# Deactivate PreCAD
+algo2d.SetTopology(BLSURFPluginBuilder.FromCAD)
def proj_x(shape1):
shape2 = geompy.MakeTranslation(shape1, 100, 0., 0)
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(salome.myStudy)
+from salome.BLSURFPlugin import BLSURFPluginBuilder
+
Mesh = smesh.Mesh(part, "Mesh")
-algo2d = Mesh.Triangle(algo=smeshBuilder.BLSURF)
+algo2d = Mesh.Triangle(algo=smeshBuilder.MG_CADSurf)
algo2d.SetVerbosity(10)
#algo2d.SetTopology(smesh.PreCAD)
algo2d.SetGeometricMesh( 1 )
algo2d.SetPhySize( 8 )
#algo2d.SetGradation(1.05)
algo2d.SetOptionValue( 'periodic_tolerance', '1e-2' )
+# Deactivate PreCAD
+algo2d.SetTopology(BLSURFPluginBuilder.FromCAD)
# Periodicity
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 )
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(salome.myStudy)
+from salome.BLSURFPlugin import BLSURFPluginBuilder
+
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 )
algo2d.SetOptionValue( 'periodic_tolerance', '1e-2' )
+# Deactivate PreCAD
+algo2d.SetTopology(BLSURFPluginBuilder.FromCAD)
def rota_z(shape1):
shape2 = geompy.MakeRotation(shape1, axe, -math.pi/2)
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(salome.myStudy)
+from salome.BLSURFPlugin import BLSURFPluginBuilder
+
Mesh = smesh.Mesh(part, "Mesh")
-algo2d = Mesh.Triangle(algo=smeshBuilder.BLSURF)
+algo2d = Mesh.Triangle(algo=smeshBuilder.MG_CADSurf)
algo2d.SetVerbosity(1)
#algo2d.SetTopology(smesh.PreCAD)
algo2d.SetGeometricMesh( 1 )
algo2d.SetPhySize( 8 )
#algo2d.SetGradation(1.05)
algo2d.SetOptionValue( 'periodic_tolerance', '1e-2' )
+# Deactivate PreCAD
+algo2d.SetTopology(BLSURFPluginBuilder.FromCAD)
# Periodicity
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 )
Mesh_1 = smesh.Mesh(Partition_1)
-BLSURF_1 = Mesh_1.Triangle(algo=smeshBuilder.BLSURF)
+BLSURF_1 = Mesh_1.Triangle(algo=smeshBuilder.MG_CADSurf)
BLSURF_Parameters = BLSURF_1.Parameters()
BLSURF_Parameters.SetPhySize( 5 )
BLSURF_Parameters.SetPreCADMergeEdges( True )
Mesh_1 = smesh.Mesh(Partition_1)
-BLSURF_1 = Mesh_1.Triangle(algo=smeshBuilder.BLSURF)
+BLSURF_1 = Mesh_1.Triangle(algo=smeshBuilder.MG_CADSurf)
BLSURF_Parameters = BLSURF_1.Parameters()
BLSURF_Parameters.SetPhySize( 5 )
Mesh_1 = smesh.Mesh(sphere)
-BLSURF_1 = Mesh_1.Triangle(algo=smeshBuilder.BLSURF)
+BLSURF_1 = Mesh_1.Triangle(algo=smeshBuilder.MG_CADSurf)
BLSURF_Parameters = BLSURF_1.Parameters()
BLSURF_Parameters.SetPhySize( 5 )
BLSURF_Parameters.SetGeometricMesh( 1 )