Skip to content

Commit

Permalink
Merge pull request #4657 from nortikin/update_menu_nodes_comments_v13
Browse files Browse the repository at this point in the history
Update docs and menu Logic/* (not all), some fixes other menus and docs
  • Loading branch information
satabol authored Sep 13, 2022
2 parents 303b1f6 + 85b5416 commit 1634b7d
Show file tree
Hide file tree
Showing 23 changed files with 279 additions and 98 deletions.
4 changes: 2 additions & 2 deletions docs/nodes/list_masks/mask_join.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
List Mask Join In
=================
List Mask Join (In)
===================

.. image:: https://user-images.githubusercontent.com/14288520/189611716-899bd122-6af1-4025-bc6f-62b2ccff5ade.png
:target: https://user-images.githubusercontent.com/14288520/189611716-899bd122-6af1-4025-bc6f-62b2ccff5ade.png
Expand Down
4 changes: 2 additions & 2 deletions docs/nodes/list_struct/flip.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ Outputs
Examples
--------

.. image:: https://user-images.githubusercontent.com/14288520/187999021-e519b2c7-2718-46e6-86ac-e19d8cea2283.png
.. image:: https://user-images.githubusercontent.com/14288520/189832406-cbcd682e-268a-4cae-989c-5d9c06659089.png
:target: https://user-images.githubusercontent.com/14288520/189832406-cbcd682e-268a-4cae-989c-5d9c06659089.png
:alt: flip
:target: https://user-images.githubusercontent.com/14288520/187999021-e519b2c7-2718-46e6-86ac-e19d8cea2283.png

* Script-> :doc:`Formula </nodes/script/formula_mk5>`
* List->List Main-> :doc:`List Join </nodes/list_main/join>`
Expand Down
13 changes: 11 additions & 2 deletions docs/nodes/list_struct/item_insert.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
List Item Insert
================

.. image:: https://user-images.githubusercontent.com/14288520/189765700-332fba58-4671-4508-8c86-0756934ef8fc.png
:target: https://user-images.githubusercontent.com/14288520/189765700-332fba58-4671-4508-8c86-0756934ef8fc.png

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

Expand Down Expand Up @@ -56,5 +59,11 @@ Examples

Trying various inputs, adjusting the parameters, and piping the output to a *Debug Print* (or stethoscope) node will be the fastest way to acquaint yourself with the inner workings of the *List Item Insert* Node.

.. image:: https://github.com/vicdoval/sverchok/raw/docs_images/images_for_docs/list_struct/list_item_insert/list_item_insert.png
:alt: insert_item_in_list_sverchok_blender_example.png
.. image:: https://user-images.githubusercontent.com/14288520/189765911-020958bb-b660-46fd-a635-8616858cecb6.png
:target: https://user-images.githubusercontent.com/14288520/189765911-020958bb-b660-46fd-a635-8616858cecb6.png

* Generator-> :doc:`Line </nodes/generator/line_mk4>`
* Number-> :doc:`List Input </nodes/number/list_input>`
* Vector-> :doc:`Vector Math </nodes/vector/math_mk3>`
* List->List Struct-> :doc:`List Item </nodes/list_struct/item>`
* Viz-> :doc:`Viewer Draw </nodes/viz/viewer_draw_mk4>`
2 changes: 1 addition & 1 deletion docs/nodes/list_struct/sort.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Sorting a List of Objects:
.. image:: https://raw.githubusercontent.com/vicdoval/sverchok/docs_images/images_for_docs/list_struct/sort/list_sort_sverchok_blender_example_01.png
:target: https://raw.githubusercontent.com/vicdoval/sverchok/docs_images/images_for_docs/list_struct/sort/list_sort_sverchok_blender_example_01.png

* Scene-> :doc:`Objects In </nodes/scene/objects_in_lite>`
* Scene-> :doc:`Objects In Lite </nodes/scene/objects_in_lite>`
* Number-> :doc:`List Input </nodes/number/list_input>`
* Text-> :doc:`Stethoscope </nodes/text/stethoscope_v28>`

Expand Down
2 changes: 1 addition & 1 deletion docs/nodes/logic/custom_switcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ Examples

.. image:: https://user-images.githubusercontent.com/28003269/59654477-5d285100-91a7-11e9-8a9b-f436d6de57db.gif

.. image:: https://user-images.githubusercontent.com/28003269/59654483-644f5f00-91a7-11e9-92cb-70da3cc641b0.png
.. image:: https://user-images.githubusercontent.com/28003269/59654483-644f5f00-91a7-11e9-92cb-70da3cc641b0.png
34 changes: 34 additions & 0 deletions docs/nodes/logic/evolver.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Evolver
=======

.. image:: https://user-images.githubusercontent.com/14288520/189763466-4ab9972b-505c-4a79-a8e4-11c5a5c69181.png
:target: https://user-images.githubusercontent.com/14288520/189763466-4ab9972b-505c-4a79-a8e4-11c5a5c69181.png

This node implements a Genetics Algorithm system inspired in Galapagos (the Grasshopper plugin) and the 9th chapter of "The Nature of Code" by Daniel Shiffman https://natureofcode.com/book/chapter-9-the-evolution-of-code/

The system creates a starting population, evaluates the fitness of each "agent" and creates a new population bases on the crossover of the fitter agents and a mutation chance. The new population is evaluated and mixed every iteration rising the global fitness of the population by generating fitter agents.
Expand Down Expand Up @@ -78,11 +81,42 @@ Examples
Solved problem: Which is the smallest box (as the sum of faces area) in which I can fit Suzanne mesh?

.. image:: https://raw.githubusercontent.com/vicdoval/sverchok/docs_images/images_for_docs/logic/evolver/evolver_genetics_algorithm_sverchok_blender_example_01.png
:target: https://raw.githubusercontent.com/vicdoval/sverchok/docs_images/images_for_docs/logic/evolver/evolver_genetics_algorithm_sverchok_blender_example_01.png

* Transform-> :doc:`Rotate </nodes/transforms/rotate_mk3>`
* Analyzers-> :doc:`Bounding Box </nodes/analyzer/bbox_mk3>`
* Analyzers-> :doc:`Area </nodes/analyzer/area>`
* Number-> :doc:`A Number </nodes/number/numbers>`
* Matrix-> :doc:`Matrix Apply (verts) </nodes/transforms/apply>`
* Viz-> :doc:`Viewer Draw </nodes/viz/viewer_draw_mk4>`
* Text-> :doc:`Stethoscope </nodes/text/stethoscope_v28>`
* Scene-> :doc:`Objects In Lite </nodes/scene/objects_in_lite>`

Solved problem: Where is the point where the minimum distance to a set of points is closest to the maximum distance?

.. image:: https://raw.githubusercontent.com/vicdoval/sverchok/docs_images/images_for_docs/logic/evolver/evolver_genetics_algorithm_sverchok_blender_example_02.png
:target: https://raw.githubusercontent.com/vicdoval/sverchok/docs_images/images_for_docs/logic/evolver/evolver_genetics_algorithm_sverchok_blender_example_02.png

* Generator-> :doc:`Circle </nodes/generator/circle>`
* Generator-> :doc:`NGon </nodes/generator/ngon>`
* Analyzers-> :doc:`Distance </nodes/analyzer/distance_pp>`
* Number-> :doc:`A Number </nodes/number/numbers>`
* SUB X: Number-> :doc:`Scalar Math </nodes/number/scalar_mk4>`
* Vector-> :doc:`Vector In </nodes/vector/vector_in>`
* List->List Main-> :doc:`List Math </nodes/list_main/func>`
* Viz-> :doc:`Viewer Draw </nodes/viz/viewer_draw_mk4>`
* Text-> :doc:`Stethoscope </nodes/text/stethoscope_v28>`

Solved problem: Which is the shortest path that cycles through all the points?

.. image:: https://raw.githubusercontent.com/vicdoval/sverchok/docs_images/images_for_docs/logic/evolver/evolver_genetics_algorithm_sverchok_blender_example_03.png
:target: https://raw.githubusercontent.com/vicdoval/sverchok/docs_images/images_for_docs/logic/evolver/evolver_genetics_algorithm_sverchok_blender_example_03.png

* Analyzers-> :doc:`Path Length </nodes/analyzer/path_length_2>`
* Generator-> :doc:`Circle </nodes/generator/circle>`
* Number-> :doc:`Random Vector </nodes/generator/random_vector_mk3>`
* Number-> :doc:`List Input </nodes/number/list_input>`
* Vector-> :doc:`Vector Rewire </nodes/vector/vector_rewire>`
* List->List Struct-> :doc:`List Item </nodes/list_struct/item>`
* Viz-> :doc:`Viewer Draw </nodes/viz/viewer_draw_mk4>`
* Text-> :doc:`Stethoscope </nodes/text/stethoscope_v28>`
45 changes: 25 additions & 20 deletions docs/nodes/logic/genes_holder.rst
Original file line number Diff line number Diff line change
@@ -1,50 +1,55 @@
Genes Holder
============

.. image:: https://user-images.githubusercontent.com/14288520/189763727-88587af2-16a5-4cc8-9368-be6a089d9b64.png
:target: https://user-images.githubusercontent.com/14288520/189763727-88587af2-16a5-4cc8-9368-be6a089d9b64.png

This node stores a list of values (Integers, Floats or Vectors) that can be modified by the Evolver Node into the Genetics algorithm system.

The node will keep the data and wont be affected by the regular updates.

Parameters
----------

**Data type**: Integers (Int), Floats or Vectors

**Variation Mode**: Order and Range. In Order mode the variation will be made by changing the order of the elements. In Range Mode the variation will be made by variating each element among the defined range(s)

**Min**: Minimum value a gene can have. Only in "Range" mode

**Maximum**: Maximum value a gene can have. Note that with the Integers this number will never be reached so to get a "Boolean" genes the maximum should be 2 to get values from 0 to 1. Only in "Range" mode

**Population amount**: Number of members of the population.

**Iterations**: Iterations of the system

**Random Seed**: Random Seed used in the system, this affects the initial population and the crossover and mutation process.
* **Data type**: Integers (Int), Floats or Vectors
* **Variation Mode**: Order and Range. In Order mode the variation will be made by changing the order of the elements. In Range Mode the variation will be made by variating each element among the defined range(s)
* **Min**: Minimum value a gene can have. Only in "Range" mode
* **Maximum**: Maximum value a gene can have. Note that with the Integers this number will never be reached so to get a "Boolean" genes the maximum should be 2 to get values from 0 to 1. Only in "Range" mode
* **Population amount**: Number of members of the population.
* **Iterations**: Iterations of the system
* **Random Seed**: Random Seed used in the system, this affects the initial population and the crossover and mutation process.

Operators
---------

**Reset**: This will reset the memory of the node filling it with random values or values coming from the input socket
* **Reset**: This will reset the memory of the node filling it with random values or values coming from the input socket

Inputs
------

**Numbers**: Input to fill the memory of the node with numbers.

**Vectors**: Input to fill the memory of the node with vectors.

**Bounding Box**: Input to stablish the boundaries of the vectors (when generating the Evolver population). Only in "Range" mode
* **Numbers**: Input to fill the memory of the node with numbers.
* **Vectors**: Input to fill the memory of the node with vectors.
* **Bounding Box**: Input to stablish the boundaries of the vectors (when generating the Evolver population). Only in "Range" mode


Outputs
-------

**Numbers / Vectors**: Outputs memory of the node
* **Numbers / Vectors**: Outputs memory of the node

Examples
--------

Solved problem: Which is the shortest path that cycles through all the points?. Note that this problem with 20 points has over 2 trillions of solutions, the Genetics Algorithm offers the best solution in a defined time

.. image:: https://user-images.githubusercontent.com/10011941/84772313-113b0280-afdb-11ea-89ec-971d19aee2cc.png
:target: https://user-images.githubusercontent.com/10011941/84772313-113b0280-afdb-11ea-89ec-971d19aee2cc.png

* Analyzers-> :doc:`Path Length </nodes/analyzer/path_length_2>`
* Modifiers->Modifier Make-> :doc:`UV Connection </nodes/modifier_make/uv_connect>`
* Number-> :doc:`Number Range </nodes/number/number_range>`
* Number-> :doc:`Random Vector </nodes/generator/random_vector_mk3>`
* List->List Struct-> :doc:`List Item </nodes/list_struct/item>`
* Logic-> :doc:`Evolver </nodes/logic/evolver>`
* Viz-> :doc:`Viewer Draw </nodes/viz/viewer_draw_mk4>`
* Text-> :doc:`Stethoscope </nodes/text/stethoscope_v28>`
26 changes: 15 additions & 11 deletions docs/nodes/logic/input_switch_mod.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Input Switch
------------

.. image:: https://user-images.githubusercontent.com/14288520/189748974-515ced31-f55e-4125-8593-dd2c97b93d1e.png
:target: https://user-images.githubusercontent.com/14288520/189748974-515ced31-f55e-4125-8593-dd2c97b93d1e.png

This node allows switching among an arbitrary number of sets of any type of inputs connected to the node.

Inputs
Expand Down Expand Up @@ -28,19 +31,20 @@ Parameters

The **Selected** parameter accepts single input values directly from the node or from an outside node. The value is sanitized to be bounded by the number N of the connected inputs (0, N-1). In fact, the value is converted via a modulo-N function to wrap around within (0, N-1) range for values larger than N. In other words, as the **Selected** value increases, the node essentially cycles through the connected sets as it picks one to be sent to the output.

+--------------+-------+---------+----------------------------------------------+
| Param | Type | Default | Description |
+==============+=======+=========+==============================================+
| **Set Size** | Int | 2 | The number of inputs in a set. [1][2][3] |
+--------------+-------+---------+----------------------------------------------+
| **Selected** | Int | 0 | The index of the selected set to output. [4] |
+--------------+-------+---------+----------------------------------------------+
+--------------+-------+---------+--------------------------------------------------+
| Param | Type | Default | Description |
+==============+=======+=========+==================================================+
| **Set Size** | Int | 2 | The number of inputs in a set. **[1][2][3]** |
+--------------+-------+---------+--------------------------------------------------+
| **Selected** | Int | 0 | The index of the selected set to output. **[4]** |
+--------------+-------+---------+--------------------------------------------------+

Notes:
[1] : As the size of the set changes, the corresponding number of inputs are generated for each set with labels in increasing order (e.g. Lambda 1, Lambda 2, ... ).
[2] : When changing the set size, the existing connections of the input & output sockets to the outer nodes are being preserved, unless decreasing the set size renders some of the connected input & output sockets non-existent.
[3] : Currently the node limits the max set size to 9 since it is assumed it's unlikely the user may need sets larger than this. Not putting a limit on the size sets could end up creating very tall nodes.
[4] : The index 0 corresponds to the first set

* **[1]** : As the size of the set changes, the corresponding number of inputs are generated for each set with labels in increasing order (e.g. Lambda 1, Lambda 2, ... ).
* **[2]** : When changing the set size, the existing connections of the input & output sockets to the outer nodes are being preserved, unless decreasing the set size renders some of the connected input & output sockets non-existent.
* **[3]** : Currently the node limits the max set size to 9 since it is assumed it's unlikely the user may need sets larger than this. Not putting a limit on the size sets could end up creating very tall nodes.
* **[4]** : The index 0 corresponds to the first set


Extra Parameters
Expand Down
6 changes: 3 additions & 3 deletions docs/nodes/logic/logic_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ Logic
:maxdepth: 1

logic_node
neuro_elman
evolver
genes_holder
switch_MK2
input_switch_mod
neuro_elman
custom_switcher
range_switch
loop_in
loop_out
evolver
genes_holder
11 changes: 7 additions & 4 deletions docs/nodes/logic/logic_node.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Logic Functions
===============

.. image:: https://user-images.githubusercontent.com/14288520/189692704-621b9c7d-f4a7-4950-9ad0-b44a69ed7162.png
:target: https://user-images.githubusercontent.com/14288520/189692704-621b9c7d-f4a7-4950-9ad0-b44a69ed7162.png

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

Expand Down Expand Up @@ -51,14 +54,14 @@ Advanced Parameters

In the N-Panel (and on the right-click menu) you can find:

**Output NumPy**: Get NumPy arrays in stead of regular lists (makes the node faster). [Not available for GCD or Round-N]

**List Match**: Define how list with different lengths should be matched. [Not available for GCD or Round-N]
* **Output NumPy**: Get NumPy arrays in stead of regular lists (makes the node faster). [Not available for GCD or Round-N]
* **List Match**: Define how list with different lengths should be matched. [Not available for GCD or Round-N]


Example of usage
----------------

.. image:: https://cloud.githubusercontent.com/assets/5990821/4333087/6b040a3e-3fdc-11e4-9693-7a00b0ce03bc.jpg
.. image:: https://user-images.githubusercontent.com/14288520/189728289-aa5a39d2-0e99-462f-8eb7-b2a771ee1b10.png
:target: https://user-images.githubusercontent.com/14288520/189728289-aa5a39d2-0e99-462f-8eb7-b2a771ee1b10.png

In this example we use Logic with Switch Node to choose between two vectors depending on the logic output.
34 changes: 34 additions & 0 deletions docs/nodes/logic/loop_in.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Loop In
=======

.. image:: https://user-images.githubusercontent.com/14288520/189755574-a94546ed-4234-4f0c-8735-5792de2c4370.png
:target: https://user-images.githubusercontent.com/14288520/189755574-a94546ed-4234-4f0c-8735-5792de2c4370.png

This node in conjunction with the Loop out node can create loops with nodes

Offers two different modes 'Range' and 'For Each'
Expand Down Expand Up @@ -51,11 +54,42 @@ Examples
Range mode example, Break used to control the maximum vertices.

.. image:: https://user-images.githubusercontent.com/10011941/101332093-22234d00-3875-11eb-819a-68e86ef8c2c2.png
:target: https://user-images.githubusercontent.com/10011941/101332093-22234d00-3875-11eb-819a-68e86ef8c2c2.png

* Generator-> :doc:`Box </nodes/generator/box_mk2>`
* CA: Faces Area: Analyzers-> :doc:`Component Analyzer </nodes/analyzer/component_analyzer>`
* CAD-> :doc:`Inset Special </nodes/CAD/inset_special_mk2>`
* Number-> :doc:`Random Num Gen </nodes/number/random_num_gen>`
* MULT X: Number-> :doc:`Scalar Math </nodes/number/scalar_mk4>`
* List->List Struct-> :doc:`List Length </nodes/list_main/length>`
* BIG X:Logic-> :doc:`Logic Functions </nodes/logic/logic_node>`
* Logic-> :doc:`Logic Functions </nodes/logic/loop_out>`

For Each mode example, Skip input used to mask the results.

.. image:: https://user-images.githubusercontent.com/10011941/101334215-e047d600-3877-11eb-89df-cfaaf73dd427.png
:target: https://user-images.githubusercontent.com/10011941/101334215-e047d600-3877-11eb-89df-cfaaf73dd427.png

* Generator-> :doc:`Box </nodes/generator/box_mk2>`
* Transform-> :doc:`Noise Displace </nodes/transforms/noise_displace>`
* CA: Faces Area: Analyzers-> :doc:`Component Analyzer </nodes/analyzer/component_analyzer>`
* BIG X:Logic-> :doc:`Logic Functions </nodes/logic/logic_node>`
* Logic-> :doc:`Loop Out </nodes/logic/loop_out>`

You can change the socket labels in the N-Panel

.. image:: https://user-images.githubusercontent.com/10011941/101360702-519a7f80-389e-11eb-826d-0e1c5a7152d1.png
:target: https://user-images.githubusercontent.com/10011941/101360702-519a7f80-389e-11eb-826d-0e1c5a7152d1.png

* Generator-> :doc:`Box </nodes/generator/box_mk2>`
* CAD-> :doc:`Inset Special </nodes/CAD/inset_special_mk2>`
* CA: Faces Area: Analyzers-> :doc:`Component Analyzer </nodes/analyzer/component_analyzer>`
* CA: Faces Center: Analyzers-> :doc:`Component Analyzer </nodes/analyzer/component_analyzer>`
* Modifier->Modifier Change-> :doc:`Smooth Vertices </nodes/modifier_change/smooth>`
* Number-> :doc:`Random Num Gen </nodes/number/random_num_gen>`
* MUL X Number-> :doc:`Scalar Math </nodes/number/scalar_mk4>`
* Vector-> :doc:`Vector Noise </nodes/vector/noise_mk3>`
* List->List Struct-> :doc:`List Length </nodes/list_main/length>`
* BIG X:Logic-> :doc:`Logic Functions </nodes/logic/logic_node>`
* Logic-> :doc:`Loop Out </nodes/logic/loop_out>`
* Viz-> :doc:`Viewer Draw </nodes/viz/viewer_draw_mk4>`
Loading

0 comments on commit 1634b7d

Please sign in to comment.