【第三方库】python拟合三维空间圆

1、库

pip install circle-fitting-3d

https://github.com/CristianoPizzamiglio/circle-fitting-3d

2、代码

from circle_fitting_3d import Circle3D

points = [[3, 0, 0], [0, 3, 0], [0, 0, 3]]
circle_3d = Circle3D(points)
center = circle_3d.center
radius = circle_3d.radius
print(center)
print(radius)

实测三维点较多的话,需要等待一定的时间(700 点 20s 左右)。

你可能感兴趣的:(python)