Freedom-of-Form-Foundation / anatomy3d

A CAD tool for humanoid anatomy alterations. See the anatomy3d-blender repository for more recent work.
https://freedomofform.org/1856/3d-anatomy-project-scope-phase-1-focus-on-a-limb-joint/
GNU General Public License v2.0
7 stars 5 forks source link

Parallelize the easily parallelized part of Cylinder.GenerateVertexList. #52

Closed AdamNorberg closed 3 years ago

AdamNorberg commented 3 years ago

Where we're obviously doing a lot of computation, we should try to use more of the computer's CPU resources. On modern computers, that means more cores rather than more single-core performance.

The first part of GenerateVertexList is "embarrassingly parallel": its outputs have no sequential dependency on each other. Parallel LINQ therefore has a reasonably natural representation of the operation.

The second part, which recalculates all the normals, writes back into the thing it's reading from. However, the only thing that changes appears to be the normals, and the only thing that is read appears to be the positions, so I think this is a candidate too. However, it requires more thought, and there's no reason to wait to solve that problem before creating a pull request for the easy part.