1 from salome.shaper import model
4 partSet = model.moduleDocument()
7 Part_1 = model.addPart(partSet)
8 Part_1_doc = Part_1.document()
11 Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOY"))
13 ### Create SketchPoints
14 SketchPoint_1 = Sketch_1.addPoint(-70.28350515463917, 1.388316151202744)
15 SketchPoint_2 = Sketch_1.addPoint(-26.89862542955327, 51.7147766323024)
16 SketchPoint_3 = Sketch_1.addPoint(40.08762886597938, 32.27835051546391)
17 SketchPoint_4 = Sketch_1.addPoint(66.46563573883162, -29.8487972508591)
19 ### Create approximating curve
20 ApproximationPoints = [SketchPoint_1.coordinates(),
21 SketchPoint_2.coordinates(),
22 SketchPoint_3.coordinates(),
23 SketchPoint_4.coordinates()]
24 SketchBSpline_1 = Sketch_1.addApproximation(ApproximationPoints, precision = 30)
25 Sketch_1.setCoincident(SketchPoint_1.coordinates(), SketchBSpline_1.startPoint())
26 Sketch_1.setCoincident(SketchPoint_4.coordinates(), SketchBSpline_1.endPoint())
28 ### Create periodic approximating curve
29 SketchBSpline_2 = Sketch_1.addApproximation(ApproximationPoints, precision = 30, periodic = True)
31 ### Create closed approximating curve
32 SketchBSpline_3 = Sketch_1.addApproximation(ApproximationPoints, precision = 30, closed = True)
33 Sketch_1.setCoincident(SketchPoint_1.coordinates(), SketchBSpline_3.startPoint())
34 Sketch_1.setCoincident(SketchPoint_1.coordinates(), SketchBSpline_3.endPoint())