Salome HOME
Implementation of 'GetEntriesToCleanStudy' function to get categorized lists of objects.
[modules/geom.git] / src / GEOM_SWIG / GEOM_TestHealing.py
index abe4a9810495f4343caee8535d33ee6dad880c6d..d3d7af966267191d690f1dde7a6692bedd9948b1 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -7,7 +7,7 @@
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 # License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
 #
 # This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,6 +19,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 
 #  GEOM_SWIG : binding of C++ implementaion with Python
 #  File   : GEOM_TestHealing.py
@@ -367,6 +368,25 @@ def TestFuseEdges (geompy):
     ii = ii + 1
     pass
 
+def TestRemoveWebs (geompy):
+
+  # create solids with some coincident faces
+  Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
+  Translation_1 = geompy.MakeTranslation(Box_1, 200, 0, 0)
+  Translation_2 = geompy.MakeTranslation(Box_1, 200, 200, 0)
+
+  geompy.addToStudy(Box_1, 'Box_1')
+  geompy.addToStudy(Translation_1, 'Translation_1')
+  geompy.addToStudy(Translation_2, 'Translation_2')
+
+  # partition three solids to obtain shared faces
+  Partition_1 = geompy.MakePartition([Box_1, Translation_1, Translation_2])
+  geompy.addToStudy(Partition_1, 'Partition_1')
+
+  # remove shared faces to obtain one solid instead of three
+  Joined_1 = geompy.RemoveInternalFaces(Partition_1)
+  geompy.addToStudy(Joined_1, 'Joined_1')
+
 def TestHealingOperations (geompy, math):
 
   TestMakeSewing(geompy, math)
@@ -377,3 +397,4 @@ def TestHealingOperations (geompy, math):
   TestSuppressFaces(geompy)
   TestProcessShape(geompy)
   TestFuseEdges(geompy)
+  TestRemoveWebs(geompy)