コード例 #1
0
# - BB (array) -
import Generator as G
import Transform as T
import Post as P
import KCore.test as test

# Rotated box
box = G.cartTetra((0, 0, 0), (1., 1., 1.), (2, 2, 2))
box = P.exteriorFaces(box)
box = T.rotate(box, (0, 0, 0), (1, 0, 0), +50.)  # Rotation X
box = T.rotate(box, (0, 0, 0), (0, 1, 0), -20.)  # Rotation Y
box = T.rotate(box, (0, 0, 0), (0, 0, 1), 30.)  # Rotation Z
OBB = G.BB(box, method='OBB', weighting=1)
test.testA([OBB], 1)

# Aligned box
box = G.cartTetra((0, 0, 0), (1., 1., 1.), (2, 2, 2))
box = P.exteriorFaces(box)
OBB = G.BB(box, method='OBB', weighting=1)
test.testA([OBB], 2)
コード例 #2
0
ファイル: BB.py プロジェクト: guillaume-florent/cassiopee-ce
# - BB (array) -
import Generator as G
import Converter as C
import Geom as D

s = D.circle((0, 0, 0), 1., N=100)
a = G.BB(s)
C.convertArrays2File([a, s], 'out.plt')
コード例 #3
0
# - getIntersectingDomainsAABB (array) -
import Generator as G
import Converter as C
import Connector as X

a = G.cart((0., 0, 0), (1, 1, 1), (10, 10, 10))
b = G.cart((9., 0, 0), (1, 1, 1), (10, 10, 10))

bb = G.BB([a, b])
ret = X.getIntersectingDomainsAABB(bb)
print ret
コード例 #4
0
# - bboxIntersection (array) -
import Generator as G
import Transform as T
import KCore.test as test

boxA = G.cartTetra((2, -1, 0.5), (1, 2, 0.5), (2, 2, 2))

boxB = G.cartTetra((2, -1, 0.5), (2, 2, 1), (2, 2, 2))
boxB = T.rotate(boxB, (0, 0, 0), (10, 5, -20))
AABB = G.BB(boxA)
OBB = G.BB(boxB, method='OBB')

intersect = G.bboxIntersection(AABB, AABB, tol=1e-10, isBB=True, method='AABB')
test.testO(intersect, 1)

intersect = G.bboxIntersection(AABB,
                               OBB,
                               tol=1e-10,
                               isBB=True,
                               method='AABBOBB')
test.testO(intersect, 2)

intersect = G.bboxIntersection(AABB, OBB, tol=1e-10, isBB=True, method='OBB')
test.testO(intersect, 3)