1 ## Copyright (C) 2014-2017 CEA/DEN, EDF R&D
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.
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.
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
17 ## See http:##www.salome-platform.org/ or
18 ## email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 from GeomAlgoAPI import GeomAlgoAPI_ShapeAPI as shaperpy
22 from GeomAlgoAPI import GeomAlgoAPI_Exception as myExcept
23 from GeomAPI import GeomAPI_Pnt as pnt
25 CS1 = shaperpy.makeConeSegment(7.,11.,5.,8.,12.,0.,270.)
26 CS2 = shaperpy.makeConeSegment(5.,10.,7.,15.,15.,45.,180.)
27 CS3 = shaperpy.makeConeSegment(5.,10.,7.,15.,15.,-45.,180.)
28 CS4 = shaperpy.makeConeSegment(0.,10.,2.,7.,3.,0.,270.)
29 CS5 = shaperpy.makeConeSegment(5.,8.,0.,6.,10.,45.,270.)
30 CS6 = shaperpy.makeConeSegment(0.,6.,0.,4.,17.,0.,270.)
31 CS7 = shaperpy.makeConeSegment(7.,11.,5.,8.,12.,0.,360.)
34 CS8 = shaperpy.makeConeSegment(-5.,11.,5.,8.,12.,0.,270.)
35 except myExcept as ec:
36 assert(ec.what() == "Cone Segment builder :: rmin1 is negative.")
39 CS9 = shaperpy.makeConeSegment(11.,7.,5.,8.,12.,0.,270.)
40 except myExcept as ec:
41 assert(ec.what() == "Cone Segment builder :: rmin1 is larger than rmax1.")
44 CS10 = shaperpy.makeConeSegment(7.,11.,8.,5.,12.,0.,270.)
45 except myExcept as ec:
46 assert(ec.what() == "Cone Segment builder :: rmin2 is larger than rmax2.")
49 CS11 = shaperpy.makeConeSegment(7.,11.,-3.,5.,12.,0.,270.)
50 except myExcept as ec:
51 assert(ec.what() == "Cone Segment builder :: rmin2 is negative.")
54 CS12 = shaperpy.makeConeSegment(7.,11.,5.,8.,0.,0.,270.)
55 except myExcept as ec:
56 assert(ec.what() == "Cone Segment builder :: z is negative or null.")
59 CS13 = shaperpy.makeConeSegment(7.,11.,5.,8.,-10.,0.,270.)
60 except myExcept as ec:
61 assert(ec.what() == "Cone Segment builder :: z is negative or null.")
64 CS14 = shaperpy.makeConeSegment(7.,11.,5.,8.,12.,-45.,-45.)
65 except myExcept as ec:
66 assert(ec.what() == "Cone Segment builder :: deltaphi is negative or null.")
69 CS15 = shaperpy.makeConeSegment(7.,11.,5.,8.,12.,45.,450.)
70 except myExcept as ec:
71 assert(ec.what() == "Cone Segment builder :: deltaphi is larger than 360 degree.")