Skip to content

Commit

Permalink
Add tangent output to torus knot node and optimize its code
Browse files Browse the repository at this point in the history
- add tangent calculation and output to the node
No need to restrict the node's phase parameters to only positive values.. the spin/revolution phase can go in both directions.
- minor optimization
- conditionally calculate normals and tangents based on node extra parameters (on by default)
- remove the min bounds from the phase parameters
- update comments and documenation
- cleanup unused code
- PEPify the code
  • Loading branch information
DolphinDream committed Sep 30, 2017
1 parent a0fe08c commit 0bb099c
Show file tree
Hide file tree
Showing 2 changed files with 151 additions and 107 deletions.
7 changes: 6 additions & 1 deletion docs/nodes/generator/torusKnot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,19 @@ A set of extra parameters are available on the property panel. These parameters
+-------------------------+------------+------------+-----------------------------------------------+
| **Scale** | Float | 1.00 | Scales both radii by this amount |
+-------------------------+------------+------------+-----------------------------------------------+
| **Normalize Tangents** | Bool | True | Normalize the TANGENT vectors [2] |
+-------------------------+------------+------------+-----------------------------------------------+
| **Normalize Normals** | Bool | True | Normalize the NORMAL vectors [2] |
+-------------------------+------------+------------+-----------------------------------------------+

Notes:
[1] Used without adaptive resolution these allow to create aliased torus knots resulting in all sorts of interesting shaped knots.
[2] Turn off normalization to save computation whenever the output vectors do not need to be normalized.

Outputs
-------

**Vertices**, **Edges** and **Normals**
**Vertices**, **Edges**, **Tangents** and **Normals**
All outputs will be generated when connected.


Expand Down
Loading

0 comments on commit 0bb099c

Please sign in to comment.