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>
22 Test case for Construction Point feature as intersection of line and plane.
25 from salome.shaper import model
29 partSet = model.moduleDocument()
30 Sketch_1 = model.addSketch(partSet, model.defaultPlane("XOY"))
31 SketchPoint_1 = Sketch_1.addPoint(model.selection("VERTEX", "Origin"))
32 SketchCircle_1 = Sketch_1.addCircle(0, 0, 60)
33 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchPoint_1.result(), SketchCircle_1.center())
35 Sketch_2 = model.addSketch(partSet, model.defaultPlane("XOZ"))
36 SketchLine_1 = Sketch_2.addLine(60, 100, 0, 20)
37 SketchArc_1 = Sketch_2.addArc(0, 0, -65.89631323066888, 61.2998850129882, -90, 0, False)
40 # point by sketch face and a line
41 Point_1 = model.addPoint(partSet, model.selection("EDGE", "Sketch_2/Edge-SketchLine_1"), model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f"))
43 # check the point position
44 rightPosition = GeomAPI_Vertex(-15, 0, 0)
45 assert(rightPosition.isEqual(Point_1.results()[0].resultSubShapePair()[0].shape()))
47 # point by sketch face and an arc, intersection outside of the face, offset is defined
48 Point_2 = model.addPoint(partSet, model.selection("EDGE", "Sketch_2/Edge-SketchArc_1"), model.selection("FACE", "Sketch_1/Face-SketchCircle_1_2f"), 10, True)
49 # check the point position
50 rightPosition = GeomAPI_Vertex(-89.442719099991606, 0, -10)
51 assert(rightPosition.isEqual(Point_2.results()[0].resultSubShapePair()[0].shape()))
55 assert(model.checkPythonDump())