1
<?xml version="1.0" encoding="UTF-8"?>
2
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
7
TwinPointer="BoundBox3d"
8
Include="Base/BoundBox.h"
9
FatherInclude="Base/PyObjectBase.h"
13
FatherNamespace="Base">
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.
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.
28
The following constructors are supported:
31
Empty constructor. Returns an invalid BoundBox.
35
boundBox : Base.BoundBox
37
BoundBox(xMin, yMin=0, zMin=0, xMax=0, yMax=0, zMax=0)
38
Define from the minimum and maximum values at each direction.
40
Minimum value at x-coordinate.
42
Minimum value at y-coordinate.
44
Minimum value at z-coordinate.
46
Maximum value at x-coordinate.
48
Maximum value at y-coordinate.
50
Maximum value at z-coordinate.
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>
60
<Methode Name="setVoid">
62
<UserDocu>setVoid() -> None
64
Invalidate the bounding box.</UserDocu>
67
<Methode Name="isValid">
69
<UserDocu>isValid() -> bool
71
Checks if the bounding box is valid.</UserDocu>
76
<UserDocu>add(minMax) -> None
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
83
minMax : Base.Vector, tuple
84
Values to enlarge at each direction.
86
Value to enlarge at x-direction.
88
Value to enlarge at y-direction.
90
Value to enlarge at z-direction.</UserDocu>
93
<Methode Name="getPoint">
95
<UserDocu>getPoint(index) ->Base.Vector
97
Get the point of the given index.
98
The index must be in the range of [0, 7].
100
index : int</UserDocu>
103
<Methode Name="getEdge">
105
<UserDocu>getEdge(index) -> tuple of Base.Vector
107
Get the edge points of the given index.
108
The index must be in the range of [0, 11].
110
index : int</UserDocu>
113
<Methode Name="closestPoint">
115
<UserDocu>closestPoint(point) -> Base.Vector
116
closestPoint(x, y, z) -> Base.Vector
118
Get the closest point of the bounding box to the given point.
120
point : Base.Vector, tuple
121
Coordinates of the given point.
123
X-coordinate of the given point.
125
Y-coordinate of the given point.
127
Z-coordinate of the given point.</UserDocu>
130
<Methode Name="intersect">
132
<UserDocu>intersect(boundBox2) -> bool
133
intersect(base, dir) -> bool
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.
138
boundBox2 : Base.BoundBox
139
base : Base.Vector, tuple
140
dir : Base.Vector, tuple</UserDocu>
143
<Methode Name="intersected">
145
<UserDocu>intersected(boundBox2) -> Base.BoundBox
147
Returns the intersection of this and the given bounding box.
149
boundBox2 : Base.BoundBox</UserDocu>
152
<Methode Name="united">
154
<UserDocu>united(boundBox2) -> Base.BoundBox
156
Returns the union of this and the given bounding box.
158
boundBox2 : Base.BoundBox</UserDocu>
161
<Methode Name="enlarge">
163
<UserDocu>enlarge(variation) -> None
165
Decrease the minimum values and increase the maximum values by the given value.
166
A negative value shrinks the bounding box.
168
variation : float</UserDocu>
172
<Methode Name="getIntersectionPoint">
174
<UserDocu>getIntersectionPoint(base, dir, epsilon=0.0001) -> Base.Vector
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.
180
Base point of the line.
182
Direction of the line.
184
Bounding box size tolerance.</UserDocu>
187
<Methode Name="move">
189
<UserDocu>move(displacement) -> None
192
Move the bounding box by the given values.
194
displacement : Base.Vector, tuple
195
Displacement at each direction.
197
Displacement at x-direction.
199
Displacement at y-direction.
201
Displacement at z-direction.</UserDocu>
204
<Methode Name="scale">
206
<UserDocu>scale(factor) -> None
207
scale(x, y, z) -> None
209
Scale the bounding box by the given values.
211
factor : Base.Vector, tuple
212
Factor scale at each direction.
214
Scale at x-direction.
216
Scale at y-direction.
218
Scale at z-direction.</UserDocu>
221
<Methode Name="transformed">
223
<UserDocu>transformed(matrix) -> Base.BoundBox
225
Returns a new BoundBox containing the transformed rectangular cuboid
226
represented by this BoundBox.
229
Transformation matrix.</UserDocu>
232
<Methode Name="isCutPlane">
234
<UserDocu>isCutPlane(base, normal) -> bool
236
Check if the plane specified by base and normal intersects (cuts) this bounding
240
normal : Base.Vector</UserDocu>
243
<Methode Name="isInside">
245
<UserDocu>isInside(object) -> bool
246
isInside(x, y, z) -> bool
248
Check if a point or a bounding box is inside this bounding box.
250
object : Base.Vector, Base.BoundBox
251
Object to check if it is inside this bounding box.
253
X-coordinate of the point to check.
255
Y-coordinate of the point to check.
257
Z-coordinate of the point to check.</UserDocu>
260
<Attribute Name="Center" ReadOnly="true">
262
<UserDocu>Center point of the bounding box.</UserDocu>
264
<Parameter Name="Center" Type="Object" />
266
<Attribute Name="XMax" ReadOnly="false">
268
<UserDocu>The maximum x boundary position.</UserDocu>
270
<Parameter Name="XMax" Type="Float" />
272
<Attribute Name="YMax" ReadOnly="false">
274
<UserDocu>The maximum y boundary position.</UserDocu>
276
<Parameter Name="YMax" Type="Float" />
278
<Attribute Name="ZMax" ReadOnly="false">
280
<UserDocu>The maximum z boundary position.</UserDocu>
282
<Parameter Name="ZMax" Type="Float" />
284
<Attribute Name="XMin" ReadOnly="false">
286
<UserDocu>The minimum x boundary position.</UserDocu>
288
<Parameter Name="XMin" Type="Float" />
290
<Attribute Name="YMin" ReadOnly="false">
292
<UserDocu>The minimum y boundary position.</UserDocu>
294
<Parameter Name="YMin" Type="Float" />
296
<Attribute Name="ZMin" ReadOnly="false">
298
<UserDocu>The minimum z boundary position.</UserDocu>
300
<Parameter Name="ZMin" Type="Float" />
302
<Attribute Name="XLength" ReadOnly="true">
304
<UserDocu>Length of the bounding box in x direction.</UserDocu>
306
<Parameter Name="XLength" Type="Float" />
308
<Attribute Name="YLength" ReadOnly="true">
310
<UserDocu>Length of the bounding box in y direction.</UserDocu>
312
<Parameter Name="YLength" Type="Float" />
314
<Attribute Name="ZLength" ReadOnly="true">
316
<UserDocu>Length of the bounding box in z direction.</UserDocu>
318
<Parameter Name="ZLength" Type="Float" />
320
<Attribute Name="DiagonalLength" ReadOnly="true">
322
<UserDocu>Diagonal length of the bounding box.</UserDocu>
324
<Parameter Name="DiagonalLength" Type="Float" />