[vedo]是一个基于VTK开发的3维对象显示和分析的开源库,我常用于显示三维对象,这里记录一下常用的操作
def show_stl_pts_point_two(stl_path, pts_path, target_pts, point):
stl_model = vedo.load(stl_path).c(("magenta")) # 显示stl模型
pts_points = get_gum_line_pts(pts_path)
target_pts_points = get_gum_line_pts(target_pts) # numpy格式点 N*3
points = vedo.Points(pts_points.reshape(-1, 3)).pointSize(10).c(("green")) # 显示点
target_points = vedo.Points(target_pts_points.reshape(-1, 3)).pointSize(8).c(("red"))
p = vedo.Point(point, r=20, c="yellow")
vedo.show(stl_model, points, target_points, p)
for stl_model in stl_models:
basename = os.path.basename(stl_model)
filename = os.path.splitext(basename)[0]
print(filename)
sharp_face_model = os.path.join(SAVE_DIR, filename + "sharpFaces.stl")
a = load(stl_model).c(("grey")).opacity(0.5)
b = load(sharp_face_model).c(('blue'))
show(a, b)