예제 #1
0
    def test_expandBounds(self):
        bbox = hou.BoundingBox(-1, -1.75, -3, 1, 1.75, 3)
        bbox.expandBounds(1, 1, 1)

        self.assertEqual(bbox.minvec(), hou.Vector3(-2, -2.75, -4))
        self.assertEqual(bbox.maxvec(), hou.Vector3(2, 2.75, 4))
예제 #2
0
    def test_addToMin(self):
        bbox = hou.BoundingBox(-1, -1.75, -3, 1, 1.75, 3)
        bbox.addToMin(hou.Vector3(1, 0.25, 1))

        self.assertEqual(bbox.minvec(), hou.Vector3(0, -1.5, -2))
예제 #3
0
    def test_intersectsFail(self):
        bbox1 = hou.BoundingBox(-0.5, -0.5, -0.5, -0.1, -0.1, -0.1)
        bbox2 = hou.BoundingBox(0, 0, 0, 0.5, 0.5, 0.5)

        self.assertFalse(bbox1.intersects(bbox2))
예제 #4
0
    def test_computeIntersectionFail(self):
        bbox1 = hou.BoundingBox(-0.5, -0.5, -0.5, -0.1, -0.1, -0.1)
        bbox2 = hou.BoundingBox(0, 0, 0, 0.5, 0.5, 0.5)

        self.assertFalse(bbox1.computeIntersection(bbox2))
예제 #5
0
    def test_intersects(self):
        bbox1 = hou.BoundingBox(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5)
        bbox2 = hou.BoundingBox(0, 0, 0, 0.5, 0.5, 0.5)

        self.assertTrue(bbox1.intersects(bbox2))
예제 #6
0
    def test_isInsideFail(self):
        bbox1 = hou.BoundingBox(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5)
        bbox2 = hou.BoundingBox(0, 0, 0, 0.5, 0.5, 0.5)

        self.assertFalse(bbox1.isInside(bbox2))
예제 #7
0
    def test_isInside(self):
        bbox1 = hou.BoundingBox(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5)
        bbox2 = hou.BoundingBox(-1, -1, -1, 1, 1, 1)

        self.assertTrue(bbox1.isInside(bbox2))
예제 #8
0
파일: xh.py 프로젝트: schaban/sh_perf_test
	def fromHouBBox(self, hbb):
		vmin = hbb.minvec()
		vmax = hbb.maxvec()
		self.bbox = hou.BoundingBox(vmin[0], vmin[1], vmin[2], vmax[0], vmax[1], vmax[2])
예제 #9
0
파일: xh.py 프로젝트: schaban/sh_perf_test
	def addPos(self, pos):
		if self.bbox:
			self.bbox.enlargeToContain(pos)
		else:
			self.bbox = hou.BoundingBox(pos[0], pos[1], pos[2], pos[0], pos[1], pos[2])