获取三角网格模型的最大边界框。
def get_max_bound(self) -> Tuple[Float3, Float3]:
"""
Retrieve the min and max coordinates of the bounding box of a triangle mesh.
Returns
-------
tuple of Float3
A tuple of two `numpy.ndarray` objects. The first ndarray contains the
`x`, `y`, and `z` values of the minimum coordinates of the bounding box,
while the second ndarray contains the `x`, `y`, and `z` values of the
maximum coordinates of the bounding box.
"""
无
一个由两个Float3
类型组成的元组。其中第一个元素为最小坐标值的Float3
类型,第二个元素为最大坐标值的Float3
类型。
import open3d as o3d
mesh = o3d.geometry.TriangleMesh.create_box(width=1.0, height=1.0, depth=1.0)
max_bound = mesh.get_max_bound()
print("Max bound of the mesh:", max_bound)
输出:
Max bound of the mesh: (array([-0.5, -0.5, -0.5]), array([0.5, 0.5, 0.5]))
无
该函数的返回值是元组类型。元组中的每个元素都是由三个浮点数组成的一维numpy.ndarray
。(即Float3
类型)