Salome HOME
8a045e0d051547b602d481317815c704d95af90d
[modules/geom.git] / src / GEOM_SWIG / GEOM_TestHealing.py
1 #  -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2023  CEA/DEN, EDF R&D, OPEN CASCADE
3 #
4 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 #
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License, or (at your option) any later version.
11 #
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 # Lesser General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
20 #
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #
23
24 #  GEOM_SWIG : binding of C++ implementation with Python
25 #  File   : GEOM_TestHealing.py
26 #  Author : Julia DOROVSKIKH
27 #  Module : GEOM
28
29 def TestProcessShape (geompy):
30
31   ##Load shape from BREP file
32   #import os
33   #datadir = os.getenv("GEOM_TEST")
34   #if datadir != 0:
35   #  datadir = datadir + "/Resources/"
36   #else:
37   #  "Please, define GEOM_TEST variable !"
38   #
39   #print "Import ", datadir + "aze2.brep"
40   #Shape = batchmode_geompy.Import(datadir + "aze2.brep", "BREP")
41
42   p1 = geompy.MakeVertex(0,0,0)
43   p2 = geompy.MakeVertex(200,0,0)
44   p3 = geompy.MakeVertex(100,150,0)
45
46   edge = geompy.MakeEdge(p1,p2)
47   arc  = geompy.MakeArc(p1,p3,p2)
48   wire = geompy.MakeWire([edge,arc])
49   face = geompy.MakeFace(wire, 1)
50
51   theShape = geompy.MakePrismVecH(face, edge, 130)
52
53   #Check shape
54   print("Before ProcessShape:")
55   isValid = geompy.CheckShape(theShape)
56   if isValid == 0:
57     print("The shape is not valid")
58   else:
59     print("The shape seems to be valid")
60
61   #Process Shape
62   Operators = ["FixShape"]
63   Parameters = ["FixShape.Tolerance3d"]
64   Values = ["1e-7"]
65
66   PS = geompy.ProcessShape(theShape, Operators, Parameters, Values)
67
68   #Check shape
69   print("After ProcessShape:")
70   isValid = geompy.CheckShape(PS)
71   if isValid == 0:
72     print("The shape is not valid")
73     raise RuntimeError("It seems, that the ProcessShape() has failed")
74   else:
75     print("The shape seems to be valid")
76
77   #Add In Study
78   Id_Shape = geompy.addToStudy(theShape, "Invalid Shape")
79   Id_PS    = geompy.addToStudy(PS, "Processed Shape")
80
81 def TestSuppressFaces (geompy):
82
83   #Create base geometry 3D
84   Box = geompy.MakeBoxDXDYDZ(200., 200., 200.)
85
86   #IDList for SuppHole
87   faces = []
88   faces = geompy.SubShapeAllSortedCentres(Box, geompy.ShapeType["FACE"])
89
90   f_glob_id = geompy.GetSubShapeID(Box, faces[5])
91
92   #Transform objects
93   SuppFace = geompy.SuppressFaces(Box, [f_glob_id])
94
95   #Add In Study
96   Id_SuppFace = geompy.addToStudy(SuppFace, "SuppFace")
97
98 def TestSuppressInternalWires (geompy):
99
100   #Create Face with hole
101   p11 = geompy.MakeVertex( 0,  0, 0)
102   p12 = geompy.MakeVertex(30,  0, 0)
103   p13 = geompy.MakeVertex(30, 30, 0)
104   p14 = geompy.MakeVertex( 0, 30, 0)
105
106   p21 = geompy.MakeVertex(10, 10, 0)
107   p22 = geompy.MakeVertex(20, 10, 0)
108   p23 = geompy.MakeVertex(20, 20, 0)
109   p24 = geompy.MakeVertex(10, 20, 0)
110
111   e11 = geompy.MakeEdge(p11, p12)
112   e12 = geompy.MakeEdge(p12, p13)
113   e13 = geompy.MakeEdge(p13, p14)
114   e14 = geompy.MakeEdge(p14, p11)
115
116   e21 = geompy.MakeEdge(p21, p22)
117   e22 = geompy.MakeEdge(p22, p23)
118   e23 = geompy.MakeEdge(p23, p24)
119   e24 = geompy.MakeEdge(p24, p21)
120
121   w1 = geompy.MakeWire([e11, e12, e13, e14])
122   w2 = geompy.MakeWire([e21, e22, e23, e24])
123
124   id_w1 = geompy.addToStudy(w1, "Outside Wire")
125   id_w2 = geompy.addToStudy(w2, "Inside Wire")
126
127   f12 = geompy.MakeFaceWires([w1, w2], 0)
128   id_f12 = geompy.addToStudy(f12, "Face WO + WI")
129
130   #Get Free Boundary
131   Res1 = geompy.GetFreeBoundary(f12)
132   isSuccess1   = Res1[0]
133   ClosedWires1 = Res1[1]
134   OpenWires1   = Res1[2]
135   nbw1 = 0
136
137   for wire in ClosedWires1:
138     nbw1 = nbw1 + 1
139
140   if nbw1 != 2:
141     raise RuntimeError("GetFreeBoundary(f12) must return 2 closed wires, but returned ").with_traceback(nbw1)
142
143   #SuppressInternalWires
144   face = geompy.SuppressInternalWires(f12, [])
145
146   #Get Free Boundary
147   Res2 = geompy.GetFreeBoundary(face)
148   isSuccess2   = Res2[0]
149   ClosedWires2 = Res2[1]
150   OpenWires2   = Res2[2]
151   nbw2 = 0
152
153   for wire in ClosedWires2:
154     nbw2 = nbw2 + 1
155
156   if nbw2 != 1:
157     print("GetFreeBoundary(face) must return 1 closed wires, but returned ", nbw2)
158     raise RuntimeError("SuppressInternalWires() works not correctly")
159
160   #Add In Study
161   Id_face = geompy.addToStudy(face, "Face without internal wires")
162
163 def TestCloseContour (geompy):
164
165   ##Load shape from BREP file
166   #import os
167   #datadir = os.getenv("GEOM_TEST")
168   #if datadir != 0:
169   #  datadir = datadir + "/Resources/"
170   #else:
171   #  "Please, define GEOM_TEST variable !"
172   #
173   #print "Import ", datadir + "open_cont.brep"
174   #Shape = geompy.Import(datadir + "open_cont.brep", "BREP")
175
176   p0   = geompy.MakeVertex(0.  , 0.  , 0.  )
177   py   = geompy.MakeVertex(0.  , 100., 0.  )
178   pz   = geompy.MakeVertex(0.  , 0.  , 100.)
179   p200 = geompy.MakeVertex(200., 200., 200.)
180
181   Shape = geompy.MakePolyline([p0, pz, py, p200])
182
183   #Check shape
184   print("Before closing contour:")
185   isValid = geompy.CheckShape(Shape)
186   if isValid == 0:
187     print("The shape is not valid")
188   else:
189     print("The shape seems to be valid")
190
191   #Close Contour
192   IsCommonVertex = 0 # false
193
194   shape_wires = geompy.SubShapeAll(Shape, geompy.ShapeType["WIRE"])
195   Wires = []
196   wi = 0
197
198   for wire in shape_wires:
199     Wires.append(geompy.GetSubShapeID(Shape, shape_wires[wi]))
200     wi = wi + 1
201
202   CC = geompy.CloseContour(Shape, Wires, IsCommonVertex)
203
204   #Check shape
205   print("After closing contour:")
206   isValid = geompy.CheckShape(CC)
207   if isValid == 0:
208     print("The shape is not valid")
209     raise RuntimeError("It seems, that the contour was not closed")
210   else:
211     print("The shape seems to be valid")
212
213   #Add In Study
214   Id_Shape = geompy.addToStudy(Shape, "Shape with open wire")
215   Id_CC    = geompy.addToStudy(CC, "Shape with closed wire")
216
217 def TestSuppressHoles (geompy):
218
219   #Create base Variables
220   radius = 50.
221   height = 300.
222
223   #Create base points
224   p1 = geompy.MakeVertex(100., 100., 50.)
225
226   #Create base directions
227   vz = geompy.MakeVectorDXDYDZ(0., 0., 100.)
228
229   #Create base geometry 3D
230   Box      = geompy.MakeBoxDXDYDZ(200., 200., 200.)
231   Cylinder = geompy.MakeCylinder(p1, vz, radius, height)
232
233   #Boolean (Cut)
234   Cut = geompy.MakeBoolean(Box, Cylinder, 2)
235   idCut = geompy.addToStudy(Cut, "CUT")
236
237   #IDList for SuppressFaces
238   faces = []
239   faces = geompy.SubShapeAllSortedCentres(Cut, geompy.ShapeType["FACE"])
240   ind = 0
241   for face in faces:
242       f_name = "FACE %d"%(ind)
243       f_id = geompy.addToStudyInFather(Cut, face, f_name)
244
245       f_glob_id = geompy.GetSubShapeID(Cut, face)
246       print("face ", ind, " global index = ", f_glob_id)
247       ind = ind + 1
248
249   f_glob_id_0 = geompy.GetSubShapeID(Cut, faces[0])
250   cut_without_f_0 = geompy.SuppressFaces(Cut, [f_glob_id_0])
251   geompy.addToStudy(cut_without_f_0, "Cut without face 0")
252
253   faces1 = []
254   faces1 = geompy.SubShapeAllSortedCentres(cut_without_f_0, geompy.ShapeType["FACE"])
255   ind = 0
256   for face in faces1:
257       f_name = "FACE %d"%(ind)
258       f_id = geompy.addToStudyInFather(cut_without_f_0, face, f_name)
259
260       f_glob_id = geompy.GetSubShapeID(cut_without_f_0, face)
261       print("face ", ind, " global index = ", f_glob_id)
262       ind = ind + 1
263
264   f_glob_id_3 = geompy.GetSubShapeID(cut_without_f_0, faces1[3])
265   cut_without_f_0_3 = geompy.SuppressFaces(cut_without_f_0, [f_glob_id_3])
266   cut_without_f_0_3_id = geompy.addToStudy(cut_without_f_0_3, "Cut without faces 0 and 3")
267
268   #IDList for SuppHole
269   wires = []
270   wires = geompy.SubShapeAllSortedCentres(cut_without_f_0_3, geompy.ShapeType["WIRE"])
271   ind = 0
272   for wire in wires:
273       w_name = "WIRE %d"%(ind)
274       w_id = geompy.addToStudyInFather(cut_without_f_0_3, wire, w_name)
275
276       w_glob_id = geompy.GetSubShapeID(cut_without_f_0_3, wire)
277       print("wire ", ind, " global index = ", w_glob_id)
278       ind = ind + 1
279
280   w_3 = geompy.GetSubShapeID(cut_without_f_0_3, wires[3])
281
282   SuppHole3 = geompy.SuppressHoles(cut_without_f_0_3, [w_3])
283   SuppHole3_id = geompy.addToStudy(SuppHole3, "Supp Hole 3")
284
285 def TestMakeSewing (geompy, math):
286
287   #Create base points
288   px = geompy.MakeVertex(100., 0., 0.)
289   py = geompy.MakeVertex(0., 100., 0.)
290   pz = geompy.MakeVertex(0., 0., 100.)
291
292   #Create base geometry 2D & 3D
293   Vector = geompy.MakeVector(px, py)
294   Arc    = geompy.MakeArc(py, pz, px)
295
296   #Create base objects
297   angle     = 45. * math.pi / 180
298   WantPlanarFace = 1 #True
299
300   Wire = geompy.MakeWire([Vector, Arc])
301   Face = geompy.MakeFace(Wire, WantPlanarFace)
302   S    = geompy.MakeRotation(Face, Vector, angle)
303
304   #Make Sewing
305   precision = 0.00001
306   Sewing = geompy.MakeSewing([Face, S], precision)
307
308   #Add In Study
309   id_Sewing = geompy.addToStudy(Sewing, "Sewing")
310
311 def TestDivideEdge (geompy):
312
313   #Create Box
314   Box = geompy.MakeBoxDXDYDZ(200., 200., 200.)
315
316   #Divide Edge
317   box_edges = geompy.SubShapeAllSortedCentres(Box, geompy.ShapeType["EDGE"])
318   edge_ind = geompy.GetSubShapeID(Box, box_edges[1])
319
320   Divide = geompy.DivideEdge(Box, edge_ind, 0.5, 1) # Obj, ind, param, is_curve_param
321
322   #Add In Study
323   Id_Box    = geompy.addToStudy(Box, "Box")
324   Id_Divide = geompy.addToStudy(Divide, "Box with Divided Edge")
325
326   # using geompy.DivideEdgeByPoint()
327   p    = geompy.MakeVertex( 30, -5, 10, theName="Point to project" )
328   edge = geompy.GetEdgeNearPoint( Box, p, theName="Edge to split")
329   div  = geompy.DivideEdgeByPoint( Box, edge, p, theName="Box (edge divided)")
330   assert geompy.NumberOfEdges( Box ) == geompy.NumberOfEdges( div ) - 1
331
332 def TestFuseEdges (geompy):
333
334   # create vertices
335   p1 = geompy.MakeVertex(0, 0, 0)
336   p2 = geompy.MakeVertex(70, 0, 0)
337   p3 = geompy.MakeVertex(70, 50, 0)
338   p4 = geompy.MakeVertex(70, 80, 0)
339   p5 = geompy.MakeVertex(50, 80, 0)
340   p6 = geompy.MakeVertex(20, 80, 0)
341   p7 = geompy.MakeVertex(0, 80, 0)
342   p8 = geompy.MakeVertex(0, 30, 0)
343
344   points = [p1, p2, p3, p4, p5, p6, p7, p8]
345
346   # make a wire
347   wire_1 = geompy.MakePolyline(points, True)
348
349   # suppress some vertices in the wire
350   wire_2 = geompy.FuseCollinearEdgesWithinWire(wire_1, [p3])
351   wire_3 = geompy.FuseCollinearEdgesWithinWire(wire_1, [p5, p6])
352
353   # suppress all suitable vertices in the wire
354   wire_4 = geompy.FuseCollinearEdgesWithinWire(wire_1, [])
355
356   wires = [wire_1, wire_2, wire_3, wire_4]
357
358   # add objects in the study
359   ii = 1
360   for point in points:
361     geompy.addToStudy(point, "p%d"%ii)
362     ii = ii + 1
363     pass
364
365   ii = 1
366   for wire in wires:
367     geompy.addToStudy(wire, "wire_%d"%ii)
368     wire_points = geompy.SubShapeAllSortedCentres(wire, geompy.ShapeType["VERTEX"])
369     jj = 1
370     for point in wire_points:
371       geompy.addToStudyInFather(wire, point, "point_%d"%jj)
372       jj = jj + 1
373       pass
374     ii = ii + 1
375     pass
376
377 def TestRemoveWebs (geompy):
378
379   # create solids with some coincident faces
380   Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
381   Translation_1 = geompy.MakeTranslation(Box_1, 200, 0, 0)
382   Translation_2 = geompy.MakeTranslation(Box_1, 200, 200, 0)
383
384   geompy.addToStudy(Box_1, 'Box_1')
385   geompy.addToStudy(Translation_1, 'Translation_1')
386   geompy.addToStudy(Translation_2, 'Translation_2')
387
388   # partition three solids to obtain shared faces
389   Partition_1 = geompy.MakePartition([Box_1, Translation_1, Translation_2])
390   geompy.addToStudy(Partition_1, 'Partition_1')
391
392   # remove shared faces to obtain one solid instead of three
393   Joined_1 = geompy.RemoveInternalFaces(Partition_1)
394   geompy.addToStudy(Joined_1, 'Joined_1')
395
396 def TestSewGluing(geompy):
397
398   import GEOM
399   box1 = geompy.MakeBox(0,0,0, 1,1,1)
400   box2 = geompy.MakeBox(1,0,0, 2,1,1)
401   comp = geompy.MakeCompound( [box1, box2] )
402
403   # no sewing with AllowNonManifold=False
404   sew1 = geompy.MakeSewing( [box1,box2], 1e-5, AllowNonManifold=False)
405   assert not sew1
406   sew2 = geompy.MakeSewing( comp, 1e-5, AllowNonManifold=False)
407   assert not sew2
408   sew3 = geompy.MakeSewing( [comp], 1e-5, AllowNonManifold=False)
409   assert not sew3
410   sew1 = geompy.Sew( [box1,box2], 1e-5, AllowNonManifold=False)
411   assert not sew1
412   sew2 = geompy.Sew( comp, 1e-5, AllowNonManifold=False)
413   assert not sew2
414   sew3 = geompy.Sew( [comp], 1e-5, AllowNonManifold=False)
415   assert not sew3
416
417   # check MakeSewing()
418   sew1 = geompy.MakeSewing( [box1,box2], 1e-5, AllowNonManifold=True)
419   assert sew1.GetShapeType() == GEOM.SHELL
420   assert geompy.NumberOfFaces( sew1 ) == geompy.NumberOfFaces( comp )
421   assert geompy.NumberOfEdges( sew1 ) == geompy.NumberOfEdges( comp ) - 4
422   sew2 = geompy.MakeSewing( comp, 1e-5, AllowNonManifold=True)
423   assert sew2.GetShapeType() == GEOM.SHELL
424   assert geompy.NumberOfFaces( sew2 ) == geompy.NumberOfFaces( comp )
425   assert geompy.NumberOfEdges( sew2 ) == geompy.NumberOfEdges( comp ) - 4
426   sew3 = geompy.MakeSewing( [comp], 1e-5, AllowNonManifold=True)
427   assert sew3.GetShapeType() == GEOM.SHELL
428   assert geompy.NumberOfFaces( sew3 ) == geompy.NumberOfFaces( comp )
429   assert geompy.NumberOfEdges( sew3 ) == geompy.NumberOfEdges( comp ) - 4
430   # check Sew()
431   sew1 = geompy.Sew( [box1,box2], 1e-5, AllowNonManifold=True)
432   assert sew1.GetShapeType() == GEOM.SHELL
433   assert geompy.NumberOfFaces( sew1 ) == geompy.NumberOfFaces( comp )
434   assert geompy.NumberOfEdges( sew1 ) == geompy.NumberOfEdges( comp ) - 4
435   sew2 = geompy.Sew( comp, 1e-5, AllowNonManifold=True)
436   assert sew2.GetShapeType() == GEOM.SHELL
437   assert geompy.NumberOfFaces( sew2 ) == geompy.NumberOfFaces( comp )
438   assert geompy.NumberOfEdges( sew2 ) == geompy.NumberOfEdges( comp ) - 4
439   sew3 = geompy.Sew( [comp], 1e-5, AllowNonManifold=True)
440   assert sew3.GetShapeType() == GEOM.SHELL
441   assert geompy.NumberOfFaces( sew3 ) == geompy.NumberOfFaces( comp )
442   assert geompy.NumberOfEdges( sew3 ) == geompy.NumberOfEdges( comp ) - 4
443
444   # check MakeGlueFaces()
445   glueF1 = geompy.MakeGlueFaces( [box1,box2], 1e-5)
446   assert glueF1.GetShapeType() == GEOM.COMPOUND
447   assert geompy.NumberOfFaces( glueF1 ) == geompy.NumberOfFaces( comp ) - 1
448   assert geompy.NumberOfEdges( glueF1 ) == geompy.NumberOfEdges( comp ) - 4
449   glueF2 = geompy.MakeGlueFaces( [comp], 1e-5)
450   assert glueF2.GetShapeType() == GEOM.COMPOUND
451   assert geompy.NumberOfFaces( glueF2 ) == geompy.NumberOfFaces( comp ) - 1
452   assert geompy.NumberOfEdges( glueF2 ) == geompy.NumberOfEdges( comp ) - 4
453   glueF3 = geompy.MakeGlueFaces( comp, 1e-5)
454   assert glueF3.GetShapeType() == GEOM.COMPOUND
455   assert geompy.NumberOfFaces( glueF3 ) == geompy.NumberOfFaces( comp ) - 1
456   assert geompy.NumberOfEdges( glueF3 ) == geompy.NumberOfEdges( comp ) - 4
457
458   # check GetGlueFaces()
459   glueFF1 = geompy.GetGlueFaces( [box1,box2], 1e-5)
460   assert len( glueFF1 ) == 1 and glueFF1[0].GetShapeType() == GEOM.FACE
461   glueFF2 = geompy.GetGlueFaces( [comp], 1e-5)
462   assert len( glueFF2 ) == 1 and glueFF2[0].GetShapeType() == GEOM.FACE
463   glueFF3 = geompy.GetGlueFaces( comp, 1e-5)
464   assert len( glueFF3 ) == 1 and glueFF3[0].GetShapeType() == GEOM.FACE
465
466   #check MakeGlueFacesByList()
467   glueF1 = geompy.MakeGlueFacesByList( [box1,box2], 1e-5, glueFF1)
468   assert glueF1.GetShapeType() == GEOM.COMPOUND
469   assert geompy.NumberOfFaces( glueF1 ) == geompy.NumberOfFaces( comp ) - 1
470   assert geompy.NumberOfEdges( glueF1 ) == geompy.NumberOfEdges( comp ) - 4
471   glueF2 = geompy.MakeGlueFacesByList( [comp], 1e-5, glueFF2)
472   assert glueF2.GetShapeType() == GEOM.COMPOUND
473   assert geompy.NumberOfFaces( glueF2 ) == geompy.NumberOfFaces( comp ) - 1
474   assert geompy.NumberOfEdges( glueF2 ) == geompy.NumberOfEdges( comp ) - 4
475   glueF3 = geompy.MakeGlueFacesByList( comp, 1e-5, glueFF3 )
476   assert glueF3.GetShapeType() == GEOM.COMPOUND
477   assert geompy.NumberOfFaces( glueF3 ) == geompy.NumberOfFaces( comp ) - 1
478   assert geompy.NumberOfEdges( glueF3 ) == geompy.NumberOfEdges( comp ) - 4
479
480   # check MakeGlueEdges()
481   glueE1 = geompy.MakeGlueEdges( [box1,box2], 1e-5)
482   assert glueE1.GetShapeType() == GEOM.COMPOUND
483   assert geompy.NumberOfEdges( glueE1 ) == geompy.NumberOfEdges( comp ) - 4
484   glueE2 = geompy.MakeGlueEdges( [comp], 1e-5)
485   assert glueE2.GetShapeType() == GEOM.COMPOUND
486   assert geompy.NumberOfEdges( glueE2 ) == geompy.NumberOfEdges( comp ) - 4
487   glueE3 = geompy.MakeGlueEdges( comp, 1e-5)
488   assert glueE3.GetShapeType() == GEOM.COMPOUND
489   assert geompy.NumberOfEdges( glueE3 ) == geompy.NumberOfEdges( comp ) - 4
490
491   # check GetGlueEdges()
492   glueEE1 = geompy.GetGlueEdges( [box1,box2], 1e-5)
493   assert len( glueEE1 ) == 4 and glueEE1[0].GetShapeType() == GEOM.EDGE
494   glueEE2 = geompy.GetGlueEdges( [comp], 1e-5)
495   assert len( glueEE2 ) == 4 and glueEE2[0].GetShapeType() == GEOM.EDGE
496   glueEE3 = geompy.GetGlueEdges( comp, 1e-5)
497   assert len( glueEE3 ) == 4 and glueEE3[0].GetShapeType() == GEOM.EDGE
498
499   #check MakeGlueEdgesByList()
500   glueEL1 = geompy.MakeGlueEdgesByList( [box1,box2], 1e-5, glueEE1)
501   assert glueEL1.GetShapeType() == GEOM.COMPOUND
502   assert geompy.NumberOfEdges( glueEL1 ) == geompy.NumberOfEdges( comp ) - 4
503   glueEL2 = geompy.MakeGlueEdgesByList( [comp], 1e-5, glueEE2)
504   assert glueEL2.GetShapeType() == GEOM.COMPOUND
505   assert geompy.NumberOfEdges( glueEL2 ) == geompy.NumberOfEdges( comp ) - 4
506   glueEL3 = geompy.MakeGlueEdgesByList( comp, 1e-5, glueEE3 )
507   assert glueEL3.GetShapeType() == GEOM.COMPOUND
508   assert geompy.NumberOfEdges( glueEL3 ) == geompy.NumberOfEdges( comp ) - 4
509
510   # check GetSharedShapesMulti()
511   sharedEE = geompy.GetSharedShapesMulti( glueEL3, geompy.ShapeType["EDGE"])
512   assert len( sharedEE ) == 4
513   assert sharedEE[0].GetShapeType() == GEOM.EDGE
514   assert sharedEE[1].GetShapeType() == GEOM.EDGE
515   assert sharedEE[2].GetShapeType() == GEOM.EDGE
516   assert sharedEE[3].GetShapeType() == GEOM.EDGE
517
518   return
519
520 def TestHealingOperations (geompy, math):
521
522   TestSewGluing(geompy)
523   TestMakeSewing(geompy, math)
524   TestDivideEdge(geompy)
525   TestSuppressHoles(geompy)
526   TestSuppressInternalWires(geompy)
527   TestCloseContour(geompy)
528   TestSuppressFaces(geompy)
529   TestProcessShape(geompy)
530   TestFuseEdges(geompy)
531   TestRemoveWebs(geompy)