Add PreCAD

Update doc
Update smeshDC.py
This commit is contained in:
gdd 2011-07-26 17:18:04 +00:00
parent eed8bfc30b
commit 78fd150f79
5 changed files with 110 additions and 26 deletions

View File

@ -4,6 +4,7 @@
\n BLSURF Parameters hypothesis works only with <b>BLSURF</b> 2d
algorithm. This algorithm is a commercial software.
\n To get a licence, visit http://www.distene.com/corp/eval-distene.html
<h1>General parameters</h1>
@ -67,6 +68,15 @@ not sewed faces.
<li>"Pre-process" and "Pre-process++" allow the BLSURF software to
pre-process the geometrical model to eventually produce a conform
mesh. </li>
<li>"PreCAD" is an auxiliary CAD pre-processing module which has
two main goals:
<ul>
<li> Complete missing or inadequate CAD-description.</li>
<li>Perform topology reconstruction and specific geometry
enhancement for mesh generation.</li>
</ul>
This module requires a specific licence.
</li>
</ul>
<li><b>Verbosity level</b> - Defines the percentage of "verbosity" of

View File

@ -4,6 +4,7 @@
\n GHS3D Parameters hypothesis works only with <b>Tetrahedron (GHS3D)</b>
algorithm. This algorithm is a commercial software.
\n To get a licence, visit http://www.distene.com/corp/eval-distene.html
<h1>General parameters</h1>

View File

@ -4,6 +4,7 @@
\n Hexotic Parameters hypothesis works only with <b>Hexotic</b>
algorithm. This algorithm is a commercial software.
\n To get a licence, visit http://www.distene.com/corp/eval-distene.html
\image html hexotic_parameters.png

View File

@ -34,36 +34,33 @@ geompy.addToStudyInFather(Face_2,Wire_1, "Wire_1")
blsurfMesh = smesh.Mesh(box,"box: BLSurf mesh")
# create a BLSurf algorithm for faces
BLSURF = blsurfMesh.Triangle(algo=smesh.BLSURF)
algo2d = blsurfMesh.Triangle(algo=smesh.BLSURF)
# get BLSurf algorithm hypothesis
BLSURF_Parameters = BLSURF.Parameters()
# optional - set physical mesh to 2 = Size Map
algo2d.SetPhysicalMesh( 2 )
# set physical mesh to 2 = Size Map
BLSURF_Parameters.SetPhysicalMesh( 2 )
# set global mesh size
BLSURF_Parameters.SetPhySize( 34.641 )
# optional - set global mesh size
algo2d.SetPhySize( 34.641 )
# set size on Face_1
BLSURF_Parameters.SetSizeMap(Face_1, 'def f(u,v): return 10' )
algo2d.SetSizeMap(Face_1, 'def f(u,v): return 10' )
# set size on Edge_1
BLSURF_Parameters.SetSizeMap(Edge_1, 'def f(t): return 5' )
algo2d.SetSizeMap(Edge_1, 'def f(t): return 5' )
# set size on Vertex_1
BLSURF_Parameters.SetSizeMap(Vertex_1, 'def f(): return 2' )
algo2d.SetSizeMap(Vertex_1, 'def f(): return 2' )
# compute the mesh
blsurfMesh.Compute()
# Add enforced vertex for Face_1 on (50, 50, 50)
# The projection coordinates will be (50, 50, 0)
BLSURF_Parameters.SetEnforcedVertex(Face_1, 50, 50, 50)
algo2d.SetEnforcedVertex(Face_1, 50, 50, 50)
# Add another enforced vertex on (150, 150, 150)
BLSURF_Parameters.SetEnforcedVertex(Face_1, 150, 150, 150)
algo2d.SetEnforcedVertex(Face_1, 150, 150, 150)
# Retrieve and print the list of enforced vertices defines on Face_1
enfList = BLSURF_Parameters.GetEnforcedVertices(Face_1)
enfList = algo2d.GetEnforcedVertices(Face_1)
print "List of enforced vertices for Face_1: "
print enfList
@ -71,8 +68,8 @@ print enfList
blsurfMesh.Compute()
# Remove an enforced vertex and print the list
BLSURF_Parameters.UnsetEnforcedVertex(Face_1, 50, 50, 50)
enfList = BLSURF_Parameters.GetEnforcedVertices(Face_1)
algo2d.UnsetEnforcedVertex(Face_1, 50, 50, 50)
enfList = algo2d.GetEnforcedVertices(Face_1)
print "List of enforced vertices for Face_1: "
print enfList
@ -80,7 +77,7 @@ print enfList
blsurfMesh.Compute()
# Remove all enforced vertices defined on Face_1
BLSURF_Parameters.UnsetEnforcedVertices(Face_1)
algo2d.UnsetEnforcedVertices(Face_1)
# compute the mesh
blsurfMesh.Compute()
@ -91,11 +88,11 @@ blsurfMesh.Compute()
# The size on Wire_1 is 1 and will grow until a maximum of 36.641 (physical size set above)
# The influence distance of the attractor is 20
# The size is kept constant until a distance of 10
BLSURF_Parameters.SetAttractorGeom(Face_2, Wire_1, 1, 36.641, 20, 10)
algo2d.SetAttractorGeom(Face_2, Wire_1, 1, 36.641, 20, 10)
# In order to let the attractor control the growing of the mesh let set
# the gradation to its maximum
BLSURF_Parameters.SetGradation( 2.5 )
algo2d.SetGradation( 2.5 )
# compute the mesh
blsurfMesh.Compute()

View File

@ -188,7 +188,7 @@ None_Optimization, Light_Optimization, Medium_Optimization, Strong_Optimization
None_Optimization, Light_Optimization, Standard_Optimization, StandardPlus_Optimization, Strong_Optimization = 0,1,2,3,4
# Topology treatment way of BLSURF
FromCAD, PreProcess, PreProcessPlus = 0,1,2
FromCAD, PreProcess, PreProcessPlus, PreCAD = 0,1,2,3
# Element size flag of BLSURF
DefaultSize, DefaultGeom, BLSURF_Custom, SizeMap = 0,0,1,2
@ -5053,6 +5053,7 @@ class Mesh_Triangle(Mesh_Algorithm):
# @param way defines how mesh conformity is assured <ul>
# <li>FromCAD - mesh conformity is assured by conformity of a shape</li>
# <li>PreProcess or PreProcessPlus - by pre-processing a CAD model</li></ul>
# <li>PreCAD - by pre-processing with PreCAD a CAD model</li></ul>
# @ingroup l3_hypos_blsurf
def SetTopology(self, way):
if self.Parameters():
@ -5080,6 +5081,52 @@ class Mesh_Triangle(Mesh_Algorithm):
# Parameter of BLSURF algo
self.params.SetOptionValue(optionName,level)
## Enforced vertices (BLSURF)
## To get all the enforced vertices
# @ingroup l3_hypos_blsurf
def GetAllEnforcedVertices(self):
if self.Parameters():
# Parameter of BLSURF algo
return self.params.GetAllEnforcedVertices()
## To get all the enforced vertices sorted by face (or group, compound)
# @ingroup l3_hypos_blsurf
def GetAllEnforcedVerticesByFace(self):
if self.Parameters():
# Parameter of BLSURF algo
return self.params.GetAllEnforcedVerticesByFace()
## To get all the enforced vertices sorted by coords of input vertices
# @ingroup l3_hypos_blsurf
def GetAllEnforcedVerticesByCoords(self):
if self.Parameters():
# Parameter of BLSURF algo
return self.params.GetAllEnforcedVerticesByCoords()
## To get all the coords of input vertices sorted by face (or group, compound)
# @ingroup l3_hypos_blsurf
def GetAllCoordsByFace(self):
if self.Parameters():
# Parameter of BLSURF algo
return self.params.GetAllCoordsByFace()
## To get all the enforced vertices on a face (or group, compound)
# @param theFace : GEOM face (or group, compound) on which to define an enforced vertex
# @ingroup l3_hypos_blsurf
def GetEnforcedVertices(self, theFace):
if self.Parameters():
# Parameter of BLSURF algo
AssureGeomPublished( self.mesh, theFace )
return self.params.GetEnforcedVertices(theFace)
## To clear all the enforced vertices
# @ingroup l3_hypos_blsurf
def ClearAllEnforcedVertices(self):
if self.Parameters():
# Parameter of BLSURF algo
return self.params.ClearAllEnforcedVertices()
## To set an enforced vertex on a face (or group, compound) given the coordinates of a point. If the point is not on the face, it will projected on it. If there is no projection, no enforced vertex is created.
# @param theFace : GEOM face (or group, compound) on which to define an enforced vertex
# @param x : x coordinate
@ -5089,7 +5136,6 @@ class Mesh_Triangle(Mesh_Algorithm):
def SetEnforcedVertex(self, theFace, x, y, z):
if self.Parameters():
# Parameter of BLSURF algo
# self.SetPhysicalMesh(2)
AssureGeomPublished( self.mesh, theFace )
return self.params.SetEnforcedVertex(theFace, x, y, z)
@ -5103,7 +5149,6 @@ class Mesh_Triangle(Mesh_Algorithm):
def SetEnforcedVertexNamed(self, theFace, x, y, z, vertexName):
if self.Parameters():
# Parameter of BLSURF algo
# self.SetPhysicalMesh(2)
AssureGeomPublished( self.mesh, theFace )
return self.params.SetEnforcedVertexNamed(theFace, x, y, z, vertexName)
@ -5114,7 +5159,6 @@ class Mesh_Triangle(Mesh_Algorithm):
def SetEnforcedVertexGeom(self, theFace, theVertex):
if self.Parameters():
# Parameter of BLSURF algo
# self.SetPhysicalMesh(2)
AssureGeomPublished( self.mesh, theFace )
AssureGeomPublished( self.mesh, theVertex )
return self.params.SetEnforcedVertexGeom(theFace, theVertex)
@ -5129,7 +5173,6 @@ class Mesh_Triangle(Mesh_Algorithm):
def SetEnforcedVertexWithGroup(self, theFace, x, y, z, groupName):
if self.Parameters():
# Parameter of BLSURF algo
# self.SetPhysicalMesh(2)
AssureGeomPublished( self.mesh, theFace )
return self.params.SetEnforcedVertexWithGroup(theFace, x, y, z, groupName)
@ -5144,7 +5187,6 @@ class Mesh_Triangle(Mesh_Algorithm):
def SetEnforcedVertexNamedWithGroup(self, theFace, x, y, z, vertexName, groupName):
if self.Parameters():
# Parameter of BLSURF algo
# self.SetPhysicalMesh(2)
AssureGeomPublished( self.mesh, theFace )
return self.params.SetEnforcedVertexNamedWithGroup(theFace, x, y, z, vertexName, groupName)
@ -5156,7 +5198,6 @@ class Mesh_Triangle(Mesh_Algorithm):
def SetEnforcedVertexGeomWithGroup(self, theFace, theVertex, groupName):
if self.Parameters():
# Parameter of BLSURF algo
# self.SetPhysicalMesh(2)
AssureGeomPublished( self.mesh, theFace )
AssureGeomPublished( self.mesh, theVertex )
return self.params.SetEnforcedVertexGeomWithGroup(theFace, theVertex,groupName)
@ -5193,6 +5234,8 @@ class Mesh_Triangle(Mesh_Algorithm):
AssureGeomPublished( self.mesh, theFace )
return self.params.UnsetEnforcedVertices(theFace)
## Attractors (BLSURF)
## Sets an attractor on the chosen face. The mesh size will decrease exponentially with the distance from theAttractor, following the rule h(d) = theEndSize - (theEndSize - theStartSize) * exp [ - ( d / theInfluenceDistance ) ^ 2 ]
# @param theFace : face on which the attractor will be defined
# @param theAttractor : geometrical object from which the mesh size "h" decreases exponentially
@ -5217,6 +5260,38 @@ class Mesh_Triangle(Mesh_Algorithm):
AssureGeomPublished( self.mesh, theFace )
self.params.SetAttractorGeom(theFace)
## Size maps (BLSURF)
## To set a size map on a face, edge or vertex (or group, compound) given Python function.
# If theObject is a face, the function can be: def f(u,v): return u+v
# If theObject is an edge, the function can be: def f(t): return t/2
# If theObject is a vertex, the function can be: def f(): return 10
# @param theObject : GEOM face, edge or vertex (or group, compound) on which to define a size map
# @param theSizeMap : Size map defined as a string
# @ingroup l3_hypos_blsurf
def SetSizeMap(self, theObject, theSizeMap):
if self.Parameters():
# Parameter of BLSURF algo
AssureGeomPublished( self.mesh, theObject )
return self.params.SetSizeMap(theObject, theSizeMap)
## To remove a size map defined on a face, edge or vertex (or group, compound)
# @param theObject : GEOM face, edge or vertex (or group, compound) on which to define a size map
# @ingroup l3_hypos_blsurf
def UnsetSizeMap(self, theObject):
if self.Parameters():
# Parameter of BLSURF algo
AssureGeomPublished( self.mesh, theObject )
return self.params.UnsetSizeMap(theObject)
## To remove all the size maps
# @ingroup l3_hypos_blsurf
def ClearSizeMaps(self):
if self.Parameters():
# Parameter of BLSURF algo
return self.params.ClearSizeMaps()
## Sets QuadAllowed flag.
# Only for algoType == NETGEN(NETGEN_1D2D) || NETGEN_2D || BLSURF
# @ingroup l3_hypos_netgen l3_hypos_blsurf