Salome HOME
Issue #3086: Avoid crash when FeatureInfo is null.
[modules/shaper.git] / src / PrimitivesPlugin / doc / boxFeature.rst
1 .. _box_feature:
2 .. |box.icon|    image:: images/box.png
3
4 Box
5 ===
6
7 Box feature creates a box solid.
8
9 To create a Box in the active part:
10
11 #. select in the Main Menu *Primitives - > Box* item  or
12 #. click |box.icon| **Box** button in the toolbar:
13
14 There are 2 algorithms for creation of a Box:
15
16 .. image:: images/box_2pt_32x32.png
17    :align: left
18 **By dimensions** 
19
20 .. image:: images/box_dxyz_32x32.png
21    :align: left
22 **By two points** 
23
24
25 By dimensions
26 -------------
27
28 Box is created by dimensions along X, Y, Z axis starting from the origin.
29
30 .. image:: images/Box_dimensions.png
31    :align: center
32
33 Input fields:
34
35 - **DX**, **DY**, **DZ** define dimensions of the box along the corresponding coordinate axes. 
36
37 **TUI Command**:
38
39 .. py:function:: model.addBox(Part_doc, DX, DY, DZ)
40   
41     :param part: The current part object.
42     :param real: Size along X.
43     :param real: Size along Y.
44     :param real: Size along Z.
45     :return: Result object.
46
47 Result
48 """"""
49
50 A solid box based on the origin of coordinates and with edges parallel to the coordinate axes.
51
52 .. image:: images/Box1.png
53            :align: center
54
55 **See Also** a sample TUI Script of a :ref:`tui_create_boxdim` operation.
56
57 By two points
58 -------------
59
60 Box is created by two points of the box diagonal.
61
62 .. image:: images/Box_2points.png
63          :align: center
64
65 Input fields:
66
67 - **Point 1** and **Point 2**  define diagonal points of the box selected in 3D OCC viewer or object browser.
68   
69 **TUI Command**:
70
71 .. py:function:: model.addBox(Part_doc, point1, point2)
72
73     :param part: The current part object.
74     :param object: First vertex of diagonal.
75     :param object: Second vertex of diagonal.
76     :return: Result object.
77 **Arguments**:   Part + 2 selected points (opposite vertices of the box)
78
79 Result
80 """"""
81
82 A solid box based on two points and with edges parallel to the coordinate axes.
83
84 .. image:: images/Box2.png
85            :align: center
86                    
87 .. centered::
88    Created boxes
89
90 **See Also** a sample TUI Script of :ref:`tui_create_boxpnt` operation.