cadop / dhart

A library for Navigation Graphs, Visibility, Raycasting and other features for Design Humans Analysis RoboTics (DHART).
https://cadop.github.io/dhart/
GNU General Public License v3.0
13 stars 7 forks source link

consider changing C_Interface to use floats #38

Closed cadop closed 1 year ago

cadop commented 1 year ago

Another idea I had was to simplify another data conversion on the c++ side. What is the rationale behind the conversions in lines 273 & 274? https://github.com/cadop/dhart/blob/30648be3f7b9df812a61d0b9fee22f60eaf42f78/src/Cinterface/raytracer_C.cpp#L271-L279

In the end, we need float values anyway: https://github.com/cadop/dhart/blob/30648be3f7b9df812a61d0b9fee22f60eaf42f78/src/Cpp/raytracer/src/embree_raytracer.cpp#L621-L626

If it's only to make looping over data more convenient, then it could be restructured to operating directly on a pointer to the float array we pass from c#. This could shave off another few ms per call.

Originally posted by @mariuszhermansdorfer in https://github.com/cadop/dhart/discussions/33#discussioncomment-4257009

cadop commented 1 year ago

The steps in between these two functions seems to be the main motivation and reason to have this structure. Its not just about looping over points, but also checking the sizes of the sets to determine which method to use, and how to parallelize it using omp parallel.