FreeCAD

Форк
0
/
BoundBoxPy.xml 
327 строк · 10.3 Кб
1
<?xml version="1.0" encoding="UTF-8"?>
2
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
3
  <PythonExport
4
      Father="PyObjectBase"
5
      Name="BoundBoxPy"
6
      Twin="BoundBox"
7
      TwinPointer="BoundBox3d"
8
      Include="Base/BoundBox.h"
9
      FatherInclude="Base/PyObjectBase.h"
10
      Namespace="Base"
11
      Constructor="true"
12
      Delete="true"
13
      FatherNamespace="Base">
14
    <Documentation>
15
      <Author Licence="LGPL" Name="Juergen Riegel" EMail="FreeCAD@juergen-riegel.net" />
16
      <DeveloperDocu>This is the BoundBox export class</DeveloperDocu>
17
      <UserDocu>Base.BoundBox class.
18

19
This class represents a bounding box.
20
A bounding box is a rectangular cuboid which is a way to describe outer
21
boundaries and is obtained from a lot of 3D types.
22
It is often used to check if a 3D entity lies in the range of another object.
23
Checking for bounding interference first can save a lot of computing time!
24
An invalid BoundBox is represented by inconsistent values at each direction:
25
The maximum float value of the system at the minimum coordinates, and the
26
opposite value at the maximum coordinates.
27

28
The following constructors are supported:
29

30
BoundBox()
31
Empty constructor. Returns an invalid BoundBox.
32

33
BoundBox(boundBox)
34
Copy constructor.
35
boundBox : Base.BoundBox
36

37
BoundBox(xMin, yMin=0, zMin=0, xMax=0, yMax=0, zMax=0)
38
Define from the minimum and maximum values at each direction.
39
xMin : float
40
    Minimum value at x-coordinate.
41
yMin : float
42
    Minimum value at y-coordinate.
43
zMin : float
44
    Minimum value at z-coordinate.
45
xMax : float
46
    Maximum value at x-coordinate.
47
yMax : float
48
    Maximum value at y-coordinate.
49
zMax : float
50
    Maximum value at z-coordinate.
51

52
App.BoundBox(min, max)
53
Define from two containers representing the minimum and maximum values of the
54
coordinates in each direction.
55
min : Base.Vector, tuple
56
    Minimum values of the coordinates.
57
max : Base.Vector, tuple
58
    Maximum values of the coordinates.</UserDocu>
59
    </Documentation>
60
    <Methode Name="setVoid">
61
      <Documentation>
62
        <UserDocu>setVoid() -> None
63

64
Invalidate the bounding box.</UserDocu>
65
      </Documentation>
66
    </Methode>
67
    <Methode Name="isValid">
68
      <Documentation>
69
        <UserDocu>isValid() -> bool
70

71
Checks if the bounding box is valid.</UserDocu>
72
      </Documentation>
73
    </Methode>
74
    <Methode Name="add">
75
      <Documentation>
76
        <UserDocu>add(minMax) -> None
77
add(x, y, z) -> None
78

79
Increase the maximum values or decrease the minimum values of this BoundBox by
80
replacing the current values with the given values, so the bounding box can grow
81
but not shrink.
82

83
minMax : Base.Vector, tuple
84
    Values to enlarge at each direction.
85
x : float
86
    Value to enlarge at x-direction.
87
y : float
88
    Value to enlarge at y-direction.
89
z : float
90
    Value to enlarge at z-direction.</UserDocu>
91
      </Documentation>
92
    </Methode>
93
    <Methode Name="getPoint">
94
      <Documentation>
95
        <UserDocu>getPoint(index) ->Base.Vector
96

97
Get the point of the given index.
98
The index must be in the range of [0, 7].
99

100
index : int</UserDocu>
101
      </Documentation>
102
    </Methode>
103
    <Methode Name="getEdge">
104
      <Documentation>
105
        <UserDocu>getEdge(index) -> tuple of Base.Vector
106

107
Get the edge points of the given index.
108
The index must be in the range of [0, 11].
109

110
index : int</UserDocu>
111
      </Documentation>
112
    </Methode>
113
    <Methode Name="closestPoint">
114
      <Documentation>
115
        <UserDocu>closestPoint(point) -> Base.Vector
116
closestPoint(x, y, z) -> Base.Vector
117

118
Get the closest point of the bounding box to the given point.
119

120
point : Base.Vector, tuple
121
    Coordinates of the given point.
122
x : float
123
    X-coordinate of the given point.
124
y : float
125
    Y-coordinate of the given point.
126
z : float
127
    Z-coordinate of the given point.</UserDocu>
128
      </Documentation>
129
    </Methode>
130
    <Methode Name="intersect">
131
      <Documentation>
132
        <UserDocu>intersect(boundBox2) -> bool
133
intersect(base, dir) -> bool
134

135
Checks if the given object intersects with this bounding box. That can be
136
another bounding box or a line specified by base and direction.
137

138
boundBox2 : Base.BoundBox
139
base : Base.Vector, tuple
140
dir : Base.Vector, tuple</UserDocu>
141
      </Documentation>
142
    </Methode>
143
    <Methode Name="intersected">
144
      <Documentation>
145
        <UserDocu>intersected(boundBox2) -> Base.BoundBox
146

147
Returns the intersection of this and the given bounding box.
148

149
boundBox2 : Base.BoundBox</UserDocu>
150
      </Documentation>
151
    </Methode>
152
    <Methode Name="united">
153
      <Documentation>
154
        <UserDocu>united(boundBox2) -> Base.BoundBox
155

156
Returns the union of this and the given bounding box.
157

158
boundBox2 : Base.BoundBox</UserDocu>
159
      </Documentation>
160
    </Methode>
161
    <Methode Name="enlarge">
162
        <Documentation>
163
            <UserDocu>enlarge(variation) -> None
164

165
Decrease the minimum values and increase the maximum values by the given value.
166
A negative value shrinks the bounding box.
167

168
variation : float</UserDocu>
169
        </Documentation>
170
    </Methode>
171

172
      <Methode Name="getIntersectionPoint">
173
          <Documentation>
174
              <UserDocu>getIntersectionPoint(base, dir, epsilon=0.0001) -> Base.Vector
175

176
Calculate the intersection point of a line with the bounding box.
177
The base point must lie inside the bounding box, if not an exception is thrown.
178

179
base : Base.Vector
180
    Base point of the line.
181
dir : Base.Vector
182
    Direction of the line.
183
epsilon : float
184
    Bounding box size tolerance.</UserDocu>
185
          </Documentation>
186
      </Methode>
187
      <Methode Name="move">
188
          <Documentation>
189
              <UserDocu>move(displacement) -> None
190
move(x, y, z) -> None
191

192
Move the bounding box by the given values.
193

194
displacement : Base.Vector, tuple
195
    Displacement at each direction.
196
x : float
197
    Displacement at x-direction.
198
y : float
199
    Displacement at y-direction.
200
z : float
201
    Displacement at z-direction.</UserDocu>
202
          </Documentation>
203
      </Methode>
204
      <Methode Name="scale">
205
          <Documentation>
206
              <UserDocu>scale(factor) -> None
207
scale(x, y, z) -> None
208

209
Scale the bounding box by the given values.
210

211
factor : Base.Vector, tuple
212
    Factor scale at each direction.
213
x : float
214
    Scale at x-direction.
215
y : float
216
    Scale at y-direction.
217
z : float
218
    Scale at z-direction.</UserDocu>
219
          </Documentation>
220
      </Methode>
221
      <Methode Name="transformed">
222
          <Documentation>
223
              <UserDocu>transformed(matrix) -> Base.BoundBox
224

225
Returns a new BoundBox containing the transformed rectangular cuboid
226
represented by this BoundBox.
227

228
matrix : Base.Matrix
229
    Transformation matrix.</UserDocu>
230
          </Documentation>
231
      </Methode>
232
      <Methode Name="isCutPlane">
233
      <Documentation>
234
        <UserDocu>isCutPlane(base, normal) -> bool
235

236
Check if the plane specified by base and normal intersects (cuts) this bounding
237
box.
238

239
base : Base.Vector
240
normal : Base.Vector</UserDocu>
241
      </Documentation>
242
    </Methode>
243
        <Methode Name="isInside">
244
            <Documentation>
245
                <UserDocu>isInside(object) -> bool
246
isInside(x, y, z) -> bool
247

248
Check if a point or a bounding box is inside this bounding box.
249

250
object : Base.Vector, Base.BoundBox
251
    Object to check if it is inside this bounding box.
252
x : float
253
    X-coordinate of the point to check.
254
y : float
255
    Y-coordinate of the point to check.
256
z : float
257
    Z-coordinate of the point to check.</UserDocu>
258
            </Documentation>
259
        </Methode>
260
        <Attribute Name="Center" ReadOnly="true">
261
          <Documentation>
262
              <UserDocu>Center point of the bounding box.</UserDocu>
263
          </Documentation>
264
          <Parameter Name="Center" Type="Object" />
265
      </Attribute>
266
      <Attribute Name="XMax" ReadOnly="false">
267
          <Documentation>
268
              <UserDocu>The maximum x boundary position.</UserDocu>
269
          </Documentation>
270
          <Parameter Name="XMax" Type="Float" />
271
      </Attribute>
272
      <Attribute Name="YMax" ReadOnly="false">
273
          <Documentation>
274
              <UserDocu>The maximum y boundary position.</UserDocu>
275
          </Documentation>
276
          <Parameter Name="YMax" Type="Float" />
277
      </Attribute>
278
      <Attribute Name="ZMax" ReadOnly="false">
279
          <Documentation>
280
              <UserDocu>The maximum z boundary position.</UserDocu>
281
          </Documentation>
282
          <Parameter Name="ZMax" Type="Float" />
283
      </Attribute>
284
      <Attribute Name="XMin" ReadOnly="false">
285
          <Documentation>
286
              <UserDocu>The minimum x boundary position.</UserDocu>
287
          </Documentation>
288
          <Parameter Name="XMin" Type="Float" />
289
      </Attribute>
290
      <Attribute Name="YMin" ReadOnly="false">
291
          <Documentation>
292
              <UserDocu>The minimum y boundary position.</UserDocu>
293
          </Documentation>
294
          <Parameter Name="YMin" Type="Float" />
295
      </Attribute>
296
      <Attribute Name="ZMin" ReadOnly="false">
297
          <Documentation>
298
              <UserDocu>The minimum z boundary position.</UserDocu>
299
          </Documentation>
300
          <Parameter Name="ZMin" Type="Float" />
301
      </Attribute>
302
      <Attribute Name="XLength" ReadOnly="true">
303
          <Documentation>
304
              <UserDocu>Length of the bounding box in x direction.</UserDocu>
305
          </Documentation>
306
          <Parameter Name="XLength" Type="Float" />
307
      </Attribute>
308
      <Attribute Name="YLength" ReadOnly="true">
309
          <Documentation>
310
              <UserDocu>Length of the bounding box in y direction.</UserDocu>
311
          </Documentation>
312
          <Parameter Name="YLength" Type="Float" />
313
      </Attribute>
314
      <Attribute Name="ZLength" ReadOnly="true">
315
          <Documentation>
316
              <UserDocu>Length of the bounding box in z direction.</UserDocu>
317
          </Documentation>
318
          <Parameter Name="ZLength" Type="Float" />
319
      </Attribute>
320
       <Attribute Name="DiagonalLength" ReadOnly="true">
321
          <Documentation>
322
              <UserDocu>Diagonal length of the bounding box.</UserDocu>
323
          </Documentation>
324
          <Parameter Name="DiagonalLength" Type="Float" />
325
      </Attribute>
326
  </PythonExport>
327
</GenerateModel>
328

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.