Set_type Node

john's Avatar

john

05 Nov, 2023 08:25 AM

There are three types of points in NodeBox. Type 1 points are the normal points created by a point node and used to form the endpoints of lines and the corners of polygons. Bézier curves start with type 1 points, but then add two type 3 points to shape the curve and a type 2 point to end it.

If you turn on the Points checkmark above the render pane with a curve showing, you will see type 1 and 2 points as blue dots and type 3 points as red dots. You can find out the type of any point by using the lookup node with Key set to "type". But there is no built-in node that allows you to create type 2 and 3 points from scratch,

Hence, my set_type node. Feed it a Point location and a Type (1, 2, or 3) and it will create a point of that type.

Set_type can be useful when you reconstructing curved paths, resampling curves by hand, or creating Bézier curves from scratch. It does this without requiring an external code library,

The attached demo shows one use case. I create a simple Bézier curve by simply combining four points of the correct type and then connecting them. The position of two type 3 guide points are controlled by a frame node that causes them to follow predefined orbits. If you save this as a movie you will see the blue curve bend and wave. The demo also includes a "point_dot" subnetwork that displays a list of points as type-colored dots.

Enjoy!

John

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • set_type_screenshot.png 388 KB
  • set_type_demo.ndbx.zip 2.44 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

10 Sep, 2024 03:41 AM
09 Sep, 2024 02:15 PM
07 Sep, 2024 05:16 AM
05 Sep, 2024 02:21 AM
04 Sep, 2024 05:01 AM

 

03 Sep, 2024 10:07 AM
02 Sep, 2024 05:56 AM
31 Aug, 2024 11:07 PM
27 Aug, 2024 12:08 AM
26 Aug, 2024 01:02 PM
26 Aug, 2024 07:18 AM