Skip to content

Commit

Permalink
Merge pull request #4930 from nortikin/update_menu_nodes_comments_39
Browse files Browse the repository at this point in the history
Some surfaces-> help

- Implicit Surface Raycast
- Marching Cubes
  • Loading branch information
satabol authored Jun 25, 2023
2 parents eafe2dd + c68a2aa commit 8f646ea
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 1 deletion.
37 changes: 36 additions & 1 deletion docs/nodes/surface/implicit_surface_raycast.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Implicit Surface Raycast
========================

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

Dependencies
------------

Expand All @@ -24,6 +27,9 @@ 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.

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

Inputs
------

Expand All @@ -34,6 +40,9 @@ This node has the following inputs:
* **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.

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

Outputs
-------

Expand All @@ -45,5 +54,31 @@ This node has the following outputs:
Example of usage
----------------

.. image:: https://user-images.githubusercontent.com/284644/87581701-d075fc80-c6f2-11ea-9eb6-ab02ba69ef2a.png
.. image:: https://github.com/nortikin/sverchok/assets/14288520/cf1514ec-f894-4264-8619-64ccc354f7c5
:target: https://github.com/nortikin/sverchok/assets/14288520/cf1514ec-f894-4264-8619-64ccc354f7c5

* Generator-> :doc:`Segment </nodes/generator/segment>`
* Generator-> :doc:`Plane </nodes/generator/plane_mk3>`
* Generator-> :doc:`Box </nodes/generator/box_mk2>`
* Fields-> :doc:`Attractor Field </nodes/field/attractor_field_mk2>`
* Matrix-> :doc:`Matrix In </nodes/matrix/matrix_in_mk4>`
* Surfaces-> :doc:`Marching Cubes </nodes/surface/marching_cubes>`
* Viz-> :doc:`Viewer Draw </nodes/viz/viewer_draw_mk4>`

.. image:: https://github.com/nortikin/sverchok/assets/14288520/dd79a2ff-d011-4d05-89fc-eed0d585eb6e
:target: https://github.com/nortikin/sverchok/assets/14288520/dd79a2ff-d011-4d05-89fc-eed0d585eb6e

---------

.. image:: https://user-images.githubusercontent.com/284644/87581701-d075fc80-c6f2-11ea-9eb6-ab02ba69ef2a.png
:target: https://user-images.githubusercontent.com/284644/87581701-d075fc80-c6f2-11ea-9eb6-ab02ba69ef2a.png

* Generator-> :doc:`Box </nodes/generator/box_mk2>`
* Curves->Curve Primitives-> :doc:`Ellipse (Curve) </nodes/curve/ellipse>`
* Curves-> :doc:`Evaluate Curve </nodes/curve/eval_curve>`
* Surfaces-> :doc:`Marching Cubes </nodes/surface/marching_cubes>`
* Modifiers->Modifier Make-> :doc:`UV Connection </nodes/modifier_make/uv_connect>`
* Number-> :doc:`A Number </nodes/number/numbers>`
* Number-> :doc:`List Input </nodes/number/list_input>`
* Matrix-> :doc:`Matrix In </nodes/matrix/matrix_in_mk4>`
* Viz-> :doc:`Viewer Draw </nodes/viz/viewer_draw_mk4>`
72 changes: 72 additions & 0 deletions docs/nodes/surface/marching_cubes.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Marching Cubes
==============

.. image:: https://github.com/nortikin/sverchok/assets/14288520/4ca44a7b-8df5-4fae-a9a0-bb8a460e5854
:target: https://github.com/nortikin/sverchok/assets/14288520/4ca44a7b-8df5-4fae-a9a0-bb8a460e5854

Dependencies
------------

Expand All @@ -21,6 +24,15 @@ Surfaces are generated as mesh - vertices and faces.

.. _Cubes: https://en.wikipedia.org/wiki/Marching_cubes

.. image:: https://github.com/nortikin/sverchok/assets/14288520/36b4857e-cc12-4f8a-94e0-aa2e80db5029
:target: https://github.com/nortikin/sverchok/assets/14288520/36b4857e-cc12-4f8a-94e0-aa2e80db5029

* Fields-> :doc:`Coordinate Scalar Field </nodes/field/coordinate_scalar_field>`
* Fields-> :doc:`Voronoi Field </nodes/field/voronoi_field>`

.. image:: https://github.com/nortikin/sverchok/assets/14288520/baedf54d-2df4-4f43-8fa8-f4d583731c54
:target: https://github.com/nortikin/sverchok/assets/14288520/baedf54d-2df4-4f43-8fa8-f4d583731c54

Inputs
------

Expand All @@ -29,8 +41,23 @@ This node has the following inputs:
* **Field**. Scalar field to find the iso-surfaces for. This input is mandatory.
* **Bounds**. Vertices defining the bounds for generated geometry. Only
bounding box of these points is used. This input is mandatory.

.. image:: https://github.com/nortikin/sverchok/assets/14288520/931c798b-9a73-432b-b85d-9f184ec502c2
:target: https://github.com/nortikin/sverchok/assets/14288520/931c798b-9a73-432b-b85d-9f184ec502c2

* **Value**. The value of scalar field, for which the iso-surfaces should be
generated. The default value is 1.0.

.. image:: https://github.com/nortikin/sverchok/assets/14288520/98a222d9-ac36-441a-b7e2-987381dd3585
:target: https://github.com/nortikin/sverchok/assets/14288520/98a222d9-ac36-441a-b7e2-987381dd3585

* Fields-> :doc:`Coordinate Scalar Field </nodes/field/coordinate_scalar_field>`
* Generator-> :doc:`Box </nodes/generator/box_mk2>`
* Viz-> :doc:`Viewer Draw </nodes/viz/viewer_draw_mk4>`

.. image:: https://github.com/nortikin/sverchok/assets/14288520/2f4b814e-e480-4e15-9f0a-8a0b3b637930
:target: https://github.com/nortikin/sverchok/assets/14288520/2f4b814e-e480-4e15-9f0a-8a0b3b637930

* **SamplesX**, **SamplesY**, **SamplesZ**. Number of scalar field samples to
be used along X, Y and Z axes. This defines the resolution of surfaces: the
higher the values, the more precise are the surfaces. Note that computation
Expand All @@ -42,6 +69,13 @@ This node has the following inputs:
input is used instead of **SamplesX**, **SamplesY** and **SamplesZ** when the
**Sampling** parameter is set to **Uniform**.

.. image:: https://github.com/nortikin/sverchok/assets/14288520/47b1786c-568f-48b1-b0e9-e16c03bfda93
:target: https://github.com/nortikin/sverchok/assets/14288520/47b1786c-568f-48b1-b0e9-e16c03bfda93

* Fields-> :doc:`Coordinate Scalar Field </nodes/field/coordinate_scalar_field>`
* Generator-> :doc:`Box </nodes/generator/box_mk2>`
* Viz-> :doc:`Viewer Draw </nodes/viz/viewer_draw_mk4>`

Parameters
----------

Expand All @@ -62,6 +96,9 @@ This node has the following parameters:
* **Non-Uniform**. This allows to provide different values for X, Y and Z
axes, in **SamplesX**, **SamplesY**, **SamplesZ** inputs, correspondingly.

.. image:: https://github.com/nortikin/sverchok/assets/14288520/cf4280dc-8ce2-43fc-85a6-022f28985c17
:target: https://github.com/nortikin/sverchok/assets/14288520/cf4280dc-8ce2-43fc-85a6-022f28985c17

The default option is **Uniform**.

Outputs
Expand All @@ -75,14 +112,49 @@ This node has the following outputs:
* **VertexNormals**. Vertex normals. This output is only available if
**Implementation** parameter is set to **SciKit-Image**.

.. image:: https://github.com/nortikin/sverchok/assets/14288520/6de95427-b18f-4f68-9775-c9b8fa111dbe
:target: https://github.com/nortikin/sverchok/assets/14288520/6de95427-b18f-4f68-9775-c9b8fa111dbe

* Generator-> :doc:`Line </nodes/generator/line_mk4>`
* Generator-> :doc:`Box </nodes/generator/box_mk2>`
* Fields-> :doc:`Coordinate Scalar Field </nodes/field/coordinate_scalar_field>`
* Viz-> :doc:`Viewer Draw </nodes/viz/viewer_draw_mk4>`

Examples of usage
-----------------

This node can be used to generate metaball-like structures:

.. image:: https://user-images.githubusercontent.com/284644/87254841-41bd7180-c49f-11ea-90d8-439b6f0c8dfd.png
:target: https://user-images.githubusercontent.com/284644/87254841-41bd7180-c49f-11ea-90d8-439b6f0c8dfd.png

* Generator-> :doc:`NGon </nodes/generator/ngon>`
* Fields-> :doc:`Attractor Field </nodes/field/attractor_field_mk2>`
* Spacial-> :doc:`Vector P Field </nodes/spatial/homogenous_vector_field>`
* Viz-> :doc:`Viewer Draw </nodes/viz/viewer_draw_mk4>`

Or it is possible to generate mathematically-specified implicit surfaces. The following is known as "Saddle Tower":

.. image:: https://user-images.githubusercontent.com/284644/87254916-c7412180-c49f-11ea-98eb-a271a67df181.png
:target: https://user-images.githubusercontent.com/284644/87254916-c7412180-c49f-11ea-98eb-a271a67df181.png

* Fields-> :doc:`Scalar Field Formula </nodes/field/scalar_field_formula>`
* Spacial-> :doc:`Vector P Field </nodes/spatial/homogenous_vector_field>`
* Viz-> :doc:`Viewer Draw </nodes/viz/viewer_draw_mk4>`


.. image:: https://github.com/nortikin/sverchok/assets/14288520/49a2e64b-6358-4e3e-811e-a71ed69b568c
:target: https://github.com/nortikin/sverchok/assets/14288520/49a2e64b-6358-4e3e-811e-a71ed69b568c

* Generator-> :doc:`Box </nodes/generator/box_mk2>`
* Fields-> :doc:`Scalar Field Formula </nodes/field/scalar_field_formula>`
* Number-> :doc:`Number Range </nodes/number/number_range>`
* Number-> :doc:`Number Range </nodes/number/number_range>`
* Number-> :doc:`Map Range </nodes/number/range_map>`
* Matrix-> :doc:`Matrix In </nodes/matrix/matrix_in_mk4>`
* List->List Main-> :doc:`List Length </nodes/list_main/length>`
* Color-> :doc:`Color In </nodes/color/color_in_mk1>`
* Viz-> :doc:`Viewer Draw </nodes/viz/viewer_draw_mk4>`

.. image:: https://github.com/nortikin/sverchok/assets/14288520/4b774523-e129-490f-918f-b7c3b27f90b9
:target: https://github.com/nortikin/sverchok/assets/14288520/4b774523-e129-490f-918f-b7c3b27f90b9

0 comments on commit 8f646ea

Please sign in to comment.