Skip to content

Instantly share code, notes, and snippets.

@hugoledoux
Last active January 26, 2024 10:08
Show Gist options
  • Save hugoledoux/a37f8ecae8a399b5e0999793c2da2289 to your computer and use it in GitHub Desktop.
Save hugoledoux/a37f8ecae8a399b5e0999793c2da2289 to your computer and use it in GitHub Desktop.
import startinpy
import laspy
import numpy as np
import sys
np.set_printoptions(precision=3, suppress=True)
las = laspy.read('/Users/hugo/teaching/hw04-marking/data/area_full.laz')
print(las)
pts = np.vstack((las.x, las.y, las.z)).transpose()
print(np.max(pts))
print(np.max(pts, axis=1))
print(np.min(pts, axis=0))
sys.exit()
dt = startinpy.DT()
#-- thin with 1/100
dt.insert(pts[::1000])
print(dt)
#-- plot
import matplotlib.pyplot as plt
plt.triplot(dt.points[:,0], dt.points[:,1], dt.triangles)
#-- the vertex "0" shouldn't be plotted, so start at 1
plt.plot(dt.points[1:,0], dt.points[1:,1], 'o')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment