Moved function static pointInTriangle to a local function, which really helped. I think I’ve squeezed about all the performance out of it.
Race MgdTestBcad_06.dll, Total Time in Milliseconds = 1763
I’m not sure how nested XREFs store block transformations, I’ll look into this next, to easily handle drawings like QUALIFY.
Also, I’ll think of a way to catch these outside cases that are outside the TIN, maybe generate a convex hull and use the elevation of the nearest segment ..?..
edit, added method maketin, to create the triangles, for testing that the routine is correct