Join line to closed shape.

michal's Avatar


03 Jun, 2016 09:45 PM

I make a diagram and I would like add color to area between curves.
Is possible connect the curve or line to closed shape?

  1. Support Staff 1 Posted by john on 04 Jun, 2016 12:53 AM

    john's Avatar

    Hi Michaelo,

    This is not obvious, but fairly easy once you figure it out.

    All you have to do is, from the output of the combine node combining your four curves, attach the following 3 nodes in succession:

    - point (converts each path to its points)
    - connect (connects them together - be sure to set "closed" to true)
    - colorize (set fill color and stroke width/color)

    You can see the results in the attached screenshot.

    Hope that helps!


  2. michal closed this discussion on 04 Jun, 2016 12:59 PM.

  3. michal re-opened this discussion on 04 Jun, 2016 12:59 PM

  4. 2 Posted by michal on 05 Jun, 2016 05:12 AM

    michal's Avatar

    Hi John.
    Thank you very much for your solution is very nice and simple, but when I need to fill more of shapes itdosn`t work. I have tried different variations of your script, but I not have a result.

  5. 3 Posted by michal on 05 Jun, 2016 05:15 AM

    michal's Avatar
  6. Support Staff 4 Posted by john on 05 Jun, 2016 07:47 AM

    john's Avatar

    Hi Michal,

    Your note said you were having trouble getting my solution to work with more than one shape.

    The secret to solving problems like this is making a subnetwork. To make my nodes output a different filled curve for each row of your table, all I did was was group everything from the four make point nodes down to the connect node into a subnetwork (with the connect node as the rendered node). I left this network with its default name, but you should probably rename it to something more descriptive like "make_shape".

    Each time you feed this network a set of four points, it spits out a single filled curve. I wasn't sure how many curves you wanted, and what you wanted to do with them. But I noticed you made a palette of 9 colors. So I added a numbers node near the top of your network that lets you control how many curves you want and set it to 9. The network slices off the first 9 rows, feeds them into the network, then feeds those 9 curves and the 9 colors into a colorize node. Each curve is now filled with a different color.

    I also wasn't sure whether you wanted to superimpose them, stack them, put them in a grid, or what. So I made a quick 3 x 3 grid and added a translate node so that you could clearly see each separate curve. I also sliced the grid with the same number so that if you set it to less than 9 you will see the correct number of curves. If you set it to more than 9, additional curves will be superimposed. If you don't like that you can adjust the grid or stack the curves instead.

    If you want to superimpose all the curves into a single diagram, just render the colorize node instead of the translate node. For superimposing you might also want to reduce the alpha number to make the curves translucent.

    I am attaching the modified network and a screenshot showing the 3 x 3 grid. You should be able to take it from there.

    Please let me know if that solves your problem.



  7. Support Staff 5 Posted by john on 05 Jun, 2016 08:06 AM

    john's Avatar


    If you do want to superimpose all 33 rows, as it appears in your projected result, you can delete all the slice nodes along with the number, grid and translate nodes. To make it general purpose, you can hook a count node to the sample node so it will work with any size file.

    The result is much simpler. I am attaching that along with a screenshot.



  8. 6 Posted by michal on 06 Jun, 2016 08:41 AM

    michal's Avatar

    Hi John.
    Many thanks for the prompt reply. Both of your solutions are perfect and very inspiring and also clarify my some of the features and functioning of Nodebox. I use solutions with overlapping shapes for my project and if I have final version of work, will share of the forum.
    Many thnaks

Reply to this discussion

Internal reply

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

Attaching KB article:


Already uploaded files

  • zuza_data.csv 1.16 KB
  • diagram_1.ndbx 5.69 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


? 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

16 May, 2024 02:11 AM
16 May, 2024 01:58 AM
14 May, 2024 01:29 AM
13 May, 2024 12:36 AM
12 May, 2024 07:46 PM


05 May, 2024 04:38 PM
03 May, 2024 06:50 AM
03 May, 2024 12:30 AM
03 May, 2024 12:09 AM
19 Apr, 2024 04:41 AM
16 Apr, 2024 06:18 PM