Skip to content

Conversation

@damienmarchal
Copy link
Contributor

@damienmarchal damienmarchal commented Aug 27, 2025

Follow up of the work on SofaImplicitField.

In PR #5559 we add python binding to ScalarField, so we can implement a scalar field in python
In PR #5565 we add a component class FieldToSurfaceMesh to mesh any Scalar Field using marching cube
In PR #5672 we add asynchronous computation to the component FieldToSurfaceMesh

In the present PR we add vectorized version of ScalarField::getValue so it can process chunk of field evaluation.
Typically the kind of workload/pattern that happens when using ScalarFields for collision, rendering with raymarching or meshing.

Using the vectorized API has big consequences in term of performances especially when the field is implemented in python or using a cuda implementation on GPU.


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@damienmarchal damienmarchal added pr: enhancement About a possible enhancement pr: status wip Development in the pull-request is still in progress labels Aug 27, 2025
@damienmarchal damienmarchal changed the title Pr add vectorized scalarfield binding [SofaImplicitField] add vectorized scalarfield binding Aug 27, 2025
@damienmarchal damienmarchal force-pushed the pr-add-vectorized-scalarfield-binding branch from f6a9bf8 to 1ec59f7 Compare October 8, 2025 19:23
@damienmarchal damienmarchal force-pushed the pr-add-vectorized-scalarfield-binding branch from 1ec59f7 to e966ddd Compare October 8, 2025 19:33
@damienmarchal
Copy link
Contributor Author

damienmarchal commented Oct 9, 2025

Small benchmark (benchmark_implicit.py): meshing spherical field function using a grid with a 200x200x200 rsolution took:
python + python loop: 277.4 seconds
python + numpy: took 2.4 seconds
python + numba/jit: took 1.4 seconds
python + drjit/llvm: took 2.4 second
python + drjit/cuda: took 1.7 seconds
C++: took 0.9 seconds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: enhancement About a possible enhancement pr: status wip Development in the pull-request is still in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant