1 # Copyright (C) 2014-2022 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 email : webmaster.salome@opencascade.com
20 from salome.shaper import model
21 from SketchAPI import *
25 partSet = model.moduleDocument()
27 Part_1 = model.addPart(partSet)
28 Part_1_doc = Part_1.document()
31 Box_1 = model.addBox(Part_1_doc, 100, 50, 100)
33 Filters = model.filters(Part_1_doc, [model.addFilter(name = "FaceSize", args = [ "inf" , 5000.0 ])])
37 model.selection("FACE", "Box_1_1/Top"): False,
38 model.selection("FACE", "Box_1_1/Back"): False,
39 model.selection("FACE", "Box_1_1/Front"): False,
40 model.selection("FACE", "Box_1_1/Bottom"): False,
41 model.selection("FACE","Box_1_1/Right"): False,
42 model.selection("FACE","Box_1_1/Left"): False}
44 model.checkFilter(Part_1_doc, model, Filters, Reference)
47 Filters = model.filters(Part_1_doc, [model.addFilter(name = "FaceSize", args = [ "infEq" , 5000.0 ])])
51 model.selection("FACE", "Box_1_1/Top"): True,
52 model.selection("FACE", "Box_1_1/Back"): True,
53 model.selection("FACE", "Box_1_1/Front"): True,
54 model.selection("FACE", "Box_1_1/Bottom"): True,
55 model.selection("FACE", "Box_1_1/Right"): False,
56 model.selection("FACE", "Box_1_1/Left"): False}
58 model.checkFilter(Part_1_doc, model, Filters, Reference)
61 Filters = model.filters(Part_1_doc, [model.addFilter(name = "FaceSize", args = [ "sup" , 5000.0 ])])
65 model.selection("FACE", "Box_1_1/Top"): False,
66 model.selection("FACE", "Box_1_1/Back"): False,
67 model.selection("FACE", "Box_1_1/Front"): False,
68 model.selection("FACE", "Box_1_1/Bottom"): False,
69 model.selection("FACE", "Box_1_1/Right"): True,
70 model.selection("FACE", "Box_1_1/Left"): True}
72 model.checkFilter(Part_1_doc, model, Filters, Reference)
75 Filters = model.filters(Part_1_doc, [model.addFilter(name = "FaceSize", args = [ "inf" , 50.0 ])])
79 model.selection("FACE", "Box_1_1/Top"): False,
80 model.selection("FACE", "Box_1_1/Back"): False,
81 model.selection("FACE", "Box_1_1/Front"): False,
82 model.selection("FACE", "Box_1_1/Bottom"): False,
83 model.selection("FACE", "Box_1_1/Right"): False,
84 model.selection("FACE", "Box_1_1/Left"): False}
86 model.checkFilter(Part_1_doc, model, Filters, Reference)
89 Filters = model.filters(Part_1_doc, [model.addFilter(name = "FaceSize", args = [ "supEq" , 5000.0 ])])
93 model.selection("FACE", "Box_1_1/Top"): True,
94 model.selection("FACE", "Box_1_1/Back"): True,
95 model.selection("FACE", "Box_1_1/Front"): True,
96 model.selection("FACE", "Box_1_1/Bottom"): True,
97 model.selection("FACE", "Box_1_1/Right"): True,
98 model.selection("FACE", "Box_1_1/Left"): True}
100 model.checkFilter(Part_1_doc, model, Filters, Reference)
103 Filters = model.filters(Part_1_doc, [model.addFilter(name = "FaceSize", args = [ "supEq" , 7000.0 ])])
107 model.selection("FACE", "Box_1_1/Top"): False,
108 model.selection("FACE", "Box_1_1/Back"): False,
109 model.selection("FACE", "Box_1_1/Front"): False,
110 model.selection("FACE", "Box_1_1/Bottom"): False,
111 model.selection("FACE", "Box_1_1/Right"): True,
112 model.selection("FACE", "Box_1_1/Left"): True}
114 model.checkFilter(Part_1_doc, model, Filters, Reference)
117 Filters = model.filters(Part_1_doc, [model.addFilter(name = "FaceSize", args = [ "isBetween" , 50.0 , 10000.0])])
121 model.selection("FACE", "Box_1_1/Top"): True,
122 model.selection("FACE", "Box_1_1/Back"): True,
123 model.selection("FACE", "Box_1_1/Front"): True,
124 model.selection("FACE", "Box_1_1/Bottom"): True,
125 model.selection("FACE", "Box_1_1/Right"): True,
126 model.selection("FACE", "Box_1_1/Left"): True}
128 model.checkFilter(Part_1_doc, model, Filters, Reference)
131 Filters = model.filters(Part_1_doc, [model.addFilter(name = "FaceSize", args = [ "isStrictlyBetween" , 500.0 , 10000.0])])
135 model.selection("FACE", "Box_1_1/Top"): True,
136 model.selection("FACE", "Box_1_1/Back"): True,
137 model.selection("FACE", "Box_1_1/Front"): True,
138 model.selection("FACE", "Box_1_1/Bottom"): True,
139 model.selection("FACE", "Box_1_1/Right"): False,
140 model.selection("FACE", "Box_1_1/Left"): False}
142 model.checkFilter(Part_1_doc, model, Filters, Reference)