Evaluate Surface
================

.. image:: https://github.com/nortikin/sverchok/assets/14288520/27b50740-2618-43a9-895f-5959999b3112
  :target: https://github.com/nortikin/sverchok/assets/14288520/27b50740-2618-43a9-895f-5959999b3112

Functionality
-------------

This node calculates points on the Surface corresponding to provided values of
U and V surface parameters. The values of U and V can be either provided
explicitly, or generated by the node to generate cartesian (rectangular) grid.

.. image:: https://github.com/nortikin/sverchok/assets/14288520/d46ddda8-0071-4e4e-84e4-147a44d29f59
  :target: https://github.com/nortikin/sverchok/assets/14288520/d46ddda8-0071-4e4e-84e4-147a44d29f59

Inputs
------

This node has the following inputs:

* **Surface**. The surface to evaluate. This input is mandatory.
* **U**, **V**. Values of U and V surface parameter. These inputs are available
  only when the **Evaluate** parameter is set to **Explicit**, and **Input
  mode** parameter is set to **Separate**. The default value is 0.5.

    .. image:: https://github.com/nortikin/sverchok/assets/14288520/b1d38112-9166-4889-bad7-0db5a6f76f2b
      :target: https://github.com/nortikin/sverchok/assets/14288520/b1d38112-9166-4889-bad7-0db5a6f76f2b

    * Surfaces-> :doc:`Minimal Surface from Curve </nodes/surface/min_surface_from_curve>`
    * Surfaces-> :doc:`Surface Domain </nodes/surface/surface_domain>`
    * Text-> :doc:`Stethoscope </nodes/text/stethoscope_v28>`

* **Vertices**. Points at which the surface should be evaluated. Only two of
  three coordinates will be used; the coordinates used are defined by
  **Orientation** parameter. This input is available and mandatory if the
  **Evaluation mode** parameter is set to **Explicit**, and **Input mode** is
  set to **Vertices**.

    .. image:: https://github.com/nortikin/sverchok/assets/14288520/e8e53044-ae00-48d5-9f61-654f2fccddfb
      :target: https://github.com/nortikin/sverchok/assets/14288520/e8e53044-ae00-48d5-9f61-654f2fccddfb

    * Generator-> :doc:`Plane </nodes/generator/plane_mk3>`
    * Surfaces-> :doc:`Minimal Surface from Curve </nodes/surface/min_surface_from_curve>`
    * Surfaces-> :doc:`Surface Domain </nodes/surface/surface_domain>`
    * Number-> :doc:`A Number </nodes/number/numbers>`
    * Viz-> :doc:`Viewer Draw </nodes/viz/viewer_draw_mk4>`
    * Scene-> :doc:`Bezier Input </nodes/exchange/bezier_in>`


* **SamplesU**, **SamplesV**. Number of samples along U and V direction, used
  to generate cartesian grid. These inputs are available only when the
  **Evaluate** parameter is set to **Grid**. The default value is 25.

    .. image:: https://github.com/nortikin/sverchok/assets/14288520/4a870f67-b725-4c50-8be6-592dc693a64e
      :target: https://github.com/nortikin/sverchok/assets/14288520/4a870f67-b725-4c50-8be6-592dc693a64e

    * Surfaces-> :doc:`Minimal Surface from Curve </nodes/surface/min_surface_from_curve>`
    * Viz-> :doc:`Viewer Draw </nodes/viz/viewer_draw_mk4>`
    * Scene-> :doc:`Bezier Input </nodes/exchange/bezier_in>`

Parameters
----------

This node has the following parameters:

* **Evaluate**. This determines how the values of surface's U and V parameters
  are defined. The available options are:

  * **Explicit**. U and V parameters are to be provided in inputs of this node.
    Depending on **Input mode** parameter, either **U** and **V** inputs, or
    **Vertices** input will be used.
  * **Grid**. The node will generate evenly-spaced cartesian grid with number
    of samples along U and V direction defined by **SamplesU** and **SamplesV**
    inputs, correspondingly.
   
  The default mode is **Grid**.

    .. image:: https://github.com/nortikin/sverchok/assets/14288520/9a23d19f-99ee-45e8-b163-aed2f6fdcfe2
      :target: https://github.com/nortikin/sverchok/assets/14288520/9a23d19f-99ee-45e8-b163-aed2f6fdcfe2

* **Input mode**. This parameter is available only when **Evaluate** parameter
  is set to **Explicit**. The available options are:

   * **Separate**. The values of U and V surface parameters will be provided in
     **U** and **V** inputs, correspondingly.
   * **Vertices**. The values of U and V surface parameters will be provided in
     **Vertices** input; only two of three coordinates of the input vertices
     will be used.
   
   The default mode is **Separate**.

* **Input orientation**. This parameter is available only when **Evaluate**
  parameter is set to **Explicit**, and **Input mode** parameter is set to
  **Vertices**. This defines which coordinates of vertices provided in the
  **Vertices** input will be used. The available options are XY, YZ and XZ. For
  example, if this is set to XY, then the X coordinate of vertices will be used
  as surface U parameter, and Y coordinate will be used as V parameter. The
  default value is XY.

    .. image:: https://github.com/nortikin/sverchok/assets/14288520/b60690bc-7b96-4ff3-89c8-8439c7b79487
      :target: https://github.com/nortikin/sverchok/assets/14288520/b60690bc-7b96-4ff3-89c8-8439c7b79487

* **Clamp**. This parameter is available only when **Evaluate** parameter is
  set to **Explicit**. This defines how the node will process the values of
  surface U and V parameters which are out of the surface's domain. The
  available options are:

   * **As is**. Do not do anything special, just pass the parameters to the
     surface calculation algorithm as they are. The behaviour of the surface
     when the values of parameters provided are out of domain depends on
     specific surface: some will just calculate points by the same formula,
     others will give an error.
   * **Clamp**. Restrict the parameter values to the surface domain: replace
     values that are greater than the higher bound with higher bound value,
     replace values that are smaller than the lower bound with the lower bound
     value. For example, if the surface domain along U direction is `[0 .. 1]`,
     and the value of U parameter is 1.05, calculate the point of the surface
     at U = 1.0.
   * **Wrap**. Wrap the parameter values to be within the surface domain, i.e.
     take the values modulo domain. For example, if the surface domain along U
     direction is `[0 .. 1]`, and the value of U parameter is 1.05, evaluate
     the surface at U = 0.05.

   The default mode is **As is**.

Outputs
-------

This node has the following outputs:

* **Vertices**. The calculated points on the surface.
* **Edges**. The edges of cartesian grid on the surface. This output is only
  available when the **Evaluate** parameter is set to **Grid**.
* **Faces**. The faces of cartesian grid on the surface. This output is only
  available when the **Evaluate** parameter is set to **Grid**.

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

The node used in **Grid** node to generate rectangular grid on the plane:

.. image:: https://user-images.githubusercontent.com/284644/78699409-4b25c380-791d-11ea-8671-2b304e108ed1.png
  :target: https://user-images.githubusercontent.com/284644/78699409-4b25c380-791d-11ea-8671-2b304e108ed1.png

* Surfaces-> :doc:`Plane (Surface) </nodes/surface/plane>`
* Viz-> :doc:`Viewer Draw </nodes/viz/viewer_draw_mk4>`

An example of **Explicit** mode usage:

.. image:: https://user-images.githubusercontent.com/284644/79249080-2dfd7180-7e96-11ea-810a-4a188536adc0.png
  :target: https://user-images.githubusercontent.com/284644/79249080-2dfd7180-7e96-11ea-810a-4a188536adc0.png

* Generator->Generator Extended-> :doc:`Ring </nodes/generators_extended/ring_mk2>`
* Surfaces-> :doc:`Surface Formula </nodes/surface/surface_formula>`
* Viz-> :doc:`Viewer Draw </nodes/viz/viewer_draw_mk4>`