Created
May 6, 2019 14:45
-
-
Save hugoledoux/e07a4f8f6278cc742b454bbf72566f58 to your computer and use it in GitHub Desktop.
speed comparison startin and scipy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scipy.spatial import Delaunay | |
import sys | |
import csv | |
points = [] | |
with open('/Users/hugo/Dropbox/data/terrains/l2.txt', newline='') as csvfile: | |
r = csv.reader(csvfile, delimiter=' ', quotechar='|') | |
next(r, None) # skip the headers | |
for row in r: | |
points.append([float(row[0]), float(row[1])]) | |
# t.insert_one_pt(float(row[0]), float(row[1]), float(row[2])) | |
# print(row[0]) | |
# tri = Delaunay(points, incremental=True) | |
tri = Delaunay(points) | |
# tri.add_points([[85072.5, 447421.8]]) | |
print("done.") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import startin | |
import sys | |
import csv | |
t = startin.DT() | |
with open('/Users/hugo/Dropbox/data/terrains/l2.txt', newline='') as csvfile: | |
r = csv.reader(csvfile, delimiter=' ', quotechar='|') | |
next(r, None) # skip the headers | |
for row in r: | |
t.insert_one_pt(float(row[0]), float(row[1]), float(row[2])) | |
# print(row[0]) | |
print("# vertices:", t.number_of_vertices()) | |
print("# triangles:", t.number_of_triangles()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment