smesh/doc/examples/defining_hypotheses_ex14.py

32 lines
1.0 KiB
Python
Raw Permalink Normal View History

2013-02-12 20:37:44 +06:00
# Quadrangle Parameters example 1 (meshing a face with 3 edges)
import salome
salome.salome_init_without_session()
from salome.geom import geomBuilder
from salome.smesh import smeshBuilder
2013-02-12 20:37:44 +06:00
2022-04-11 18:28:01 +05:00
geom_builder = geomBuilder.New()
smesh_builder = smeshBuilder.New()
2022-04-11 18:28:01 +05:00
# Get 1/4 part from the disk face.
Box_1 = geom_builder.MakeBoxDXDYDZ(100, 100, 100)
Disk_1 = geom_builder.MakeDiskR(100, 1)
Common_1 = geom_builder.MakeCommon(Disk_1, Box_1)
triaVertex = geom_builder.GetVertexNearPoint( Common_1, geom_builder.MakeVertex(0,0,0) )
geom_builder.addToStudy( Common_1, "Common_1" )
geom_builder.addToStudyInFather( Common_1, triaVertex, "triaVertex" )
2013-02-12 20:37:44 +06:00
# Set the Geometry for meshing
2022-04-11 18:28:01 +05:00
Mesh_1 = smesh_builder.Mesh(Common_1)
2013-02-12 20:37:44 +06:00
# Define 1D hypothesis
2013-02-12 20:37:44 +06:00
Regular_1D = Mesh_1.Segment()
Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
# Create Quadrangle parameters and define the Base Vertex.
Quadrangle_2D = Mesh_1.Quadrangle().TriangleVertex( triaVertex )
2013-02-12 20:37:44 +06:00
# Compute the mesh
if not Mesh_1.Compute(): raise Exception("Error when computing Mesh")