Salome HOME
CEA_1537: remove deprecated precad to be able to use MeshGems 2.3
[plugins/blsurfplugin.git] / src / BLSURFPlugin / BLSURFPluginBuilder.py
1 # Copyright (C) 2007-2016  CEA/DEN, EDF R&D
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 ##
21 # @package BLSURFPluginBuilder
22 # Python API for the MG-CADSurf meshing plug-in module.
23
24 from salome.smesh.smesh_algorithm import Mesh_Algorithm
25
26 LIBRARY = "libBLSURFEngine.so"
27
28 # Topology treatment way of MG-CADSurf
29 FromCAD, PreProcess, PreProcessPlus, PreCAD = 0,1,2,3
30
31 # Element size flag of MG-CADSurf
32 DefaultSize, DefaultGeom, MG_CADSURF_GlobalSize, MG_CADSURF_LocalSize = 0,0,1,2
33 # Retrocompatibility
34 MG_CADSURF_Custom, SizeMap = MG_CADSURF_GlobalSize, MG_CADSURF_LocalSize
35 BLSURF_Custom, BLSURF_GlobalSize, BLSURF_LocalSize = MG_CADSURF_Custom, MG_CADSURF_GlobalSize, MG_CADSURF_LocalSize
36
37 # import BLSURFPlugin module if possible
38 noBLSURFPlugin = 0
39 try:
40   import BLSURFPlugin
41 except ImportError:
42   noBLSURFPlugin = 1
43   pass
44
45 #----------------------------
46 # Mesh algo type identifiers
47 #----------------------------
48
49 ## Algorithm type: MG-CADSurf triangle algorithm, see BLSURF_Algorithm
50 MG_CADSurf = "MG-CADSurf"
51 BLSURF = MG_CADSurf
52
53 #----------------------
54 # Algorithms
55 #----------------------
56
57 ## MG-CADSurf 2D algorithm.
58 #
59 #  It can be created by calling smeshBuilder.Mesh.Triangle(smeshBuilder.MG-CADSurf,geom=0)
60 #
61 class BLSURF_Algorithm(Mesh_Algorithm):
62
63   ## name of the dynamic method in smeshBuilder.Mesh class
64   #  @internal
65   meshMethod = "Triangle"
66   ## type of algorithm used with helper function in smeshBuilder.Mesh class
67   #  @internal
68   algoType   = MG_CADSurf
69   ## doc string of the method
70   #  @internal
71   docHelper  = "Creates triangle algorithm for faces"
72
73   _anisotropic_ratio = 0
74   _bad_surface_element_aspect_ratio = 1000
75   _geometric_approximation = 22
76   _gradation  = 1.3
77   _metric = "isotropic"
78   _remove_tiny_edges = 0
79
80   ## Private constructor.
81   #  @param mesh parent mesh object algorithm is assigned to
82   #  @param geom geometry (shape/sub-shape) algorithm is assigned to;
83   #              if it is @c 0 (default), the algorithm is assigned to the main shape
84   def __init__(self, mesh, geom=0):
85     Mesh_Algorithm.__init__(self)
86     if noBLSURFPlugin:
87       print "Warning: BLSURFPlugin module unavailable"
88     self.Create(mesh, geom, BLSURF, LIBRARY)
89     self.params=None
90     self.geompyD = mesh.geompyD
91     #self.SetPhysicalMesh() - PAL19680
92     pass
93
94   ## Sets a way to define size of mesh elements to generate.
95   #  @param thePhysicalMesh is: DefaultSize, MG_CADSURF_Custom or SizeMap.
96   def SetPhysicalMesh(self, thePhysicalMesh=DefaultSize):
97     physical_size_mode = thePhysicalMesh
98     if self.Parameters().GetGeometricMesh() == DefaultGeom:
99       if physical_size_mode == DefaultSize:
100         physical_size_mode = MG_CADSURF_GlobalSize
101     self.Parameters().SetPhysicalMesh(physical_size_mode)
102     pass
103
104   ## Sets a way to define maximum angular deflection of mesh from CAD model.
105   #  @param theGeometricMesh is: DefaultGeom (0)) or MG_CADSURF_GlobalSize (1))
106   def SetGeometricMesh(self, theGeometricMesh=DefaultGeom):
107     geometric_size_mode = theGeometricMesh
108     if self.Parameters().GetPhysicalMesh() == DefaultSize:
109       if geometric_size_mode == DefaultGeom:
110         geometric_size_mode = MG_CADSURF_GlobalSize
111     self.Parameters().SetGeometricMesh(geometric_size_mode)
112     pass
113
114   ## Sets size of mesh elements to generate.
115   #  @param theVal : constant global size when using a global physical size.
116   #  @param isRelative : if True, the value is relative to the length of the diagonal of the bounding box
117   def SetPhySize(self, theVal, isRelative = False):
118     if self.Parameters().GetPhysicalMesh() == DefaultSize:
119       self.SetPhysicalMesh(MG_CADSURF_GlobalSize)
120     if isRelative:
121       self.Parameters().SetPhySizeRel(theVal)
122     else:
123       self.Parameters().SetPhySize(theVal)
124     pass
125
126   ## Sets lower boundary of mesh element size.
127   #  @param theVal : global minimal cell size desired.
128   #  @param isRelative : if True, the value is relative to the length of the diagonal of the bounding box
129   def SetMinSize(self, theVal=-1, isRelative = False):
130     if isRelative:
131       self.Parameters().SetMinSizeRel(theVal)
132     else:
133       self.Parameters().SetMinSize(theVal)
134     pass
135
136   ## Sets upper boundary of mesh element size.
137   #  @param theVal : global maximal cell size desired.
138   #  @param isRelative : if True, the value is relative to the length of the diagonal of the bounding box
139   def SetMaxSize(self, theVal=-1, isRelative = False):
140     if isRelative:
141       self.Parameters().SetMaxSizeRel(theVal)
142     else:
143       self.Parameters().SetMaxSize(theVal)
144     pass
145
146   ## Sets angular deflection (in degrees) from CAD surface.
147   #  @param theVal value of angular deflection
148   def SetAngleMesh(self, theVal=_geometric_approximation):
149     if self.Parameters().GetGeometricMesh() == DefaultGeom:
150       self.SetGeometricMesh(MG_CADSURF_GlobalSize)
151     self.Parameters().SetAngleMesh(theVal)
152     pass
153
154   ## Sets the maximum desired distance between a triangle and its supporting CAD surface
155   #  @param distance the distance between a triangle and a surface
156   def SetChordalError(self, distance):
157     self.Parameters().SetChordalError(distance)
158     pass
159
160   ## Sets maximal allowed ratio between the lengths of two adjacent edges.
161   #  @param theVal value of maximal length ratio
162   def SetGradation(self, theVal=_gradation):
163     if self.Parameters().GetGeometricMesh() == 0: theVal = self._gradation
164     self.Parameters().SetGradation(theVal)
165     pass
166
167   ## Sets topology usage way.
168   # @param way defines how mesh conformity is assured <ul>
169   # <li>FromCAD - mesh conformity is assured by conformity of a shape</li>
170   # <li>PreProcess or PreProcessPlus - by pre-processing a CAD model (OBSOLETE: FromCAD will be used)</li>
171   # <li>PreCAD - by pre-processing with PreCAD a CAD model</li></ul>
172   def SetTopology(self, way):
173     if way != PreCAD and way != FromCAD:
174       print "Warning: topology mode %d is no longer supported. Mode FromCAD is used."%way
175       way = FromCAD
176     self.Parameters().SetTopology(way)
177     pass
178
179   ## To respect geometrical edges or not.
180   #  @param toIgnoreEdges "ignore edges" flag value
181   def SetDecimesh(self, toIgnoreEdges=False):
182     if toIgnoreEdges:
183       self.SetOptionValue("respect_geometry","0")
184     else:
185       self.SetOptionValue("respect_geometry","1")
186     pass
187
188   ## Sets verbosity level in the range 0 to 100.
189   #  @param level verbosity level
190   def SetVerbosity(self, level):
191     self.Parameters().SetVerbosity(level)
192     pass
193
194   ## To optimize merges edges.
195   #  @param toMergeEdges "merge edges" flag value
196   def SetPreCADMergeEdges(self, toMergeEdges=False):
197     if self.Parameters().GetTopology() != PreCAD:
198       self.SetTopology(PreCAD)
199     self.Parameters().SetPreCADMergeEdges(toMergeEdges)
200     pass
201
202   ## To remove duplicate CAD Faces
203   #  @param toRemoveDuplicateCADFaces "merge edges" flag value
204   def SetPreCADRemoveDuplicateCADFaces(self, toRemoveDuplicateCADFaces=False):
205     if self.Parameters().GetTopology() != PreCAD:
206       self.SetTopology(PreCAD)
207     self.Parameters().SetPreCADRemoveDuplicateCADFaces(toRemoveDuplicateCADFaces)
208     pass
209
210   ## To process 3D topology.
211   #  @param toProcess "PreCAD process 3D" flag value
212   def SetPreCADProcess3DTopology(self, toProcess=False):
213     if self.Parameters().GetTopology() != PreCAD:
214       self.SetTopology(PreCAD)
215     self.Parameters().SetPreCADProcess3DTopology(toProcess)
216     pass
217
218   ## To remove nano edges.
219   #  @param toRemoveNanoEdges "remove nano edges" flag value
220   def SetPreCADRemoveNanoEdges(self, toRemoveNanoEdges=False):
221     if toRemoveNanoEdges:
222       self.SetPreCADOptionValue("remove_tiny_edges","1")
223     else:
224       self.SetPreCADOptionValue("remove_tiny_edges","0")
225     pass
226
227   ## To compute topology from scratch
228   #  @param toDiscardInput "discard input" flag value
229   def SetPreCADDiscardInput(self, toDiscardInput=False):
230     if self.Parameters().GetTopology() != PreCAD:
231       self.SetTopology(PreCAD)
232     self.Parameters().SetPreCADDiscardInput(toDiscardInput)
233     pass
234
235   ## Sets the length below which an edge is considered as nano
236   #  for the topology processing.
237   #  @param epsNano nano edge length threshold value
238   def SetPreCADEpsNano(self, epsNano):
239     self.SetPreCADOptionValue("tiny_edge_length","%f"%epsNano)
240     pass
241
242   ## Sets advanced option value.
243   #  @param optionName advanced option name
244   #  @param level advanced option value
245   def SetOptionValue(self, optionName, level):
246     self.Parameters().SetOptionValue(optionName,level)
247     pass
248
249   ## Sets advanced PreCAD option value.
250   #  @param optionName name of the option
251   #  @param optionValue value of the option
252   def SetPreCADOptionValue(self, optionName, optionValue):
253     if self.Parameters().GetTopology() != PreCAD:
254       self.SetTopology(PreCAD)
255     self.Parameters().SetPreCADOptionValue(optionName,optionValue)
256     pass
257   
258   ## Adds custom advanced option value.
259   #  @param optionName custom advanced option name
260   #  @param level custom advanced option value
261   def AddOption(self, optionName, level):
262     self.Parameters().AddOption(optionName,level)
263     pass
264
265   ## Adds custom advanced PreCAD option value.
266   #  @param optionName custom name of the option
267   #  @param optionValue value of the option
268   def AddPreCADOption(self, optionName, optionValue):
269     if self.Parameters().GetTopology() != PreCAD:
270       self.SetTopology(PreCAD)
271     self.Parameters().AddPreCADOption(optionName,optionValue)
272     pass
273
274   ## Sets GMF file for export at computation
275   #  @param fileName GMF file name
276   def SetGMFFile(self, fileName):
277     self.Parameters().SetGMFFile(fileName)
278     pass
279
280   #-----------------------------------------
281   # Enforced vertices (BLSURF)
282   #-----------------------------------------
283
284   ## To get all the enforced vertices
285   def GetAllEnforcedVertices(self):
286     return self.Parameters().GetAllEnforcedVertices()
287
288   ## To get all the enforced vertices sorted by face (or group, compound)
289   def GetAllEnforcedVerticesByFace(self):
290     return self.Parameters().GetAllEnforcedVerticesByFace()
291
292   ## To get all the enforced vertices sorted by coords of input vertices
293   def GetAllEnforcedVerticesByCoords(self):
294     return self.Parameters().GetAllEnforcedVerticesByCoords()
295
296   ## To get all the coords of input vertices sorted by face (or group, compound)
297   def GetAllCoordsByFace(self):
298     return self.Parameters().GetAllCoordsByFace()
299
300   ## To get all the enforced vertices on a face (or group, compound)
301   #  @param theFace : GEOM face (or group, compound) on which to define an enforced vertex
302   def GetEnforcedVertices(self, theFace):
303     from salome.smesh.smeshBuilder import AssureGeomPublished
304     AssureGeomPublished( self.mesh, theFace )
305     return self.Parameters().GetEnforcedVertices(theFace)
306
307   ## To clear all the enforced vertices
308   def ClearAllEnforcedVertices(self):
309     return self.Parameters().ClearAllEnforcedVertices()
310
311   ## 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.
312   #  @param theFace      : GEOM face (or group, compound) on which to define an enforced vertex
313   #  @param x            : x coordinate
314   #  @param y            : y coordinate
315   #  @param z            : z coordinate
316   #  @param vertexName   : name of the enforced vertex
317   #  @param groupName    : name of the group
318   def SetEnforcedVertex(self, theFace, x, y, z, vertexName = "", groupName = ""):
319     from salome.smesh.smeshBuilder import AssureGeomPublished
320     AssureGeomPublished( self.mesh, theFace )
321     if vertexName == "":
322       if groupName == "":
323         return self.Parameters().SetEnforcedVertex(theFace, x, y, z)
324       else:
325         return self.Parameters().SetEnforcedVertexWithGroup(theFace, x, y, z, groupName)
326       pass
327     else:
328       if groupName == "":
329         return self.Parameters().SetEnforcedVertexNamed(theFace, x, y, z, vertexName)
330       else:
331         return self.Parameters().SetEnforcedVertexNamedWithGroup(theFace, x, y, z, vertexName, groupName)
332       pass
333     pass
334
335   ## To set an enforced vertex on a face (or group, compound) given a GEOM vertex, group or compound.
336   #  @param theFace      : GEOM face (or group, compound) on which to define an enforced vertex
337   #  @param theVertex    : GEOM vertex (or group, compound) to be projected on theFace.
338   #  @param groupName    : name of the group
339   def SetEnforcedVertexGeom(self, theFace, theVertex, groupName = ""):
340     from salome.smesh.smeshBuilder import AssureGeomPublished
341     AssureGeomPublished( self.mesh, theFace )
342     AssureGeomPublished( self.mesh, theVertex )
343     if groupName == "":
344       return self.Parameters().SetEnforcedVertexGeom(theFace, theVertex)
345     else:
346       return self.Parameters().SetEnforcedVertexGeomWithGroup(theFace, theVertex,groupName)
347     pass
348
349   ## To remove an enforced vertex on a given GEOM face (or group, compound) given the coordinates.
350   #  @param theFace      : GEOM face (or group, compound) on which to remove the enforced vertex
351   #  @param x            : x coordinate
352   #  @param y            : y coordinate
353   #  @param z            : z coordinate
354   def UnsetEnforcedVertex(self, theFace, x, y, z):
355     from salome.smesh.smeshBuilder import AssureGeomPublished
356     AssureGeomPublished( self.mesh, theFace )
357     return self.Parameters().UnsetEnforcedVertex(theFace, x, y, z)
358
359   ## To remove an enforced vertex on a given GEOM face (or group, compound) given a GEOM vertex, group or compound.
360   #  @param theFace      : GEOM face (or group, compound) on which to remove the enforced vertex
361   #  @param theVertex    : GEOM vertex (or group, compound) to remove.
362   def UnsetEnforcedVertexGeom(self, theFace, theVertex):
363     from salome.smesh.smeshBuilder import AssureGeomPublished
364     AssureGeomPublished( self.mesh, theFace )
365     AssureGeomPublished( self.mesh, theVertex )
366     return self.Parameters().UnsetEnforcedVertexGeom(theFace, theVertex)
367
368   ## To remove all enforced vertices on a given face.
369   #  @param theFace      : face (or group/compound of faces) on which to remove all enforced vertices
370   def UnsetEnforcedVertices(self, theFace):
371     from salome.smesh.smeshBuilder import AssureGeomPublished
372     AssureGeomPublished( self.mesh, theFace )
373     return self.Parameters().UnsetEnforcedVertices(theFace)
374
375   ## To tell BLSURF to add a node on internal vertices
376   #  @param toEnforceInternalVertices : boolean; if True the internal vertices are added as enforced vertices
377   def SetInternalEnforcedVertexAllFaces(self, toEnforceInternalVertices):
378     return self.Parameters().SetInternalEnforcedVertexAllFaces(toEnforceInternalVertices)
379
380   ## To know if BLSURF will add a node on internal vertices
381   def GetInternalEnforcedVertexAllFaces(self):
382     return self.Parameters().GetInternalEnforcedVertexAllFaces()
383
384   ## To define a group for the nodes of internal vertices
385   #  @param groupName : string; name of the group
386   def SetInternalEnforcedVertexAllFacesGroup(self, groupName):
387     return self.Parameters().SetInternalEnforcedVertexAllFacesGroup(groupName)
388
389   ## To get the group name of the nodes of internal vertices
390   def GetInternalEnforcedVertexAllFacesGroup(self):
391     return self.Parameters().GetInternalEnforcedVertexAllFacesGroup()
392
393   #-----------------------------------------
394   #  Attractors
395   #-----------------------------------------
396
397   ## 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 ]
398   #  @param theFace      : face on which the attractor will be defined
399   #  @param theAttractor : geometrical object from which the mesh size "h" decreases exponentially
400   #  @param theStartSize : mesh size on theAttractor
401   #  @param theEndSize   : maximum size that will be reached on theFace
402   #  @param theInfluenceDistance : influence of the attractor ( the size grow slower on theFace if it's high)
403   #  @param theConstantSizeDistance : distance until which the mesh size will be kept constant on theFace
404   def SetAttractorGeom(self, theFace, theAttractor, theStartSize, theEndSize, theInfluenceDistance, theConstantSizeDistance):
405     from salome.smesh.smeshBuilder import AssureGeomPublished
406     AssureGeomPublished( self.mesh, theFace )
407     AssureGeomPublished( self.mesh, theAttractor )
408     self.Parameters().SetAttractorGeom(theFace, theAttractor, theStartSize, theEndSize, theInfluenceDistance, theConstantSizeDistance)
409     pass
410
411   ## Unsets an attractor on the chosen face.
412   #  @param theFace      : face on which the attractor has to be removed
413   def UnsetAttractorGeom(self, theFace):
414     from salome.smesh.smeshBuilder import AssureGeomPublished
415     AssureGeomPublished( self.mesh, theFace )
416     self.Parameters().SetAttractorGeom(theFace)
417     pass
418
419   #-----------------------------------------
420   # Size maps (BLSURF)
421   #-----------------------------------------
422
423   ## To set a size map on a face, edge or vertex (or group, compound) given Python function.
424   #  If theObject is a face, the function can be: def f(u,v): return u+v
425   #  If theObject is an edge, the function can be: def f(t): return t/2
426   #  If theObject is a vertex, the function can be: def f(): return 10
427   #  @param theObject   : GEOM face, edge or vertex (or group, compound) on which to define a size map
428   #  @param theSizeMap  : Size map defined as a string
429   def SetSizeMap(self, theObject, theSizeMap):
430     from salome.smesh.smeshBuilder import AssureGeomPublished
431     AssureGeomPublished( self.mesh, theObject )
432     self.Parameters().SetSizeMap(theObject, theSizeMap)
433     pass
434
435   ## To set a constant size map on a face, edge or vertex (or group, compound).
436   #  @param theObject   : GEOM face, edge or vertex (or group, compound) on which to define a size map
437   #  @param theSizeMap  : Size map defined as a double
438   def SetConstantSizeMap(self, theObject, theSizeMap):
439     from salome.smesh.smeshBuilder import AssureGeomPublished
440     AssureGeomPublished( self.mesh, theObject )
441     self.Parameters().SetConstantSizeMap(theObject, theSizeMap)
442
443   ## To remove a size map defined on a face, edge or vertex (or group, compound)
444   #  @param theObject   : GEOM face, edge or vertex (or group, compound) on which to define a size map
445   def UnsetSizeMap(self, theObject):
446     from salome.smesh.smeshBuilder import AssureGeomPublished
447     AssureGeomPublished( self.mesh, theObject )
448     self.Parameters().UnsetSizeMap(theObject)
449     pass
450
451   ## To remove all the size maps
452   def ClearSizeMaps(self):
453     self.Parameters().ClearSizeMaps()
454     pass
455
456   ## Sets QuadAllowed flag.
457   #  @param toAllow "allow quadrangles" flag value
458   def SetQuadAllowed(self, toAllow=True):
459     self.Parameters().SetQuadAllowed(toAllow)
460     pass
461
462   ## Defines hypothesis having several parameters
463   #  @return hypothesis object
464   def Parameters(self):
465     if not self.params:
466       self.params = self.Hypothesis("MG-CADSurf Parameters", [],
467                                     LIBRARY, UseExisting=0)
468       pass
469     return self.params
470
471   #-----------------------------------------
472   # Periodicity (BLSURF with PreCAD)
473   #-----------------------------------------
474   
475   ## Defines periodicity between two groups of faces, using PreCAD
476   #  @param theFace1 : GEOM face (or group, compound) to associate with theFace2
477   #  @param theFace2 : GEOM face (or group, compound) associated with theFace1
478   #  @param theSourceVertices (optionnal): list of GEOM vertices on theFace1 defining the transformation from theFace1 to theFace2.
479   #    If None, PreCAD tries to find a simple translation. Else, need at least 3 not aligned vertices.
480   #  @param theTargetVertices (optionnal): list of GEOM vertices on theFace2 defining the transformation from theFace1 to theFace2.
481   #    If None, PreCAD tries to find a simple translation. Else, need at least 3 not aligned vertices.
482   def AddPreCadFacesPeriodicity(self, theFace1, theFace2, theSourceVertices=[], theTargetVertices=[]):
483     """calls preCad function:
484     status_t cad_add_face_multiple_periodicity_with_transformation_function(cad t *cad,
485           integer *fid1, integer size1, integer *fid2, integer size2,
486           periodicity_transformation_t transf, void *user data);
487     """
488     if theSourceVertices and theTargetVertices:
489       self.Parameters().AddPreCadFacesPeriodicityWithVertices(theFace1, theFace2, theSourceVertices, theTargetVertices)
490     else:
491       self.Parameters().AddPreCadFacesPeriodicity(theFace1, theFace2)
492     pass
493
494   ## Defines periodicity between two groups of edges, using PreCAD
495   #  @param theEdge1 : GEOM edge (or group, compound) to associate with theEdge2
496   #  @param theEdge2 : GEOM edge (or group, compound) associated with theEdge1
497   #  @param theSourceVertices (optionnal): list of GEOM vertices on theEdge1 defining the transformation from theEdge1 to theEdge2.
498   #    If None, PreCAD tries to find a simple translation. Else, need at least 3 not aligned vertices.
499   #  @param  theTargetVertices (optionnal): list of GEOM vertices on theEdge2 defining the transformation from theEdge1 to theEdge2.
500   #    If None, PreCAD tries to find a simple translation. Else, need at least 3 not aligned vertices.
501   def AddPreCadEdgesPeriodicity(self, theEdge1, theEdge2, theSourceVertices=[], theTargetVertices=[]):
502     """calls preCad function:
503     status_t cad_add_edge_multiple_periodicity_with_transformation_function(cad t *cad,
504           integer *eid1, integer size1, integer *eid2, integer size2,
505           periodicity_transformation_t transf, void *user data);
506     """
507     if theSourceVertices and theTargetVertices:
508         self.Parameters().AddPreCadEdgesPeriodicityWithVertices(theEdge1, theEdge2, theSourceVertices, theTargetVertices)
509     else:
510         self.Parameters().AddPreCadEdgesPeriodicity(theEdge1, theEdge2)
511     pass
512
513   #=====================
514   # Obsolete methods
515   #=====================
516   #
517   # SALOME 6.6.0
518   #
519
520   ## Sets lower boundary of mesh element size (PhySize).
521   def SetPhyMin(self, theVal=-1):
522     """
523     Obsolete function. Use SetMinSize.
524     """
525     print "Warning: SetPhyMin is obsolete. Please use SetMinSize"
526     self.SetMinSize(theVal)
527     pass
528
529   ## Sets upper boundary of mesh element size (PhySize).
530   def SetPhyMax(self, theVal=-1):
531     """
532     Obsolete function. Use SetMaxSize.
533     """
534     print "Warning: SetPhyMax is obsolete. Please use SetMaxSize"
535     self.SetMaxSize(theVal)
536     pass
537
538   ## Sets angular deflection (in degrees) of a mesh face from CAD surface.
539   def SetAngleMeshS(self, theVal=_geometric_approximation):
540     """
541     Obsolete function. Use SetAngleMesh.
542     """
543     print "Warning: SetAngleMeshS is obsolete. Please use SetAngleMesh"
544     self.SetAngleMesh(theVal)
545     pass
546
547   ## Sets angular deflection (in degrees) of a mesh edge from CAD curve.
548   def SetAngleMeshC(self, theVal=_geometric_approximation):
549     """
550     Obsolete function. Use SetAngleMesh.
551     """
552     print "Warning: SetAngleMeshC is obsolete. Please use SetAngleMesh"
553     self.SetAngleMesh(theVal)
554     pass
555
556   ## Sets lower boundary of mesh element size computed to respect angular deflection.
557   def SetGeoMin(self, theVal=-1):
558     """
559     Obsolete function. Use SetMinSize.
560     """
561     print "Warning: SetGeoMin is obsolete. Please use SetMinSize"
562     self.SetMinSize(theVal)
563     pass
564
565   ## Sets upper boundary of mesh element size computed to respect angular deflection.
566   def SetGeoMax(self, theVal=-1):
567     """
568     Obsolete function. Use SetMaxSize.
569     """
570     print "Warning: SetGeoMax is obsolete. Please use SetMaxSize"
571     self.SetMaxSize(theVal)
572     pass
573
574
575   pass # end of BLSURF_Algorithm class