gradientspace / geometry3Sharp

C# library for 2D/3D geometric computation, mesh algorithms, and so on. Boost license.
http://www.gradientspace.com
Boost Software License 1.0
1.71k stars 384 forks source link

Where do I find source code for the implementation of DenseGridTrilinearImplict #127

Closed YangShen398 closed 4 years ago

YangShen398 commented 4 years ago

Dr. Ryan,

First of all, I would like to thank you for building such an amazing library. It works pretty well so far. Currently, I am working on a project which needs to implement interpolation function for 3D vector, i.e., (x, y, z) => (vx, vy, vz). I implemented it in C# and tested it with small size data and it worked pretty well. But when data grows it quickly runs out of memory. So I would like to see how DenseGridTrilinearImplict was implement in C# but I couldn't find it in Github. Now I have two questions:

  1. Where can I find implementation of DenseGridTrilinearImplict ? Was it implemented in C++ as in geometry3cpp?
  2. For this kind of problem (performance/out-of-memory issue), I was thinking about writing library in C++ and use it in C# ? Am I on the right track?

Thanks,

rms80 commented 4 years ago

https://github.com/gradientspace/geometry3Sharp/blob/master/implicit/GridImplicits3d.cs

for a dense grid of values (ie a huge 1D/2D/3D array) C++ and C# will use roughly the same amount of memory. Basic for-loop processing will be somewhat faster in C++, but you might benefit from vectorization/etc. Multithreading will be easier in C# (in my experience).