X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOM_SWIG%2FGEOM_TestMeasures.py;h=7ad571552f9104b8b77ad2422c0a9cf514ac96cf;hb=326bf4caf8410a271a8a4ed3f41461fcccdde22f;hp=22657306d5e95e9e4764fd7c81714d18ee3d8621;hpb=97c05bd172eb333540395044a41bb3e1160ffc48;p=modules%2Fgeom.git diff --git a/src/GEOM_SWIG/GEOM_TestMeasures.py b/src/GEOM_SWIG/GEOM_TestMeasures.py index 22657306d..7ad571552 100644 --- a/src/GEOM_SWIG/GEOM_TestMeasures.py +++ b/src/GEOM_SWIG/GEOM_TestMeasures.py @@ -1,5 +1,5 @@ # -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2015 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 @@ -21,6 +21,8 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +import salome_version + def TestMeasureOperations (geompy, math): p0 = geompy.MakeVertex(0 , 0, 0) @@ -31,8 +33,12 @@ def TestMeasureOperations (geompy, math): p678 = geompy.MakeVertex(60, 70, 80) p789 = geompy.MakeVertex(70, 80, 90) + vz = geompy.MakeVectorDXDYDZ(0, 0, 1) + cube = geompy.MakeBoxTwoPnt(p678, p789) + cylinder = geompy.MakeCylinder(p0, vz, 5, 70) + ####### PointCoordinates ####### Coords = geompy.PointCoordinates(p137) @@ -50,16 +56,19 @@ def TestMeasureOperations (geompy, math): ####### Detect Self-intersections ####### - [Face_1,Face_2] = geompy.SubShapes(box, [33, 23]) - Translation_1 = geompy.MakeTranslation(Face_1, 5, -15, -40) - Compound_1 = geompy.MakeCompound([Face_2, Translation_1]) - if geompy.CheckSelfIntersections(Compound_1) == True: + selfIntersected = geompy.MakeCompound([box, cylinder]) + if geompy.CheckSelfIntersections(selfIntersected): raise RuntimeError, "Existing self-intersection is not detected" - ####### Detect Fast intersection ####### + ####### Detect Self-intersections fast ####### + + if salome_version.getXVersion() > "0x70600": + if geompy.CheckSelfIntersectionsFast(selfIntersected): + raise RuntimeError, "Existing self-intersection is not detected" + + ####### Fast intersection ####### - cylinder = geompy.MakeCylinderRH(100, 300) - if geompy.FastIntersect(box, cylinder) == False: + if not geompy.FastIntersect(box, cylinder)[0]: raise RuntimeError, "Existing intersection is not detected" ####### WhatIs #######