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 TestFilletInteracting.py
23 Unit test of SketchPlugin_Fillet feature.
24 In scope of interaction with another constraints applied to filleted features.
28 from GeomDataAPI import *
29 from ModelAPI import *
30 from SketchAPI import *
33 from salome.shaper import model
35 __updated__ = "2017-03-06"
37 def isArcLineSmooth(theArc, theLine, theTolerance):
38 aCenter = geomDataAPI_Point2D(theArc.attribute("center_point"))
39 aDistance = model.distancePointLine(aCenter, theLine)
40 aRadius = arcRadius(theArc)
41 return math.fabs(aRadius - aDistance) < theTolerance
43 def isArcArcSmooth(theArc1, theArc2, theTolerance):
44 aCenter1 = geomDataAPI_Point2D(theArc1.attribute("center_point"))
45 aCenter2 = geomDataAPI_Point2D(theArc2.attribute("center_point"))
46 aDistance = model.distancePointPoint(aCenter1, aCenter2)
47 aRadius1 = arcRadius(theArc1)
48 aRadius2 = arcRadius(theArc2)
49 aRadSum = aRadius1 + aRadius2
50 aRadDiff = math.fabs(aRadius1 - aRadius2)
51 return math.fabs(aDistance - aRadSum) < theTolerance or math.fabs(aDistance - aRadDiff) < theTolerance
53 def arcRadius(theArc):
54 aCenter = geomDataAPI_Point2D(theArc.attribute("center_point"))
55 aStart = geomDataAPI_Point2D(theArc.attribute("start_point"))
56 return model.distancePointPoint(aCenter, aStart)
60 class TestFilletInteracting(unittest.TestCase):
63 self.myDocument = model.moduleDocument()
64 self.mySketch = model.addSketch(self.myDocument, model.defaultPlane("XOY"))
65 self.myTolerance = 1.e-6
70 self.assertTrue(model.checkPythonDump())
75 self.assertEqual(model.dof(self.mySketch), self.myDOF)
77 def collectFeatures(self):
79 for aSubObj in self.mySketch.features().list():
80 aFeature = ModelAPI.ModelAPI_Feature.feature(aSubObj)
81 if aFeature is not None:
82 if self.myFeatures.get(aFeature.getKind()) == None:
83 self.myFeatures[aFeature.getKind()] = 1
85 self.myFeatures[aFeature.getKind()] += 1
87 def checkNbFeatures(self, theFeatureKind, theFeatureCount):
88 if theFeatureCount == 0:
89 self.assertIsNone(self.myFeatures.get(theFeatureKind))
91 self.assertIsNotNone(self.myFeatures.get(theFeatureKind), "No features of kind {0} but expected {1}".format(theFeatureKind, theFeatureCount))
92 self.assertEqual(self.myFeatures[theFeatureKind], theFeatureCount, "Observed number of {0} is {1} but expected {2}".format(theFeatureKind, self.myFeatures[theFeatureKind], theFeatureCount))
94 def checkFillet(self):
95 aPtPtCoincidences = self.getCoincidences()
96 for coinc in aPtPtCoincidences:
97 aConnectedFeatures = self.connectedFeatures(coinc)
98 self.assertEqual(len(aConnectedFeatures), 2)
99 if aConnectedFeatures[0].getKind() == "SketchArc":
100 if aConnectedFeatures[1].getKind() == "SketchArc":
101 self.assertTrue(isArcArcSmooth(aConnectedFeatures[0], aConnectedFeatures[1], self.myTolerance))
102 elif aConnectedFeatures[1].getKind() == "SketchLine":
103 self.assertTrue(isArcLineSmooth(aConnectedFeatures[0], aConnectedFeatures[1], self.myTolerance))
104 elif aConnectedFeatures[0].getKind() == "SketchLine" and aConnectedFeatures[1].getKind() == "SketchArc":
105 self.assertTrue(isArcLineSmooth(aConnectedFeatures[1], aConnectedFeatures[0], self.myTolerance))
107 def getCoincidences(self):
109 for aSubObj in self.mySketch.features().list():
110 aSubFeature = ModelAPI.ModelAPI_Feature.feature(aSubObj)
111 if aSubFeature is not None and aSubFeature.getKind() == "SketchConstraintCoincidence":
112 anEntityA = aSubFeature.refattr("ConstraintEntityA")
113 anEntityB = aSubFeature.refattr("ConstraintEntityB")
114 if not anEntityA.isObject() and not anEntityB.isObject():
115 aCoincidences.append(aSubFeature)
118 def connectedFeatures(self, theCoincidence):
119 anEntityA = theCoincidence.refattr("ConstraintEntityA")
120 anEntityB = theCoincidence.refattr("ConstraintEntityB")
121 aFeatureA = ModelAPI.ModelAPI_Feature.feature(anEntityA.attr().owner())
122 aFeatureB = ModelAPI.ModelAPI_Feature.feature(anEntityB.attr().owner())
123 return [aFeatureA, aFeatureB]
126 def test_fillet_two_lines(self):
127 """ Test 1. Fillet on two connected lines
129 aSketchLineA = self.mySketch.addLine(10., 10., 20., 10.)
130 aSketchLineB = self.mySketch.addLine(10., 10., 10., 20.)
133 self.mySketch.setCoincident(aSketchLineA.startPoint(), aSketchLineB.startPoint())
137 self.mySketch.setFillet(aSketchLineA.startPoint())
143 self.collectFeatures()
144 self.checkNbFeatures("SketchLine", 2)
145 self.checkNbFeatures("SketchArc", 1)
146 self.checkNbFeatures("SketchConstraintCoincidence", 2)
147 self.checkNbFeatures("SketchConstraintTangent", 2)
148 self.checkNbFeatures("SketchFillet", 0)
150 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
151 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [3])
152 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
154 def test_wrong_fillet_two_lines(self):
155 """ Test 2. Check the fillet is wrong on two connected lines when selecting incorrect point
157 aSketchLineA = self.mySketch.addLine(10., 10., 20., 10.)
158 aSketchLineB = self.mySketch.addLine(10., 10., 10., 20.)
161 self.mySketch.setCoincident(aSketchLineA.startPoint(), aSketchLineB.startPoint())
165 aFillet = self.mySketch.setFillet(aSketchLineA.endPoint())
169 self.collectFeatures()
170 self.checkNbFeatures("SketchLine", 2)
171 self.checkNbFeatures("SketchArc", 0) # no arcs should be created
172 self.checkNbFeatures("SketchConstraintCoincidence", 1) # number of coincidences should not change
173 self.checkNbFeatures("SketchConstraintTangent", 0) # no tangencies should not be created
174 self.checkNbFeatures("SketchFillet", 1) # fillet feature should still exist. it should be wrong
176 # sketch is invalid, so, no results at all
177 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [])
178 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [])
179 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [])
181 # remove fillet for correct python dump
182 self.myDocument.removeFeature(aFillet.feature())
184 def test_fillet_arc_line(self):
185 """ Test 3. Fillet on connected arc and line
187 aSketchLine = self.mySketch.addLine(10., 10., 20., 10.)
188 aSketchArc = self.mySketch.addArc(20., 10., 20., 20., 10., 10., False)
191 self.mySketch.setCoincident(aSketchLine.startPoint(), aSketchArc.endPoint())
195 self.mySketch.setFillet(aSketchLine.startPoint())
201 self.collectFeatures()
202 self.checkNbFeatures("SketchLine", 1)
203 self.checkNbFeatures("SketchArc", 2)
204 self.checkNbFeatures("SketchConstraintCoincidence", 2)
205 self.checkNbFeatures("SketchConstraintTangent", 2)
206 self.checkNbFeatures("SketchFillet", 0)
208 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
209 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [3])
210 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
212 def test_fillet_two_arcs(self):
213 """ Test 4. Fillet on two connected arcs
215 aSketchArc1 = self.mySketch.addArc(20., 0., 20., 20., 10., 17.32050807568877293, False)
216 aSketchArc2 = self.mySketch.addArc(20., 34.64101615137754586, 20., 14.64101615137754586, 10., 17.32050807568877293, True)
219 self.mySketch.setCoincident(aSketchArc1.endPoint(), aSketchArc2.endPoint())
223 self.mySketch.setFillet(aSketchArc1.endPoint())
229 self.collectFeatures()
230 self.checkNbFeatures("SketchLine", 0)
231 self.checkNbFeatures("SketchArc", 3)
232 self.checkNbFeatures("SketchConstraintCoincidence", 2)
233 self.checkNbFeatures("SketchConstraintTangent", 2)
234 self.checkNbFeatures("SketchFillet", 0)
236 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
237 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [3])
238 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
240 def test_fillet_with_horizontal_vertical(self):
241 """ Test 5. Fillet on two connected lines in case of Horizontal or Vertical constraints applied
243 aSketchLineA = self.mySketch.addLine(10., 10., 20., 10.)
244 aSketchLineB = self.mySketch.addLine(10., 10., 10., 20.)
247 self.mySketch.setCoincident(aSketchLineA.startPoint(), aSketchLineB.startPoint())
251 self.mySketch.setHorizontal(aSketchLineA.result())
252 self.mySketch.setVertical(aSketchLineB.result())
256 self.mySketch.setFillet(aSketchLineA.startPoint())
262 self.collectFeatures()
263 self.checkNbFeatures("SketchLine", 2)
264 self.checkNbFeatures("SketchArc", 1)
265 self.checkNbFeatures("SketchConstraintCoincidence", 2)
266 self.checkNbFeatures("SketchConstraintTangent", 2)
267 self.checkNbFeatures("SketchConstraintHorizontal", 1)
268 self.checkNbFeatures("SketchConstraintVertical", 1)
269 self.checkNbFeatures("SketchFillet", 0)
271 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
272 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [3])
273 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
275 def test_fillet_with_orthogonal(self):
276 """ Test 6. Fillet on two connected lines in case of Perpendicular constraint applied
278 aSketchLineA = self.mySketch.addLine(10., 10., 20., 10.)
279 aSketchLineB = self.mySketch.addLine(10., 10., 10., 20.)
282 self.mySketch.setCoincident(aSketchLineA.startPoint(), aSketchLineB.startPoint())
286 self.mySketch.setPerpendicular(aSketchLineA.result(), aSketchLineB.result())
290 self.mySketch.setFillet(aSketchLineA.startPoint())
296 self.collectFeatures()
297 self.checkNbFeatures("SketchLine", 2)
298 self.checkNbFeatures("SketchArc", 1)
299 self.checkNbFeatures("SketchConstraintCoincidence", 2)
300 self.checkNbFeatures("SketchConstraintTangent", 2)
301 self.checkNbFeatures("SketchConstraintPerpendicular", 1)
302 self.checkNbFeatures("SketchFillet", 0)
304 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
305 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [3])
306 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
308 def test_fillet_with_parallel(self):
309 """ Test 7. Fillet on two connected lines in case of Parallel constraint applied
311 aSketchLineA = self.mySketch.addLine(10., 10., 20., 10.)
312 aSketchLineB = self.mySketch.addLine(10., 10., 10., 20.)
315 self.mySketch.setCoincident(aSketchLineA.startPoint(), aSketchLineB.startPoint())
319 # third line to apply parallel constraint
320 aSketchLineC = self.mySketch.addLine(10., 0., 20., 5.)
322 self.mySketch.setParallel(aSketchLineB.result(), aSketchLineC.result())
326 self.mySketch.setFillet(aSketchLineA.startPoint())
332 self.collectFeatures()
333 self.checkNbFeatures("SketchLine", 3)
334 self.checkNbFeatures("SketchArc", 1)
335 self.checkNbFeatures("SketchConstraintCoincidence", 2)
336 self.checkNbFeatures("SketchConstraintTangent", 2)
337 self.checkNbFeatures("SketchConstraintParallel", 1)
338 self.checkNbFeatures("SketchFillet", 0)
340 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
341 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [4])
342 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [8])
344 def test_fillet_with_equal_lines(self):
345 """ Test 8. Fillet on two connected lines in case of Equal constraint applied
347 aSketchLineA = self.mySketch.addLine(10., 10., 20., 10.)
348 aSketchLineB = self.mySketch.addLine(10., 10., 10., 20.)
351 self.mySketch.setCoincident(aSketchLineA.startPoint(), aSketchLineB.startPoint())
355 self.mySketch.setEqual(aSketchLineA.result(), aSketchLineB.result())
359 self.mySketch.setFillet(aSketchLineA.startPoint())
360 self.myDOF += 2 # Equal has been removed
365 self.collectFeatures()
366 self.checkNbFeatures("SketchLine", 2)
367 self.checkNbFeatures("SketchArc", 1)
368 self.checkNbFeatures("SketchConstraintCoincidence", 2)
369 self.checkNbFeatures("SketchConstraintTangent", 2)
370 self.checkNbFeatures("SketchConstraintEqual", 0) # Equal constraint expected to be removed
371 self.checkNbFeatures("SketchFillet", 0)
373 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
374 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [3])
375 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
377 def test_fillet_with_equal_arcs(self):
378 """ Test 9. Fillet on two connected arcs in case of Equal constraint applied
380 aSketchArc1 = self.mySketch.addArc(20., 0., 20., 20., 10., 17.32050807568877293, False)
381 aSketchArc2 = self.mySketch.addArc(20., 34.64101615137754586, 20., 14.64101615137754586, 10., 17.32050807568877293, True)
384 self.mySketch.setCoincident(aSketchArc1.endPoint(), aSketchArc2.endPoint())
388 self.mySketch.setEqual(aSketchArc1.results()[1], aSketchArc2.results()[1])
392 self.mySketch.setFillet(aSketchArc1.endPoint())
393 self.myDOF += 2 # Equal has been removed
398 self.collectFeatures()
399 self.checkNbFeatures("SketchLine", 0)
400 self.checkNbFeatures("SketchArc", 3)
401 self.checkNbFeatures("SketchConstraintCoincidence", 2)
402 self.checkNbFeatures("SketchConstraintTangent", 2)
403 self.checkNbFeatures("SketchConstraintEqual", 0) # Equal constraint expected to be removed
404 self.checkNbFeatures("SketchFillet", 0)
406 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
407 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [3])
408 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
410 def test_fillet_with_length(self):
411 """ Test 10. Fillet on two connected lines in case of Length constraint applied
413 aSketchLineA = self.mySketch.addLine(10., 10., 20., 10.)
414 aSketchLineB = self.mySketch.addLine(10., 10., 10., 20.)
417 self.mySketch.setCoincident(aSketchLineA.startPoint(), aSketchLineB.startPoint())
421 self.mySketch.setLength(aSketchLineA.result(), 15.)
425 self.mySketch.setFillet(aSketchLineA.startPoint())
431 self.collectFeatures()
432 self.checkNbFeatures("SketchLine", 2)
433 self.checkNbFeatures("SketchArc", 1)
434 self.checkNbFeatures("SketchConstraintCoincidence", 4) # Additionally 2 coincidences for apex with fillet objects
435 self.checkNbFeatures("SketchConstraintTangent", 2)
436 self.checkNbFeatures("SketchConstraintLength", 0) # Length constraint expected to be removed
437 self.checkNbFeatures("SketchConstraintDistance", 1) # Distance constraint should appear instead of Length
438 self.checkNbFeatures("SketchFillet", 0)
440 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
441 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [3])
442 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
444 def test_fillet_with_radius(self):
445 """ Test 11. Fillet on connected arc and line in case of Radius constraint is applied to arc
447 aSketchLine = self.mySketch.addLine(10., 10., 20., 10.)
448 aSketchArc = self.mySketch.addArc(0., 10., 0., 20., 10., 10., True)
451 self.mySketch.setCoincident(aSketchLine.startPoint(), aSketchArc.endPoint())
455 self.mySketch.setRadius(aSketchArc.results()[1], 12.)
459 self.mySketch.setFillet(aSketchLine.startPoint())
465 self.collectFeatures()
466 self.checkNbFeatures("SketchLine", 1)
467 self.checkNbFeatures("SketchArc", 2)
468 self.checkNbFeatures("SketchConstraintCoincidence", 2)
469 self.checkNbFeatures("SketchConstraintTangent", 2)
470 self.checkNbFeatures("SketchConstraintRadius", 1)
471 self.checkNbFeatures("SketchFillet", 0)
473 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
474 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [3])
475 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
477 def test_fillet_with_distance(self):
478 """ Test 12. Fillet on two connected lines in case of Distance constraint applied
480 aSketchLineA = self.mySketch.addLine(20, 20, 70, 20)
481 aSketchLineB = self.mySketch.addLine(70, 20, 70, 53.16624790355412)
482 aSketchLineC = self.mySketch.addLine(70, 53.16624790355412, 20, 20)
487 self.mySketch.setCoincident(aSketchLineA.endPoint(), aSketchLineB.startPoint())
488 self.mySketch.setCoincident(aSketchLineB.endPoint(), aSketchLineC.startPoint())
489 self.mySketch.setCoincident(aSketchLineA.startPoint(), aSketchLineC.endPoint())
494 self.mySketch.setHorizontal(aSketchLineA.result())
495 self.mySketch.setVertical(aSketchLineB.result())
500 aProjection = self.mySketch.addProjection(model.selection("VERTEX", "Origin"), False)
501 aSketchPoint = SketchAPI_Point(aProjection.createdFeature())
504 self.mySketch.setLength(aSketchLineA.result(), 50)
505 self.mySketch.setDistance(aSketchLineA.startPoint(), aSketchLineC.startPoint(), 60, True)
506 self.mySketch.setHorizontalDistance(aSketchPoint.coordinates(), aSketchLineA.startPoint(), 20)
507 self.mySketch.setVerticalDistance(aSketchPoint.coordinates(), aSketchLineC.endPoint(), 20)
512 self.mySketch.setFillet(aSketchLineA.startPoint())
518 self.collectFeatures()
519 self.checkNbFeatures("SketchLine", 3)
520 self.checkNbFeatures("SketchArc", 1)
521 self.checkNbFeatures("SketchConstraintCoincidence", 6) # Additionally 2 coincidences for apex with fillet objects
522 self.checkNbFeatures("SketchConstraintHorizontal", 1)
523 self.checkNbFeatures("SketchConstraintVertical", 1)
524 self.checkNbFeatures("SketchConstraintTangent", 2)
525 self.checkNbFeatures("SketchConstraintLength", 0) # Length translated to Distance
526 self.checkNbFeatures("SketchConstraintDistance", 2) # Length translated to Distance
527 self.checkNbFeatures("SketchConstraintDistanceHorizontal", 1)
528 self.checkNbFeatures("SketchConstraintDistanceVertical", 1)
529 self.checkNbFeatures("SketchFillet", 0)
531 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
532 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [4])
533 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [8])
535 def test_fillet_with_fixed_point(self):
536 """ Test 13. Fillet on two connected lines in case of Fixed constraint applied to the fillet point
538 aSketchLineA = self.mySketch.addLine(10., 10., 20., 10.)
539 aSketchLineB = self.mySketch.addLine(10., 10., 10., 20.)
542 self.mySketch.setCoincident(aSketchLineA.startPoint(), aSketchLineB.startPoint())
546 self.mySketch.setFixed(aSketchLineA.startPoint())
550 self.mySketch.setFillet(aSketchLineA.startPoint())
551 self.myDOF += 3 # Fixed constraint has been removed
556 self.collectFeatures()
557 self.checkNbFeatures("SketchLine", 2)
558 self.checkNbFeatures("SketchArc", 1)
559 self.checkNbFeatures("SketchConstraintCoincidence", 2)
560 self.checkNbFeatures("SketchConstraintTangent", 2)
561 self.checkNbFeatures("SketchConstraintFixed", 0) # Fixed constraint expected to be removed
562 self.checkNbFeatures("SketchFillet", 0)
564 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
565 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [3])
566 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
568 def test_fillet_with_fixed_line(self):
569 """ Test 14. Fillet on two connected lines in case of Fixed constraint applied to one of lines
571 aSketchLineA = self.mySketch.addLine(10., 10., 20., 10.)
572 aSketchLineB = self.mySketch.addLine(10., 10., 10., 20.)
575 self.mySketch.setCoincident(aSketchLineA.startPoint(), aSketchLineB.startPoint())
579 self.mySketch.setFixed(aSketchLineA.result())
583 self.mySketch.setFillet(aSketchLineA.startPoint())
589 self.collectFeatures()
590 self.checkNbFeatures("SketchLine", 2)
591 self.checkNbFeatures("SketchArc", 1)
592 self.checkNbFeatures("SketchConstraintCoincidence", 2)
593 self.checkNbFeatures("SketchConstraintTangent", 2)
594 self.checkNbFeatures("SketchConstraintLength", 0) # Fixed constraint expected to be kept
595 self.checkNbFeatures("SketchFillet", 0)
597 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
598 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [3])
599 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
601 def test_fillet_with_angle(self):
602 """ Test 15. Fillet on two connected lines in case of Perpendicular constraint applied
604 aSketchLineA = self.mySketch.addLine(10., 10., 20., 10.)
605 aSketchLineB = self.mySketch.addLine(10., 10., 10., 20.)
608 self.mySketch.setCoincident(aSketchLineA.startPoint(), aSketchLineB.startPoint())
612 self.mySketch.setAngle(aSketchLineA.result(), aSketchLineB.result(), 60.)
616 self.mySketch.setFillet(aSketchLineA.startPoint())
622 self.collectFeatures()
623 self.checkNbFeatures("SketchLine", 2)
624 self.checkNbFeatures("SketchArc", 1)
625 self.checkNbFeatures("SketchConstraintCoincidence", 2)
626 self.checkNbFeatures("SketchConstraintTangent", 2)
627 self.checkNbFeatures("SketchConstraintAngle", 1)
628 self.checkNbFeatures("SketchFillet", 0)
630 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
631 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [3])
632 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
635 if __name__ == "__main__":
636 test_program = unittest.main(exit=False)
637 assert test_program.result.wasSuccessful(), "Test failed"