将 3D 圆柱体放入点云中

问题描述 投票:0回答:1

我有点困惑。我有来自点云的 x,y,z 点,我想使用 scipy 和 python 拟合一个圆柱体。

我通常在互联网上找到的圆柱方程是

(x - a)**2 + (y - b)**2 = r**2
但我也希望 z 作为该方程中的参数存在,所以我也使用
 (x - a)**2 + (y - b)**2 + (z - c)**2 = r**2
但这是球体的方程。我都用过这两种方法来进行实验。 我的问题是,当我使用球体公式绘制预测点(x_test、y_test、z_predicted)时,这些点与 x_test、y_test、z_test 不接近。当我使用典型的圆柱公式时,也会发生同样的情况。 所以我问,在可能不与任何轴平行的圆柱体上拟合 x、y、z 的正确公式是什么?

我给出了代码和一些实验要点。

from scipy.optimize import minimize
from sklearn.preprocessing import StandardScaler
import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from sklearn.model_selection import train_test_split

from cfg_fit_cylinder import *

# Define the cylinder equation
def cylinder_equation(params, xyz):
    a, b, c, r = params
    x, y, z = xyz
    return (x - a)**2 + (y - b)**2 + (z - c)**2 - r**2

def cost_function(params, xyz_data):
    a, b, c, r = params
    total_error = 0
    for x, y, z in xyz_data:
        error = ((x - a)**2 + (y - b)**2 + (z - c)**2 - r**2)**2
        total_error += error
    return total_error

# Plot 3D points
def plot_3d_points(vertices, xyz_test, a, b, c, r):
    fig = plt.figure(figsize=(12, 6))
    ax1 = fig.add_subplot(121, projection='3d')  # For the 3D points
    ax2 = fig.add_subplot(122, projection='3d')  # For the cylinder surface

    x, y, z = vertices['x'], vertices['y'], vertices['z'] # Unscaled inital points
    ax1.scatter(x, y, z, c='b', marker='o')
    xyz_test = scaler.inverse_transform(xyz_test)
    ax1.scatter(xyz_test[:, 0], xyz_test[:, 1], xyz_test[:, 2], c='r', marker='x')
    ax1.set_xlabel('X Label')
    ax1.set_ylabel('Y Label')
    ax1.set_zlabel('Z Label')

    # Also unscaled
    resolution = 100
    theta = np.linspace(0, 2 * np.pi, resolution)
    z_surface = np.linspace(min(z), max(z), resolution) #here
    Z, Theta = np.meshgrid(z_surface, theta)
    X = a + r * np.cos(Theta)
    Y = b + r * np.sin(Theta)
    ax2.plot_surface(X, Y, Z, cmap='Greens', alpha=1)

    predicted_z = np.array([cylinder_equation([a, b, c, r], xyz) for xyz in xyz_test]) # Unscaled test points/parameters
    shift_z = predicted_z - xyz_test[:, 2]

    # Plot the points with the z-shift
    ax1.scatter(xyz_test[:, 0], xyz_test[:, 1], xyz_test[:, 2] + shift_z, c='black', marker='x')

    plt.show()


if __name__ == "__main__":
    # Load data
    points = pd.read_csv(PATH_TO_POINT_CLOUD, header=None)
    points.columns = ['x', 'y', 'z']

    # Scale data
    scaler = StandardScaler()
    points_scaled = scaler.fit_transform(points)

    params_list = []
    rmse_list = []
    result_list = []
    num_samples = [i for i in range(7, 3300, 100)]

    for num in num_samples:
        points_scaled_sampled = points_scaled[np.random.choice(len(points_scaled), num, replace=False)]

        train, test = train_test_split(points_scaled_sampled, test_size=0.3) # here

        # Initial guess based on data statistics
        initial_guess = [np.mean(train[:, 0]), np.mean(train[:, 1]), np.mean(train[:, 2]), 
                        np.std(np.linalg.norm(train - np.mean(train, axis=0), axis=1))]

        # Use the 'trust-constr' method for optimization
        result = minimize(cost_function, initial_guess, args=(train,), method='trust-constr')
        result_list.append(result)
        print('Optimization result:')
        print(result)
        print("========")
        params = result.x
        params_list.append(params)

        cylinder_values = np.array([cylinder_equation(params, xyz) for xyz in train])

        ssr = np.mean(cylinder_values**2)
        rmse = np.sqrt(ssr)
        rmse_list.append(rmse)

        print(f'RMSE, Samples: {round(rmse, 3)}, {num}')

    print('========')
    print(f'Min RMSE, samples: {round(min(rmse_list), 2)}, {num_samples[np.argmin(rmse_list)]}, Max RMSE, samples: {round(max(rmse_list), 2)}, {num_samples[np.argmax(rmse_list)]}')

    min_params = params_list[np.argmin(rmse_list)]
    a_min, b_min, c_min, r_min = min_params[0], min_params[1], min_params[2], min_params[3]

    # Denormalize parameters
    denormalized_params = scaler.inverse_transform([[a_min, b_min, c_min]])[0]
    a_min, b_min, c_min = denormalized_params

    # Denormalize r
    r_min = r_min * scaler.scale_[2] + scaler.mean_[2]

    plot_3d_points(points, test, a_min, b_min, c_min, r_min)
    plt.plot(num_samples, rmse_list)

以及一些要点

-0.19509,-0.980785,9.66
-0.707107,-0.707107,9.66
-0.83147,-0.55557,9.66
-0.92388,-0.382683,-9.66
-0.92388,-0.382683,9.66
-0.980785,-0.19509,-9.66
-0.980785,-0.19509,9.66
-1.0,0.0,9.66
-0.980785,0.19509,-9.66
-0.707107,0.707107,-9.66
-0.55557,0.83147,-9.66
-0.097545,-0.990393,9.66
-0.19509,-0.980785,0.0
-0.288887,-0.952332,-9.66
-0.469127,-0.877675,9.66
-0.55557,-0.83147,0.0
-0.631338,-0.769288,-9.66
-0.631338,-0.769288,9.66
-0.769288,-0.631338,9.66
-0.877675,-0.469127,-9.66
-0.877675,-0.469127,9.66
-0.92388,-0.382683,0.0
-0.952332,-0.288887,-9.66
-0.952332,-0.288887,9.66
-0.980785,-0.19509,0.0
-0.990393,-0.097545,-9.66
-0.990393,-0.097545,9.66
-1.0,0.0,0.0
-0.990393,0.097545,-9.66
-0.990393,0.097545,9.66
-0.980785,0.19509,0.0
-0.877675,0.469127,-9.66
-0.877675,0.469127,9.66
-0.83147,0.55557,0.0
-0.769288,0.631338,9.66
-0.631338,0.769288,-9.66
-0.55557,0.83147,0.0
-0.469127,0.877675,-9.66
-0.952332,0.288887,0.0
-0.990393,-0.097545,0.0
-0.952332,-0.288887,0.0
-0.877675,-0.469127,0.0
-0.631338,-0.769288,0.0
-0.097545,-0.990393,0.0
0.097545,-0.990393,0.0
-0.048773,-0.995196,9.66
-0.19509,-0.980785,-4.83
-0.335785,-0.938106,-9.66
-0.425905,-0.900777,9.66
-0.55557,-0.83147,-4.83
-0.669223,-0.738197,-9.66
-0.593454,-0.800379,9.66
-0.738197,-0.669223,9.66
-0.83147,-0.55557,-4.83
-0.900777,-0.425905,-9.66
-0.854572,-0.512349,9.66
-0.92388,-0.382683,-4.83
-0.966559,-0.241989,-9.66
-0.938106,-0.335785,9.66
-0.980785,-0.19509,-4.83
-0.985589,-0.146318,9.66
-0.985589,0.146318,-9.66
-0.938106,0.335785,-9.66
-0.966559,0.241989,9.66
-0.900777,0.425905,9.66
-0.83147,0.55557,-4.83
-0.593454,0.800379,-9.66
0.0,-1.0,4.83
-0.146318,-0.985589,9.66
-0.19509,-0.980785,4.83
-0.382683,-0.92388,4.83
-0.55557,-0.83147,4.83
-0.738197,-0.669223,-9.66
-0.800379,-0.593454,9.66
-0.92388,-0.382683,4.83
-0.938106,-0.335785,-9.66
-0.966559,-0.241989,9.66
-0.985589,-0.146318,-9.66
-0.995196,-0.048773,9.66
-0.938106,0.335785,9.66
-0.707107,0.707107,4.83
-0.669223,0.738197,-9.66
-0.512349,0.854572,-9.66
-0.469127,0.877675,-4.83
-0.631338,0.769288,-4.83
-0.877675,0.469127,4.83
-0.952332,0.288887,4.83
-0.985589,0.146318,0.0
-0.990393,0.097545,-4.83
-0.990393,0.097545,4.83
-0.995196,-0.048773,0.0
-0.985589,-0.146318,0.0
-0.990393,-0.097545,-4.83
-0.990393,-0.097545,4.83
-0.966559,-0.241989,0.0
-0.938106,-0.335785,0.0
-0.952332,-0.288887,-4.83
-0.952332,-0.288887,4.83
-0.900777,-0.425905,0.0
-0.854572,-0.512349,0.0
-0.877675,-0.469127,-4.83
-0.738197,-0.669223,0.0
-0.769288,-0.631338,-4.83
-0.769288,-0.631338,4.83
-0.593454,-0.800379,0.0
-0.631338,-0.769288,-4.83
-0.631338,-0.769288,4.83
-0.425905,-0.900777,0.0
-0.288887,-0.952332,4.83
-0.048773,-0.995196,0.0
-0.335785,-0.938106,-4.83
-0.425905,-0.900777,4.83
-0.425905,-0.900777,-4.83
-0.593454,-0.800379,4.83
-0.593454,-0.800379,-4.83
-0.738197,-0.669223,4.83
-0.800379,-0.593454,-4.83
-0.854572,-0.512349,4.83
-0.854572,-0.512349,-4.83
-0.938106,-0.335785,4.83
-0.938106,-0.335785,-4.83
-0.966559,-0.241989,-4.83
-0.985589,-0.146318,4.83
-0.995196,-0.048773,-4.83
-0.966559,0.241989,4.83
-0.738197,0.669223,-4.83
-0.512349,0.854572,-4.83
-0.938106,0.335785,4.83
-0.995196,-0.048773,4.83
-0.966559,-0.241989,4.83
-0.900777,-0.425905,4.83
-0.800379,-0.593454,4.83
-0.533959,-0.843021,-9.66
-0.55557,-0.83147,-7.245
-0.688165,-0.722652,-9.66
-0.722652,-0.688165,9.66
-0.83147,-0.55557,-7.245
-0.912328,-0.404294,-9.66
-0.843021,-0.533959,9.66
-0.92388,-0.382683,-7.245
-0.973672,-0.218539,-9.66
-0.930993,-0.359234,9.66
-0.980785,-0.19509,-7.245
-0.983187,-0.170704,9.66
-1.0,0.0,-7.245
-0.997598,0.024386,9.66
-0.973672,0.218539,9.66
-0.92388,0.382683,-7.245
-0.912328,0.404294,9.66
-0.722652,0.688165,-9.66
-0.574512,0.815924,-9.66
-0.55557,0.83147,-7.245
-0.121931,-0.987991,9.66
-0.19509,-0.980785,2.415
-0.265438,-0.959446,-9.66
-0.447516,-0.889226,-9.66
-0.490738,-0.866123,9.66
-0.753743,-0.650281,-9.66
-0.784834,-0.612396,9.66
-0.83147,-0.55557,2.415
-0.889226,-0.447516,9.66
-0.92388,-0.382683,2.415
-0.945219,-0.312336,-9.66
-0.959446,-0.265438,9.66
-0.987991,0.121931,9.66
-0.959446,0.265438,-9.66
-0.866123,0.490738,9.66
-0.650281,0.753743,-9.66
-0.55557,0.83147,2.415
-0.490738,0.866123,-9.66
-0.574512,0.815924,0.0
-0.631338,0.769288,-7.245
-0.631338,0.769288,2.415
-0.769288,0.631338,-7.245
-0.769288,0.631338,2.415
-0.952332,0.288887,2.415
-0.992795,0.073159,0.0
-0.990393,0.097545,-7.245
-0.997598,-0.024386,0.0
-0.987991,-0.121931,0.0
-0.973672,-0.218539,0.0
-0.945219,-0.312336,0.0
-0.952332,-0.288887,-7.245
-0.952332,-0.288887,2.415
-0.912328,-0.404294,0.0
-0.866123,-0.490738,0.0
-0.877675,-0.469127,-7.245
-0.877675,-0.469127,2.415
-0.815924,-0.574512,0.0
-0.769288,-0.631338,-7.245
-0.688165,-0.722652,0.0
-0.631338,-0.769288,2.415
-0.533959,-0.843021,0.0
-0.359234,-0.930993,0.0
-0.265438,-0.959446,0.0
-0.288887,-0.952332,2.415
-0.097545,-0.990393,2.415
-0.073159,-0.992795,9.66
-0.265438,-0.959446,9.66
-0.382683,-0.92388,-2.415
-0.490738,-0.866123,-9.66
-0.784834,-0.612396,-9.66
-0.753743,-0.650281,9.66
-0.83147,-0.55557,-2.415
-0.866123,-0.490738,9.66
-0.92388,-0.382683,-2.415
-0.959446,-0.265438,-9.66
-0.945219,-0.312336,9.66
-0.980785,-0.19509,-2.415
-0.992795,-0.073159,-9.66
-0.987991,-0.121931,9.66
-0.987991,0.121931,-9.66
-0.992795,0.073159,9.66
-0.889226,0.447516,9.66
-0.784834,0.612396,9.66
-0.612396,0.784834,-9.66
-0.447516,0.889226,-9.66
0.218539,-0.973672,9.66
-0.170704,-0.983187,9.66
-0.19509,-0.980785,7.245
-0.359234,-0.930993,9.66
-0.533959,-0.843021,9.66
-0.55557,-0.83147,7.245
-0.722652,-0.688165,-9.66
-0.912328,-0.404294,9.66
-0.92388,-0.382683,7.245
-0.930993,-0.359234,-9.66
-0.980785,-0.19509,7.245
-0.983187,-0.170704,-9.66
-0.997598,-0.024386,9.66
-1.0,0.0,7.245
-0.983187,0.170704,9.66
-0.973672,0.218539,-9.66
-0.930993,0.359234,9.66
-0.83147,0.55557,7.245
-0.688165,0.722652,-9.66
-0.688165,0.722652,0.0
-0.877675,0.469127,7.245
-0.952332,0.288887,7.245
-0.987991,0.121931,0.0
-0.990393,0.097545,-2.415
-0.992795,-0.073159,0.0
-0.983187,-0.170704,0.0
-0.990393,-0.097545,-2.415
-0.990393,-0.097545,7.245
-0.959446,-0.265438,0.0
-0.930993,-0.359234,0.0
-0.952332,-0.288887,-2.415
-0.952332,-0.288887,7.245
-0.877675,-0.469127,-2.415
-0.784834,-0.612396,0.0
-0.722652,-0.688165,0.0
-0.769288,-0.631338,-2.415
-0.631338,-0.769288,-2.415
-0.631338,-0.769288,7.245
-0.490738,-0.866123,0.0
-0.312336,-0.945219,0.0
-0.218539,-0.973672,0.0
-0.121931,-0.987991,0.0
-0.097545,-0.990393,-2.415
-0.048773,-0.995196,2.415
-0.048773,-0.995196,7.245
-0.048773,-0.995196,-2.415
-0.170704,-0.983187,-4.83
-0.265438,-0.959446,4.83
-0.218539,-0.973672,-4.83
-0.241989,-0.966559,-2.415
-0.359234,-0.930993,-4.83
-0.335785,-0.938106,-7.245
-0.447516,-0.889226,4.83
-0.425905,-0.900777,2.415
-0.425905,-0.900777,7.245
-0.447516,-0.889226,-4.83
-0.425905,-0.900777,-7.245
-0.425905,-0.900777,-2.415
-0.533959,-0.843021,-4.83
-0.490738,-0.866123,-4.83
-0.593454,-0.800379,2.415
-0.593454,-0.800379,7.245
-0.612396,-0.784834,-4.83
-0.593454,-0.800379,-7.245
-0.593454,-0.800379,-2.415
-0.688165,-0.722652,-4.83
-0.650281,-0.753743,-4.83
-0.753743,-0.650281,4.83
-0.722652,-0.688165,4.83
-0.738197,-0.669223,7.245
-0.722652,-0.688165,-4.83
-0.738197,-0.669223,-7.245
-0.738197,-0.669223,-2.415
-0.784834,-0.612396,-4.83
-0.800379,-0.593454,-7.245
-0.800379,-0.593454,-2.415
-0.866123,-0.490738,4.83
-0.843021,-0.533959,4.83
-0.854572,-0.512349,2.415
-0.854572,-0.512349,7.245
-0.866123,-0.490738,-4.83
-0.854572,-0.512349,-7.245
-0.854572,-0.512349,-2.415
-0.889226,-0.447516,-4.83
-0.900777,-0.425905,-7.245
-0.900777,-0.425905,-2.415
-0.945219,-0.312336,4.83
-0.930993,-0.359234,4.83
-0.938106,-0.335785,2.415
-0.938106,-0.335785,7.245
-0.945219,-0.312336,-4.83
-0.930993,-0.359234,-4.83
-0.938106,-0.335785,-7.245
-0.938106,-0.335785,-2.415
-0.973672,-0.218539,-4.83
-0.959446,-0.265438,-4.83
-0.966559,-0.241989,-7.245
-0.966559,-0.241989,-2.415
-0.987991,-0.121931,4.83
-0.985589,-0.146318,7.245
-0.987991,-0.121931,-4.83
-0.983187,-0.170704,-4.83
-0.985589,-0.146318,-7.245
-0.992795,-0.073159,-4.83
-0.995196,-0.048773,-7.245
-0.995196,-0.048773,-2.415
-0.992795,0.073159,4.83
-0.997598,0.024386,4.83
-0.995196,0.048773,2.415
-0.995196,0.048773,7.245
-0.992795,0.073159,-4.83
-0.995196,0.048773,-2.415
-0.985589,0.146318,-7.245
-0.985589,0.146318,-2.415
-0.973672,0.218539,4.83
-0.966559,0.241989,2.415
-0.966559,0.241989,-2.415
-0.889226,0.447516,4.83
-0.912328,0.404294,4.83
-0.900777,0.425905,7.245
-0.815924,0.574512,-4.83
-0.738197,0.669223,-2.415
-0.669223,0.738197,2.415
-0.669223,0.738197,7.245
-0.593454,0.800379,-7.245
-0.593454,0.800379,-2.415
-0.490738,0.866123,-4.83
-0.593454,0.800379,2.415
-0.930993,0.359234,4.83
-0.945219,0.312336,4.83
-0.938106,0.335785,2.415
-0.983187,0.170704,4.83
-0.985589,0.146318,2.415
-0.997598,-0.024386,4.83
-0.992795,-0.073159,4.83
-0.995196,-0.048773,2.415
-0.995196,-0.048773,7.245
-0.973672,-0.218539,4.83
-0.959446,-0.265438,4.83
-0.966559,-0.241989,2.415
-0.966559,-0.241989,7.245
-0.900777,-0.425905,2.415
-0.900777,-0.425905,7.245
-0.815924,-0.574512,4.83
-0.784834,-0.612396,4.83
-0.800379,-0.593454,2.415
-0.688165,-0.722652,4.83
-0.650281,-0.753743,4.83
-0.533959,-0.843021,4.83
-0.490738,-0.866123,4.83
-0.359234,-0.930993,4.83
-0.170704,-0.983187,4.83
0.024386,-0.997598,4.83
0.048773,-0.995196,2.415
0.048773,-0.995196,7.245
0.073159,-0.992795,2.415
-0.121931,-0.987991,7.245
-0.121931,-0.987991,2.415
-0.170704,-0.983187,2.415
-0.312336,-0.945219,2.415
-0.359234,-0.930993,2.415
-0.490738,-0.866123,7.245
-0.490738,-0.866123,2.415
-0.533959,-0.843021,2.415
-0.650281,-0.753743,2.415
-0.688165,-0.722652,2.415
-0.784834,-0.612396,7.245
-0.784834,-0.612396,2.415
-0.815924,-0.574512,2.415
-0.889226,-0.447516,7.245
-0.889226,-0.447516,2.415
-0.959446,-0.265438,7.245
-0.959446,-0.265438,2.415
-0.973672,-0.218539,2.415
-0.992795,-0.073159,7.245
-0.992795,-0.073159,2.415
-0.997598,-0.024386,2.415
-0.987991,0.121931,7.245
-0.987991,0.121931,2.415
-0.945219,0.312336,7.245
-0.930993,0.359234,2.415
-0.753743,0.650281,2.415
-0.574512,0.815924,2.415
-0.533959,0.843021,-7.245
-0.574512,0.815924,-7.245
-0.650281,0.753743,-7.245
-0.688165,0.722652,2.415
-0.784834,0.612396,2.415
-0.889226,0.447516,-7.245
-0.912328,0.404294,7.245
-0.973672,0.218539,7.245
-0.973672,0.218539,2.415
-0.997598,0.024386,-2.415
-0.997598,0.024386,-7.245
-0.997598,0.024386,2.415
-0.992795,0.073159,2.415
-0.992795,-0.073159,-2.415
-0.992795,-0.073159,-7.245
-0.983187,-0.170704,-2.415
-0.987991,-0.121931,-7.245
-0.983187,-0.170704,2.415
-0.987991,-0.121931,2.415
-0.959446,-0.265438,-2.415
-0.959446,-0.265438,-7.245
-0.973672,-0.218539,-7.245
-0.930993,-0.359234,-2.415
-0.930993,-0.359234,-7.245
-0.945219,-0.312336,-7.245
-0.930993,-0.359234,7.245
-0.930993,-0.359234,2.415
-0.945219,-0.312336,2.415
-0.889226,-0.447516,-2.415
-0.889226,-0.447516,-7.245
-0.912328,-0.404294,-7.245
-0.843021,-0.533959,-2.415
-0.843021,-0.533959,-7.245
-0.843021,-0.533959,7.245
-0.843021,-0.533959,2.415
-0.784834,-0.612396,-2.415
-0.784834,-0.612396,-7.245
-0.722652,-0.688165,-2.415
-0.722652,-0.688165,-7.245
-0.753743,-0.650281,-7.245
-0.722652,-0.688165,7.245
-0.722652,-0.688165,2.415
-0.753743,-0.650281,2.415
-0.650281,-0.753743,-2.415
-0.650281,-0.753743,-7.245
-0.688165,-0.722652,-7.245
-0.490738,-0.866123,-2.415
-0.490738,-0.866123,-7.245
-0.533959,-0.843021,-7.245
-0.218539,-0.973672,-2.415
-0.218539,-0.973672,-7.245
-0.218539,-0.973672,2.415
-0.265438,-0.959446,2.415
-0.121931,-0.987991,-2.415
-0.170704,-0.983187,-2.415
-0.265438,-0.959446,7.245
-0.265438,-0.959446,-2.415
-0.359234,-0.930993,-2.415
-0.447516,-0.889226,7.245
-0.447516,-0.889226,-2.415
-0.533959,-0.843021,-2.415
-0.688165,-0.722652,-2.415
-0.753743,-0.650281,7.245
-0.753743,-0.650281,-2.415
-0.866123,-0.490738,7.245
-0.866123,-0.490738,-2.415
-0.945219,-0.312336,7.245
-0.945219,-0.312336,-2.415
-0.973672,-0.218539,-2.415
-0.987991,-0.121931,-2.415
-0.997598,-0.024386,-2.415
-0.992795,0.073159,7.245
-0.959446,0.265438,7.245
-0.574512,0.815924,-2.415
-0.843021,0.533959,7.245
-0.983187,0.170704,7.245
-0.997598,-0.024386,7.245
-0.973672,-0.218539,7.245
-0.912328,-0.404294,7.245
-0.815924,-0.574512,7.245
-0.688165,-0.722652,7.245
-0.533959,-0.843021,7.245
-0.170704,-0.983187,7.245
-0.206815,-0.977229,9.66
-0.697636,-0.714879,-9.66
-0.823697,-0.565041,-9.66
-0.83147,-0.55557,-8.452499
-0.918104,-0.393489,-9.66
-0.92388,-0.382683,-8.452499
-0.927436,-0.370959,9.66
-0.980785,-0.19509,-8.452499
-0.981986,-0.182897,9.66
-0.998799,0.012193,9.66
-0.918104,0.393489,9.66
-0.565041,0.823697,-9.66
-0.19509,-0.980785,1.2075
-0.479932,-0.871899,9.66
-0.55557,-0.83147,1.2075
-0.64081,-0.761515,9.66
-0.761515,-0.64081,-9.66
-0.871899,-0.479932,-9.66
-0.88345,-0.458321,9.66
-0.92388,-0.382683,1.2075
-0.948776,-0.300611,-9.66
-0.955889,-0.277162,9.66
-0.980785,-0.19509,1.2075
-0.989192,-0.109738,-9.66
-0.991594,-0.085352,9.66
-1.0,0.0,1.2075
-0.948776,0.300611,9.66
-0.92388,0.382683,1.2075
-0.761515,0.64081,9.66
-0.64081,0.761515,-9.66
-0.479932,0.871899,-9.66
-0.565041,0.823697,0.0
-0.631338,0.769288,-8.452499
-0.714879,0.697636,0.0
-0.777061,0.621867,0.0
-0.952332,0.288887,1.2075
-0.991594,0.085352,0.0
-0.990393,-0.097545,1.2075
-0.948776,-0.300611,0.0
-0.952332,-0.288887,-8.452499
-0.952332,-0.288887,1.2075
-0.918104,-0.393489,0.0
-0.871899,-0.479932,0.0
-0.877675,-0.469127,-8.452499
-0.877675,-0.469127,1.2075
-0.823697,-0.565041,0.0
-0.761515,-0.64081,0.0
-0.631338,-0.769288,1.2075
-0.544765,-0.837245,0.0
-0.370959,-0.927436,0.0
-0.277162,-0.955889,0.0
-0.288887,-0.952332,-8.452499
-0.288887,-0.952332,1.2075
-0.182897,-0.981986,0.0
-0.085352,-0.991594,0.0
-0.097545,-0.990393,1.2075
0.097545,-0.990393,1.2075
-0.060966,-0.993995,9.66
-0.382683,-0.92388,-3.6225
-0.501543,-0.860348,-9.66
-0.707107,-0.707107,-3.6225
-0.74597,-0.659752,9.66
-0.83147,-0.55557,-3.6225
-0.92388,-0.382683,-3.6225
-0.963002,-0.253713,-9.66
-0.941663,-0.324061,9.66
-0.980785,-0.19509,-3.6225
-0.98679,-0.134125,9.66
-0.993995,0.060966,9.66
-0.980785,0.19509,-3.6225
-0.707107,0.707107,-3.6225
-0.19509,-0.980785,6.0375
-0.34751,-0.934549,9.66
-0.4151,-0.906553,-9.66
-0.678694,-0.730425,9.66
-0.92388,-0.382683,6.0375
-0.970115,-0.230264,9.66
-0.980785,-0.19509,6.0375
-0.984388,-0.158511,-9.66
-0.996397,-0.036579,9.66
-1.0,0.0,6.0375
-0.980785,0.19509,6.0375
-0.848796,0.523154,9.66
-0.808152,0.583983,-9.66
-0.678694,0.730425,-9.66
-0.769288,0.631338,-3.6225
-0.877675,0.469127,6.0375
-0.952332,0.288887,6.0375
-0.98679,0.134125,0.0
-0.993995,-0.060966,0.0
-0.984388,-0.158511,0.0
-0.990393,-0.097545,-3.6225
-0.990393,-0.097545,6.0375
-0.963002,-0.253713,0.0
-0.934549,-0.34751,0.0
-0.952332,-0.288887,-3.6225
-0.952332,-0.288887,6.0375
-0.895001,-0.436711,0.0
-0.877675,-0.469127,-3.6225
-0.792606,-0.602925,0.0
-0.769288,-0.631338,-3.6225
-0.583983,-0.808152,0.0
-0.631338,-0.769288,-3.6225
-0.631338,-0.769288,6.0375
-0.4151,-0.906553,0.0
-0.230264,-0.970115,0.0
-0.288887,-0.952332,6.0375
-0.048773,-0.995196,6.0375
-0.277162,-0.955889,4.83
-0.230264,-0.970115,4.83
-0.335785,-0.938106,-3.6225
-0.4151,-0.906553,4.83
-0.425905,-0.900777,1.2075
-0.425905,-0.900777,6.0375
-0.4151,-0.906553,-4.83
-0.544765,-0.837245,-4.83
-0.583983,-0.808152,4.83
-0.593454,-0.800379,1.2075
-0.593454,-0.800379,6.0375
-0.583983,-0.808152,-4.83
-0.593454,-0.800379,-8.452499
-0.593454,-0.800379,-3.6225
-0.761515,-0.64081,4.83
-0.761515,-0.64081,-4.83
-0.738197,-0.669223,-3.6225
-0.823697,-0.565041,-4.83
-0.792606,-0.602925,-4.83
-0.800379,-0.593454,-8.452499
-0.800379,-0.593454,-3.6225
-0.871899,-0.479932,4.83
-0.848796,-0.523154,4.83
-0.854572,-0.512349,1.2075
-0.854572,-0.512349,6.0375
-0.871899,-0.479932,-4.83
-0.854572,-0.512349,-8.452499
-0.854572,-0.512349,-3.6225
-0.895001,-0.436711,-4.83
-0.900777,-0.425905,-8.452499
-0.900777,-0.425905,-3.6225
-0.948776,-0.300611,4.83
-0.934549,-0.34751,4.83
-0.938106,-0.335785,1.2075
-0.938106,-0.335785,6.0375
-0.948776,-0.300611,-4.83
-0.934549,-0.34751,-4.83
-0.938106,-0.335785,-8.452499
-0.938106,-0.335785,-3.6225
-0.963002,-0.253713,-4.83
-0.966559,-0.241989,-8.452499
-0.966559,-0.241989,-3.6225
-0.984388,-0.158511,4.83
-0.985589,-0.146318,6.0375
-0.989192,-0.109738,-4.83
-0.995196,-0.048773,-3.6225
-0.996397,0.036579,-4.83
-0.985589,0.146318,-3.6225
-0.970115,0.230264,4.83
-0.966559,0.241989,1.2075
-0.966559,0.241989,6.0375
-0.906553,0.4151,4.83
-0.900777,0.425905,6.0375
-0.88345,0.458321,-4.83
-0.900777,0.425905,-8.452499
-0.854572,0.512349,-8.452499
-0.800379,0.593454,-8.452499
-0.738197,0.669223,-3.6225
-0.64081,0.761515,-4.83
-0.593454,0.800379,-8.452499
-0.512349,0.854572,-8.452499
-0.981986,0.182897,4.83
-0.995196,-0.048773,6.0375
-0.977229,-0.206815,4.83
-0.963002,-0.253713,4.83
-0.966559,-0.241989,1.2075
-0.966559,-0.241989,6.0375
-0.918104,-0.393489,4.83
-0.900777,-0.425905,1.2075
-0.900777,-0.425905,6.0375
-0.792606,-0.602925,4.83
-0.659752,-0.74597,4.83
-0.544765,-0.837245,4.83
-0.501543,-0.860348,4.83
-0.512349,-0.854572,1.2075
-0.182897,-0.981986,4.83
-0.134125,-0.98679,4.83
0.048773,-0.995196,1.2075
-0.230264,-0.970115,9.66
-0.382683,-0.92388,-6.0375
-0.4151,-0.906553,9.66
-0.678694,-0.730425,-9.66
-0.583983,-0.808152,9.66
-0.83147,-0.55557,-6.0375
-0.92388,-0.382683,-6.0375
-0.970115,-0.230264,-9.66
-0.934549,-0.34751,9.66
-0.984388,0.158511,-9.66
-0.970115,0.230264,9.66
-0.808152,0.583983,9.66
-0.583983,0.808152,-9.66
-0.55557,0.83147,-6.0375
-0.19509,-0.980785,3.6225
-0.55557,-0.83147,3.6225
-0.792606,-0.602925,9.66
-0.83147,-0.55557,3.6225
-0.92388,-0.382683,3.6225
-0.941663,-0.324061,-9.66
-0.963002,-0.253713,9.66
-0.980785,-0.19509,3.6225
-0.98679,0.134125,9.66
-0.707107,0.707107,3.6225
-0.501543,0.860348,-9.66
-0.952332,0.288887,3.6225
-0.990393,0.097545,3.6225
-0.990393,-0.097545,3.6225
-0.941663,-0.324061,0.0
-0.952332,-0.288887,-6.0375
-0.877675,-0.469127,-6.0375
-0.877675,-0.469127,3.6225
-0.769288,-0.631338,3.6225
-0.631338,-0.769288,-6.0375
-0.631338,-0.769288,3.6225
-0.436711,-0.895001,0.0
-0.34751,-0.934549,0.0
-0.288887,-0.952332,-6.0375
-0.288887,-0.952332,3.6225
-0.085352,-0.991594,9.66
-0.300611,-0.948776,-9.66
-0.64081,-0.761515,-9.66
-0.707107,-0.707107,-1.2075
-0.871899,-0.479932,9.66
-0.92388,-0.382683,-1.2075
-0.955889,-0.277162,-9.66
-0.948776,-0.300611,9.66
-0.980785,-0.19509,-1.2075
-1.0,0.0,-1.2075
-0.980785,0.19509,-1.2075
-0.955889,0.277162,9.66
-0.88345,0.458321,9.66
-0.621867,0.777061,-9.66
-0.55557,0.83147,-1.2075
-0.458321,0.88345,-9.66
-0.182897,-0.981986,9.66
-0.19509,-0.980785,8.452499
-0.370959,-0.927436,9.66
-0.544765,-0.837245,9.66
-0.83147,-0.55557,8.452499
-0.92388,-0.382683,8.452499
-0.980785,-0.19509,8.452499
-0.981986,0.182897,9.66
-0.980785,0.19509,8.452499
-0.92388,0.382683,8.452499
-0.83147,0.55557,8.452499
-0.823697,0.565041,-9.66
python 3d computer-vision point-clouds scipy-optimize
1个回答
0
投票

(x - a)^2 + (y - b)^2 = r^2 .

该公式的含义是针对 xy 平面上半径为 r、圆心位于 (a, b) 的圆。自由不受约束的 z 坐标可以具有任何值。因此,该公式适用于以 r 为半径、以 z 轴为方向穿过点 (a, b, 0) 的圆柱体。

为了在三维空间中表示任意圆柱体,必须将位置和轴方向加上圆柱体的半径。

您的坐标值已保存为 xyz 文件并使用 FindSurface Web 演示 (https://developers.curvsurf.com/WebDemo/) 进行处理。

© www.soinside.com 2019 - 2024. All rights reserved.