Salome HOME
bos#35152 [EDF] (2023-T1) Sketch Circle should allow user to position construction...
[modules/shaper.git] / src / SketchPlugin / doc / bsplineFeature.rst
1 .. |bspline.icon|    image:: images/bspline.png
2 .. |bspline_p.icon|  image:: images/bspline_p.png
3 .. |add_pole.icon|   image:: images/bspline_add_pole.png
4
5 B-spline and periodic B-spline
6 ==============================
7
8 The feature creates a free form spline curve in the current Sketch.
9
10 To add a new B-spline to the Sketch:
11
12 #. select in the Main Menu *Sketch - > B-spline* item  or
13 #. click |bspline.icon| **B-spline** button in the Sketch toolbar.
14
15 To add a periodic B-spline to the Sketch:
16
17 #. select in the Main Menu *Sketch - > Periodic B-spline* item  or
18 #. click |bspline_p.icon| **Periodic B-spline** button in the Sketch toolbar.
19
20
21 Creation of B-spline curve
22 """"""""""""""""""""""""""
23
24 .. figure:: images/bspline_creation_panel.png
25    :align: center
26
27 Click in the view to specify the control polygon of B-spline curve. The curve will be shown after the second point is initialized. To stop adding new poles, click **Esc** button or **Apply** the operation.
28
29
30 **TUI Command**:
31
32 .. py:function:: Sketch_1.addSpline(degree, poles, weights, knots, multiplicities, periodic)
33
34     :param integer: degree of B-spline.
35     :param array: list of poles [(x1, y1), (x2, y2), ...].
36     :param array: list of weights for corresponding poles.
37     :param array: parametric knots of B-spline curve.
38     :param array: multiplicity of each knot.
39     :param boolean: True mentions that the B-spline curve is periodic.
40     :return: Result object.
41
42 Each parameter is optional.
43
44 Result
45 """"""
46
47 Created B-spline curve appears in the view.
48
49 .. figure:: images/bspline_result.png
50    :align: center
51
52    Non-periodic B-spline created
53
54
55 .. figure:: images/bspline_periodic_result.png
56    :align: center
57
58    Periodic B-spline created
59
60 **See Also** a sample TUI Script of :ref:`tui_create_bspline` operation.
61
62
63 Modification of B-spline curve
64 """"""""""""""""""""""""""""""
65
66 .. figure:: images/bspline_modification_panel.png
67    :align: center
68
69    Modification panel for B-spline curve
70
71 The following options are provided to modify the already created B-spline curve:
72
73 #. Change weight of each pole.
74 #. Add new pole.
75
76 The new pole is added after the current by pressing on the corresponding |add_pole.icon| button. The default weight for the new pole is 1. 
77
78 **Note:** adding the new pole after the last for non-periodic B-spline will not change the last point of the curve to avoid modification of full sketch.