一、代码
Python
import open3d as o3d
import numpy as np
# 定义正方体的参数
def create_square(x1=0, y1=0, z1=0, side_length=1, resolution=20):
vertices = []
for i in range(resolution):
for j in range(resolution):
for k in range(resolution):
x = x1 + i * side_length / (resolution - 1)
y = y1 + j * side_length / (resolution - 1)
z = z1 + k * side_length / (resolution - 1)
vertices.append([x, y, z])
# 创建Open3D点云对象
pcd = o3d.geometry.PointCloud()
pcd.points = o3d.utility.Vector3dVector(np.array(vertices))
return pcd
def create_cone(x1=0, y1=0, z1=0, radius=100, height