Join line to closed shape.
Hello
I make a diagram and I would like add color to area between curves.
Is possible connect the curve or line to closed shape?
Thanks
- zuza_data.csv 1.16 KB
- diagram_1.ndbx 5.69 KB
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
Support Staff 1 Posted by john on 04 Jun, 2016 12:53 AM
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!
John
michal closed this discussion on 04 Jun, 2016 12:59 PM.
michal re-opened this discussion on 04 Jun, 2016 12:59 PM
2 Posted by michal on 05 Jun, 2016 05:12 AM
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.
Thanks
3 Posted by michal on 05 Jun, 2016 05:15 AM
Hi
Support Staff 4 Posted by john on 05 Jun, 2016 07:47 AM
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.
Thanks,
John
Support Staff 5 Posted by john on 05 Jun, 2016 08:06 AM
Michal,
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.
Enjoy!
John
6 Posted by michal on 06 Jun, 2016 08:41 AM
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
Michal