1 # Copyright (C) 2014-2019 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
21 TestFilletInteracting.py
22 Unit test of SketchPlugin_Fillet feature.
23 In scope of interaction with another constraints applied to filleted features.
27 from GeomDataAPI import *
28 from ModelAPI import *
29 from SketchAPI import *
32 from salome.shaper import model
34 __updated__ = "2017-03-06"
36 def isArcLineSmooth(theArc, theLine, theTolerance):
37 aCenter = geomDataAPI_Point2D(theArc.attribute("center_point"))
38 aDistance = model.distancePointLine(aCenter, theLine)
39 aRadius = arcRadius(theArc)
40 return math.fabs(aRadius - aDistance) < theTolerance
42 def isArcArcSmooth(theArc1, theArc2, theTolerance):
43 aCenter1 = geomDataAPI_Point2D(theArc1.attribute("center_point"))
44 aCenter2 = geomDataAPI_Point2D(theArc2.attribute("center_point"))
45 aDistance = model.distancePointPoint(aCenter1, aCenter2)
46 aRadius1 = arcRadius(theArc1)
47 aRadius2 = arcRadius(theArc2)
48 aRadSum = aRadius1 + aRadius2
49 aRadDiff = math.fabs(aRadius1 - aRadius2)
50 return math.fabs(aDistance - aRadSum) < theTolerance or math.fabs(aDistance - aRadDiff) < theTolerance
52 def arcRadius(theArc):
53 aCenter = geomDataAPI_Point2D(theArc.attribute("center_point"))
54 aStart = geomDataAPI_Point2D(theArc.attribute("start_point"))
55 return model.distancePointPoint(aCenter, aStart)
59 class TestFilletInteracting(unittest.TestCase):
62 self.myDocument = model.moduleDocument()
63 self.mySketch = model.addSketch(self.myDocument, model.defaultPlane("XOY"))
64 self.myTolerance = 1.e-6
69 self.assertTrue(model.checkPythonDump())
74 self.assertEqual(model.dof(self.mySketch), self.myDOF)
76 def collectFeatures(self):
78 for aSubObj in self.mySketch.features().list():
79 aFeature = ModelAPI.ModelAPI_Feature.feature(aSubObj)
80 if aFeature is not None:
81 if self.myFeatures.get(aFeature.getKind()) == None:
82 self.myFeatures[aFeature.getKind()] = 1
84 self.myFeatures[aFeature.getKind()] += 1
86 def checkNbFeatures(self, theFeatureKind, theFeatureCount):
87 if theFeatureCount == 0:
88 self.assertIsNone(self.myFeatures.get(theFeatureKind))
90 self.assertIsNotNone(self.myFeatures.get(theFeatureKind), "No features of kind {0} but expected {1}".format(theFeatureKind, theFeatureCount))
91 self.assertEqual(self.myFeatures[theFeatureKind], theFeatureCount, "Observed number of {0} is {1} but expected {2}".format(theFeatureKind, self.myFeatures[theFeatureKind], theFeatureCount))
93 def checkFillet(self):
94 aPtPtCoincidences = self.getCoincidences()
95 for coinc in aPtPtCoincidences:
96 aConnectedFeatures = self.connectedFeatures(coinc)
97 self.assertEqual(len(aConnectedFeatures), 2)
98 if aConnectedFeatures[0].getKind() == "SketchArc":
99 if aConnectedFeatures[1].getKind() == "SketchArc":
100 self.assertTrue(isArcArcSmooth(aConnectedFeatures[0], aConnectedFeatures[1], self.myTolerance))
101 elif aConnectedFeatures[1].getKind() == "SketchLine":
102 self.assertTrue(isArcLineSmooth(aConnectedFeatures[0], aConnectedFeatures[1], self.myTolerance))
103 elif aConnectedFeatures[0].getKind() == "SketchLine" and aConnectedFeatures[1].getKind() == "SketchArc":
104 self.assertTrue(isArcLineSmooth(aConnectedFeatures[1], aConnectedFeatures[0], self.myTolerance))
106 def getCoincidences(self):
108 for aSubObj in self.mySketch.features().list():
109 aSubFeature = ModelAPI.ModelAPI_Feature.feature(aSubObj)
110 if aSubFeature is not None and aSubFeature.getKind() == "SketchConstraintCoincidence":
111 anEntityA = aSubFeature.refattr("ConstraintEntityA")
112 anEntityB = aSubFeature.refattr("ConstraintEntityB")
113 if not anEntityA.isObject() and not anEntityB.isObject():
114 aCoincidences.append(aSubFeature)
117 def connectedFeatures(self, theCoincidence):
118 anEntityA = theCoincidence.refattr("ConstraintEntityA")
119 anEntityB = theCoincidence.refattr("ConstraintEntityB")
120 aFeatureA = ModelAPI.ModelAPI_Feature.feature(anEntityA.attr().owner())
121 aFeatureB = ModelAPI.ModelAPI_Feature.feature(anEntityB.attr().owner())
122 return [aFeatureA, aFeatureB]
125 def test_fillet_two_lines(self):
126 """ Test 1. Fillet on two connected lines
128 aSketchLineA = self.mySketch.addLine(10., 10., 20., 10.)
129 aSketchLineB = self.mySketch.addLine(10., 10., 10., 20.)
132 self.mySketch.setCoincident(aSketchLineA.startPoint(), aSketchLineB.startPoint())
136 self.mySketch.setFillet(aSketchLineA.startPoint())
142 self.collectFeatures()
143 self.checkNbFeatures("SketchLine", 2)
144 self.checkNbFeatures("SketchArc", 1)
145 self.checkNbFeatures("SketchConstraintCoincidence", 2)
146 self.checkNbFeatures("SketchConstraintTangent", 2)
147 self.checkNbFeatures("SketchFillet", 0)
149 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
150 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [3])
151 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
153 def test_wrong_fillet_two_lines(self):
154 """ Test 2. Check the fillet is wrong on two connected lines when selecting incorrect point
156 aSketchLineA = self.mySketch.addLine(10., 10., 20., 10.)
157 aSketchLineB = self.mySketch.addLine(10., 10., 10., 20.)
160 self.mySketch.setCoincident(aSketchLineA.startPoint(), aSketchLineB.startPoint())
164 aFillet = self.mySketch.setFillet(aSketchLineA.endPoint())
168 self.collectFeatures()
169 self.checkNbFeatures("SketchLine", 2)
170 self.checkNbFeatures("SketchArc", 0) # no arcs should be created
171 self.checkNbFeatures("SketchConstraintCoincidence", 1) # number of coincidences should not change
172 self.checkNbFeatures("SketchConstraintTangent", 0) # no tangencies should not be created
173 self.checkNbFeatures("SketchFillet", 1) # fillet feature should still exist. it should be wrong
175 # sketch is invalid, so, no results at all
176 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [])
177 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [])
178 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [])
180 # remove fillet for correct python dump
181 self.myDocument.removeFeature(aFillet.feature())
183 def test_fillet_arc_line(self):
184 """ Test 3. Fillet on connected arc and line
186 aSketchLine = self.mySketch.addLine(10., 10., 20., 10.)
187 aSketchArc = self.mySketch.addArc(20., 10., 20., 20., 10., 10., False)
190 self.mySketch.setCoincident(aSketchLine.startPoint(), aSketchArc.endPoint())
194 self.mySketch.setFillet(aSketchLine.startPoint())
200 self.collectFeatures()
201 self.checkNbFeatures("SketchLine", 1)
202 self.checkNbFeatures("SketchArc", 2)
203 self.checkNbFeatures("SketchConstraintCoincidence", 2)
204 self.checkNbFeatures("SketchConstraintTangent", 2)
205 self.checkNbFeatures("SketchFillet", 0)
207 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
208 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [3])
209 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
211 def test_fillet_two_arcs(self):
212 """ Test 4. Fillet on two connected arcs
214 aSketchArc1 = self.mySketch.addArc(20., 0., 20., 20., 10., 17.32050807568877293, False)
215 aSketchArc2 = self.mySketch.addArc(20., 34.64101615137754586, 20., 14.64101615137754586, 10., 17.32050807568877293, True)
218 self.mySketch.setCoincident(aSketchArc1.endPoint(), aSketchArc2.endPoint())
222 self.mySketch.setFillet(aSketchArc1.endPoint())
228 self.collectFeatures()
229 self.checkNbFeatures("SketchLine", 0)
230 self.checkNbFeatures("SketchArc", 3)
231 self.checkNbFeatures("SketchConstraintCoincidence", 2)
232 self.checkNbFeatures("SketchConstraintTangent", 2)
233 self.checkNbFeatures("SketchFillet", 0)
235 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
236 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [3])
237 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
239 def test_fillet_with_horizontal_vertical(self):
240 """ Test 5. Fillet on two connected lines in case of Horizontal or Vertical constraints applied
242 aSketchLineA = self.mySketch.addLine(10., 10., 20., 10.)
243 aSketchLineB = self.mySketch.addLine(10., 10., 10., 20.)
246 self.mySketch.setCoincident(aSketchLineA.startPoint(), aSketchLineB.startPoint())
250 self.mySketch.setHorizontal(aSketchLineA.result())
251 self.mySketch.setVertical(aSketchLineB.result())
255 self.mySketch.setFillet(aSketchLineA.startPoint())
261 self.collectFeatures()
262 self.checkNbFeatures("SketchLine", 2)
263 self.checkNbFeatures("SketchArc", 1)
264 self.checkNbFeatures("SketchConstraintCoincidence", 2)
265 self.checkNbFeatures("SketchConstraintTangent", 2)
266 self.checkNbFeatures("SketchConstraintHorizontal", 1)
267 self.checkNbFeatures("SketchConstraintVertical", 1)
268 self.checkNbFeatures("SketchFillet", 0)
270 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
271 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [3])
272 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
274 def test_fillet_with_orthogonal(self):
275 """ Test 6. Fillet on two connected lines in case of Perpendicular constraint applied
277 aSketchLineA = self.mySketch.addLine(10., 10., 20., 10.)
278 aSketchLineB = self.mySketch.addLine(10., 10., 10., 20.)
281 self.mySketch.setCoincident(aSketchLineA.startPoint(), aSketchLineB.startPoint())
285 self.mySketch.setPerpendicular(aSketchLineA.result(), aSketchLineB.result())
289 self.mySketch.setFillet(aSketchLineA.startPoint())
295 self.collectFeatures()
296 self.checkNbFeatures("SketchLine", 2)
297 self.checkNbFeatures("SketchArc", 1)
298 self.checkNbFeatures("SketchConstraintCoincidence", 2)
299 self.checkNbFeatures("SketchConstraintTangent", 2)
300 self.checkNbFeatures("SketchConstraintPerpendicular", 1)
301 self.checkNbFeatures("SketchFillet", 0)
303 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
304 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [3])
305 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
307 def test_fillet_with_parallel(self):
308 """ Test 7. Fillet on two connected lines in case of Parallel constraint applied
310 aSketchLineA = self.mySketch.addLine(10., 10., 20., 10.)
311 aSketchLineB = self.mySketch.addLine(10., 10., 10., 20.)
314 self.mySketch.setCoincident(aSketchLineA.startPoint(), aSketchLineB.startPoint())
318 # third line to apply parallel constraint
319 aSketchLineC = self.mySketch.addLine(10., 0., 20., 5.)
321 self.mySketch.setParallel(aSketchLineB.result(), aSketchLineC.result())
325 self.mySketch.setFillet(aSketchLineA.startPoint())
331 self.collectFeatures()
332 self.checkNbFeatures("SketchLine", 3)
333 self.checkNbFeatures("SketchArc", 1)
334 self.checkNbFeatures("SketchConstraintCoincidence", 2)
335 self.checkNbFeatures("SketchConstraintTangent", 2)
336 self.checkNbFeatures("SketchConstraintParallel", 1)
337 self.checkNbFeatures("SketchFillet", 0)
339 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
340 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [4])
341 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [8])
343 def test_fillet_with_equal_lines(self):
344 """ Test 8. Fillet on two connected lines in case of Equal constraint applied
346 aSketchLineA = self.mySketch.addLine(10., 10., 20., 10.)
347 aSketchLineB = self.mySketch.addLine(10., 10., 10., 20.)
350 self.mySketch.setCoincident(aSketchLineA.startPoint(), aSketchLineB.startPoint())
354 self.mySketch.setEqual(aSketchLineA.result(), aSketchLineB.result())
358 self.mySketch.setFillet(aSketchLineA.startPoint())
359 self.myDOF += 2 # Equal has been removed
364 self.collectFeatures()
365 self.checkNbFeatures("SketchLine", 2)
366 self.checkNbFeatures("SketchArc", 1)
367 self.checkNbFeatures("SketchConstraintCoincidence", 2)
368 self.checkNbFeatures("SketchConstraintTangent", 2)
369 self.checkNbFeatures("SketchConstraintEqual", 0) # Equal constraint expected to be removed
370 self.checkNbFeatures("SketchFillet", 0)
372 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
373 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [3])
374 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
376 def test_fillet_with_equal_arcs(self):
377 """ Test 9. Fillet on two connected arcs in case of Equal constraint applied
379 aSketchArc1 = self.mySketch.addArc(20., 0., 20., 20., 10., 17.32050807568877293, False)
380 aSketchArc2 = self.mySketch.addArc(20., 34.64101615137754586, 20., 14.64101615137754586, 10., 17.32050807568877293, True)
383 self.mySketch.setCoincident(aSketchArc1.endPoint(), aSketchArc2.endPoint())
387 self.mySketch.setEqual(aSketchArc1.results()[1], aSketchArc2.results()[1])
391 self.mySketch.setFillet(aSketchArc1.endPoint())
392 self.myDOF += 2 # Equal has been removed
397 self.collectFeatures()
398 self.checkNbFeatures("SketchLine", 0)
399 self.checkNbFeatures("SketchArc", 3)
400 self.checkNbFeatures("SketchConstraintCoincidence", 2)
401 self.checkNbFeatures("SketchConstraintTangent", 2)
402 self.checkNbFeatures("SketchConstraintEqual", 0) # Equal constraint expected to be removed
403 self.checkNbFeatures("SketchFillet", 0)
405 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
406 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [3])
407 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
409 def test_fillet_with_length(self):
410 """ Test 10. Fillet on two connected lines in case of Length constraint applied
412 aSketchLineA = self.mySketch.addLine(10., 10., 20., 10.)
413 aSketchLineB = self.mySketch.addLine(10., 10., 10., 20.)
416 self.mySketch.setCoincident(aSketchLineA.startPoint(), aSketchLineB.startPoint())
420 self.mySketch.setLength(aSketchLineA.result(), 15.)
424 self.mySketch.setFillet(aSketchLineA.startPoint())
430 self.collectFeatures()
431 self.checkNbFeatures("SketchLine", 2)
432 self.checkNbFeatures("SketchArc", 1)
433 self.checkNbFeatures("SketchConstraintCoincidence", 4) # Additionally 2 coincidences for apex with fillet objects
434 self.checkNbFeatures("SketchConstraintTangent", 2)
435 self.checkNbFeatures("SketchConstraintLength", 0) # Length constraint expected to be removed
436 self.checkNbFeatures("SketchConstraintDistance", 1) # Distance constraint should appear instead of Length
437 self.checkNbFeatures("SketchFillet", 0)
439 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
440 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [3])
441 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
443 def test_fillet_with_radius(self):
444 """ Test 11. Fillet on connected arc and line in case of Radius constraint is applied to arc
446 aSketchLine = self.mySketch.addLine(10., 10., 20., 10.)
447 aSketchArc = self.mySketch.addArc(0., 10., 0., 20., 10., 10., True)
450 self.mySketch.setCoincident(aSketchLine.startPoint(), aSketchArc.endPoint())
454 self.mySketch.setRadius(aSketchArc.results()[1], 12.)
458 self.mySketch.setFillet(aSketchLine.startPoint())
464 self.collectFeatures()
465 self.checkNbFeatures("SketchLine", 1)
466 self.checkNbFeatures("SketchArc", 2)
467 self.checkNbFeatures("SketchConstraintCoincidence", 2)
468 self.checkNbFeatures("SketchConstraintTangent", 2)
469 self.checkNbFeatures("SketchConstraintRadius", 1)
470 self.checkNbFeatures("SketchFillet", 0)
472 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
473 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [3])
474 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
476 def test_fillet_with_distance(self):
477 """ Test 12. Fillet on two connected lines in case of Distance constraint applied
479 aSketchLineA = self.mySketch.addLine(20, 20, 70, 20)
480 aSketchLineB = self.mySketch.addLine(70, 20, 70, 53.16624790355412)
481 aSketchLineC = self.mySketch.addLine(70, 53.16624790355412, 20, 20)
486 self.mySketch.setCoincident(aSketchLineA.endPoint(), aSketchLineB.startPoint())
487 self.mySketch.setCoincident(aSketchLineB.endPoint(), aSketchLineC.startPoint())
488 self.mySketch.setCoincident(aSketchLineA.startPoint(), aSketchLineC.endPoint())
493 self.mySketch.setHorizontal(aSketchLineA.result())
494 self.mySketch.setVertical(aSketchLineB.result())
499 aProjection = self.mySketch.addProjection(model.selection("VERTEX", "Origin"), False)
500 aSketchPoint = SketchAPI_Point(aProjection.createdFeature())
503 self.mySketch.setLength(aSketchLineA.result(), 50)
504 self.mySketch.setDistance(aSketchLineA.startPoint(), aSketchLineC.startPoint(), 60, True)
505 self.mySketch.setHorizontalDistance(aSketchPoint.coordinates(), aSketchLineA.startPoint(), 20)
506 self.mySketch.setVerticalDistance(aSketchPoint.coordinates(), aSketchLineC.endPoint(), 20)
511 self.mySketch.setFillet(aSketchLineA.startPoint())
517 self.collectFeatures()
518 self.checkNbFeatures("SketchLine", 3)
519 self.checkNbFeatures("SketchArc", 1)
520 self.checkNbFeatures("SketchConstraintCoincidence", 6) # Additionally 2 coincidences for apex with fillet objects
521 self.checkNbFeatures("SketchConstraintHorizontal", 1)
522 self.checkNbFeatures("SketchConstraintVertical", 1)
523 self.checkNbFeatures("SketchConstraintTangent", 2)
524 self.checkNbFeatures("SketchConstraintLength", 0) # Length translated to Distance
525 self.checkNbFeatures("SketchConstraintDistance", 2) # Length translated to Distance
526 self.checkNbFeatures("SketchConstraintDistanceHorizontal", 1)
527 self.checkNbFeatures("SketchConstraintDistanceVertical", 1)
528 self.checkNbFeatures("SketchFillet", 0)
530 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
531 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [4])
532 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [8])
534 def test_fillet_with_fixed_point(self):
535 """ Test 13. Fillet on two connected lines in case of Fixed constraint applied to the fillet point
537 aSketchLineA = self.mySketch.addLine(10., 10., 20., 10.)
538 aSketchLineB = self.mySketch.addLine(10., 10., 10., 20.)
541 self.mySketch.setCoincident(aSketchLineA.startPoint(), aSketchLineB.startPoint())
545 self.mySketch.setFixed(aSketchLineA.startPoint())
549 self.mySketch.setFillet(aSketchLineA.startPoint())
550 self.myDOF += 3 # Fixed constraint has been removed
555 self.collectFeatures()
556 self.checkNbFeatures("SketchLine", 2)
557 self.checkNbFeatures("SketchArc", 1)
558 self.checkNbFeatures("SketchConstraintCoincidence", 2)
559 self.checkNbFeatures("SketchConstraintTangent", 2)
560 self.checkNbFeatures("SketchConstraintFixed", 0) # Fixed constraint expected to be removed
561 self.checkNbFeatures("SketchFillet", 0)
563 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
564 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [3])
565 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
567 def test_fillet_with_fixed_line(self):
568 """ Test 14. Fillet on two connected lines in case of Fixed constraint applied to one of lines
570 aSketchLineA = self.mySketch.addLine(10., 10., 20., 10.)
571 aSketchLineB = self.mySketch.addLine(10., 10., 10., 20.)
574 self.mySketch.setCoincident(aSketchLineA.startPoint(), aSketchLineB.startPoint())
578 self.mySketch.setFixed(aSketchLineA.result())
582 self.mySketch.setFillet(aSketchLineA.startPoint())
588 self.collectFeatures()
589 self.checkNbFeatures("SketchLine", 2)
590 self.checkNbFeatures("SketchArc", 1)
591 self.checkNbFeatures("SketchConstraintCoincidence", 2)
592 self.checkNbFeatures("SketchConstraintTangent", 2)
593 self.checkNbFeatures("SketchConstraintLength", 0) # Fixed constraint expected to be kept
594 self.checkNbFeatures("SketchFillet", 0)
596 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
597 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [3])
598 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
600 def test_fillet_with_angle(self):
601 """ Test 15. Fillet on two connected lines in case of Perpendicular constraint applied
603 aSketchLineA = self.mySketch.addLine(10., 10., 20., 10.)
604 aSketchLineB = self.mySketch.addLine(10., 10., 10., 20.)
607 self.mySketch.setCoincident(aSketchLineA.startPoint(), aSketchLineB.startPoint())
611 self.mySketch.setAngle(aSketchLineA.result(), aSketchLineB.result(), 60.)
615 self.mySketch.setFillet(aSketchLineA.startPoint())
621 self.collectFeatures()
622 self.checkNbFeatures("SketchLine", 2)
623 self.checkNbFeatures("SketchArc", 1)
624 self.checkNbFeatures("SketchConstraintCoincidence", 2)
625 self.checkNbFeatures("SketchConstraintTangent", 2)
626 self.checkNbFeatures("SketchConstraintAngle", 1)
627 self.checkNbFeatures("SketchFillet", 0)
629 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.FACE, [0])
630 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.EDGE, [3])
631 model.testNbSubShapes(self.mySketch, GeomAPI_Shape.VERTEX, [6])
634 if __name__ == "__main__":
635 test_program = unittest.main(exit=False)
636 assert test_program.result.wasSuccessful(), "Test failed"