Skip to content
Snippets Groups Projects
Commit e0e6a6cf authored by encinass1u's avatar encinass1u
Browse files

Upload New File

parent 7c6740f9
Branches
No related tags found
No related merge requests found
import numpy as np
import open3d as o3d
import copy
# Read .ply file, this file contains guassian filter for the surface saved
input_file = "from_stl.ply"
pcd = o3d.io.read_point_cloud(input_file) # Read the point cloud
# Convert open3d format to numpy array, the format here is point cloud in numpy format
Pc = np.asarray(pcd.points)
Sf = copy.deepcopy(Pc)
L = len(Pc)
iter = 1
#M is the half of surface thickness, values under it will be 0, over this 1
M = 3.173115
#Calculation for the value in each coordinate with relation of their hight
while iter<= L:
for i in range (0,L):
for j in range (2, 3):
if Pc[i,j]> M:
Sf[i,j]=1
else:
Sf[i,j]=0
iter+=1
print(Sf)
#For Y
Dt = copy.deepcopy(Sf)
for i in range (0,L):
for j in range (1,2):
Dt[i,j]= -int((Sf[i,j]+21.8168)/0.0052)
#For X
for i in range (0,L):
for j in range (0,1):
Dt[i,j]= -int((Sf[i,j]+8.445706367)/0.005214)
#data_t for thickness parameter
data_t = np.flip(Dt, axis=0)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment