3 Test case for issue #2018 "After split auxiliary circle edit of axiliary state of arc is wrong"
7 from ModelAPI import ModelAPI_Feature
8 from ModelAPI import FeatureList
9 from ModelGeomAlgo import ModelGeomAlgo_Point2D
10 from SketchAPI import SketchAPI_Arc
11 from salome.shaper import model
13 def getArcs(theSketch):
15 for aSubObj in theSketch.features().list():
16 aFeature = ModelAPI_Feature.feature(aSubObj)
17 if aFeature is not None and aFeature.getKind() == "SketchArc":
18 anArcs.append(aFeature)
23 partSet = model.moduleDocument()
24 Sketch_1 = model.addSketch(partSet, model.defaultPlane("XOY"))
25 SketchCircle_1 = Sketch_1.addCircle(-316.2976090885591, -103.0319555403832, 230.3644881376851)
26 SketchCircle_1.setAuxiliary(True)
27 SketchLine_1 = Sketch_1.addLine(-489.6131019153831, 48.7229038254136, -457.9545454545454, 334.0909090909091)
28 SketchConstraintCoincidence_1 = Sketch_1.setCoincident(SketchLine_1.startPoint(), SketchCircle_1.results()[1])
29 SketchLine_2 = Sketch_1.addLine(-457.9545454545454, 334.0909090909091, -251.2069112222553, 117.9454153513332)
30 SketchConstraintCoincidence_2 = Sketch_1.setCoincident(SketchLine_1.endPoint(), SketchLine_2.startPoint())
31 SketchConstraintCoincidence_3 = Sketch_1.setCoincident(SketchLine_2.endPoint(), SketchCircle_1.results()[1])
33 # prepare point on circle
34 SketchLine_intersecting = Sketch_1.addLine(-316.2976090885591, -103.0319555403832, -457.9545454545454, 334.0909090909091)
35 Intersection_Point = ModelGeomAlgo_Point2D.getSetOfPntIntersectedShape(SketchCircle_1.feature(), FeatureList([SketchLine_intersecting.feature()]))
36 removeFeaturesAndReferences(FeatureSet([SketchLine_intersecting.feature()]))
37 GeomPoint = Intersection_Point[0]
40 Sketch_1.addSplit(SketchCircle_1, Sketch_1.to2D(GeomPoint))
43 anArcs = getArcs(Sketch_1)
44 # check auxiliary flags
46 aCurrentArc = SketchAPI_Arc(arc)
47 assert(aCurrentArc.auxiliary().value())
48 aCurrentArc.setAuxiliary(False)
50 assert(aCurrentArc.auxiliary().value() == False)
54 assert(model.checkPythonDump())