Open haruby511 opened 4 years ago
I've been thinking about this as well. I've been keeping my eye on the development of System.Numerics.Vector (in corefx) for this very reason. However, many of the uses of MIConvexhull are for dimensions greater than 3 (especially in the context of solving 3D voronoi or delauanay triangulation). That said, we have been hard at work at the specialized 2d version of convex hull (see recent commits) - so it does seem natural to extend this 3d for the very purpose that you recommend. Unfortunately, I'm a bit crushed right now. but it is something that I would like to see get done.
As you know, most of 3D applications in C# are using
struct
forVertex
orVector
. Because it does not generate garbage at all in most cases.However, In this situation, cannot access the member X, Y, Z with byte offset. Such as 0 for X, 1 for Y etc. If really need to access the member by index and must avoid
switch
, use array instead even though it will be a garbage.I wonder that, the MIConvexHull really need array for the vertex?
I can see the
IVertex
interface. It should work as reference and astruct
will be boxed which has implemented the interface. But, should avoid boxing/unboxing as well in performance critical situation.I suggest that adding a
struct Vertex
the MIConvexHull own, or use a singledouble
collection for whole vertices.