Implicit Surface Raycast

https://github.com/nortikin/sverchok/assets/14288520/c77d08d7-3cf5-40f0-96d9-9a298b180aae

Dependencies

This node requires SciPy library to work.

Functionality

This node implements ray casting onto an arbitrary implicit surface; in other words, given a point in 3D space and ray direction vector, it will find a point where this ray intersects the given surface first time.

Implicit surface is specified by providing a scalar field and it’s value, used to define an iso-surface.

This node uses a numerical method to find the intersection point, so it may be not very fast. If you happen to know how to find the intersection point for your specific surface by some formula, that will be faster and more precise.

https://github.com/nortikin/sverchok/assets/14288520/81e705a6-0ebd-4b32-836f-e3a0c8fbc3d5

Inputs

This node has the following inputs:

  • Field. Scalar field, which defines the iso-surface to find the intersection with. This input is mandatory.

  • Vertices. Source point(s) of the ray(s). The default value is (0, 0, 0).

  • Direction. Direction vector of the ray. The default value is (0, 0, 1).

  • IsoValue. The value of the scalar field, which defines the iso-surface in question. The default value is 0.

    https://github.com/nortikin/sverchok/assets/14288520/792915bc-0726-445d-bf8c-3f6d8e83ba70

Outputs

This node has the following outputs:

  • Vertices. Intersection points in 3D space.

  • Distance. Distance between ray source point and the intersection point.

Example of usage

https://github.com/nortikin/sverchok/assets/14288520/cf1514ec-f894-4264-8619-64ccc354f7c5 https://github.com/nortikin/sverchok/assets/14288520/dd79a2ff-d011-4d05-89fc-eed0d585eb6e
https://user-images.githubusercontent.com/284644/87581701-d075fc80-c6f2-11ea-9eb6-ab02ba69ef2a.png