The algorithm is fast because it returns a list of indexes, to your original array, of the points that make up the triangle, it also returns a list of half edges
from pyrx import Ap, Db, Ed, Ge, Gi
import traceback
@Ap.Command()
def doit():
try:
filter = [(Db.DxfCode.kDxfStart, "POINT")]
ps, ss = Ed.Editor.selectPrompt(
"\nSelect points: ", "\nRemove points: ", filter
)
if ps != Ed.PromptStatus.eNormal:
return
pnts = Ge.Point3dArray([Db.Point(id).position() for id in ss])
d = Ge.Delaunator(pnts)
print(d.triangles())
print(d.halfedges())
except Exception:
print(traceback.format_exc())
[0, 4, 3, 2, 1, 0, 0, 1, 4, 3, 2, 0]
[8, -1, 11, -1, 6, 10, 4, -1, 0, -1, 5, 2]