tag:support.nodebox.net,2012-11-01:/discussions/nodebox-2-3/5596-feature-request-true-ungroupingNodeBox: Discussion 2018-04-29T09:00:32Ztag:support.nodebox.net,2012-11-01:Comment/381000662018-03-29T21:45:13Z2018-03-29T21:45:15ZFeature Request: True Ungrouping<div><p>Hello NodeBox Team and John,</p>
<p>I'm learning NodeBox and as a challenge me against myself I have randomly choose an image from internet and the goal is to reproduce it on NodeBox, with as the least number of nodes as possible.</p>
<p>ok, so first part of the job was good, I have reproduced all the shapes, but now I have problem to colorize it.</p>
<p>I'm trying to ungroup and colorize it.</p>
<p>My expectation was to use 'ungroup' to get 'dozens' of independent geometries 'broken' or 'ungrouped' and when I associate a vector of colors NodeBox would color each geometry picking up a color from the vector, but that is not what happens.</p>
<p>I`ve tried to break and color on many intermediary steps and no luck...</p>
<p>can any of you point me to some direction</p>
<p>regards,</p>
<p>Vander<br>
ps. for the moment on the challenge me against myself I`m loosing.... help!</p></div>vander.viziolitag:support.nodebox.net,2012-11-01:Comment/381000662018-03-30T03:20:25Z2018-04-29T09:00:32ZFeature Request: True Ungrouping<div><p>Hi Vander,</p>
<p>This is one of those little problems that should be easy but is in fact rather hard. It is the last of the six visual tasks I identified in this recent post:</p>
<p><a href="http://support.nodebox.net/discussions/show-your-work/250-visual-tasks">http://support.nodebox.net/discussions/show-your-work/250-visual-tasks</a></p>
<p>I see you made your design by overlapping some circles and rotated rectangles and lines. And now you want to isolate the various little shapes that arise from the various intersections. The reason you can't get them by ungrouping is that those little shapes are not actually there. Our amazing brain perceives those intersections as distinct shapes but NodeBox is only aware of the circles and rectangles you used to make them.</p>
<p>So even if NodeBox had a true ungroup, those shapes would never appear. They aren't really there.</p>
<p>The basic technique to solve this conundrum is to use the compound node to find the difference between your pattern and a neutral background, and break that into multiple contours. I made a subnetwork called Fragment that does just this. You can find it in the rightmost part of the visual tasks NodeBox network I attached in the above post (the part that does the "Find the Intersections" task).</p>
<p>One other detail: the compound node only works with shapes, not with lines or curves. So instead of circles you have to use very thin rings (which you can make by subtracting a circle from a slightly larger circle). I provide a node to do this as well. You can make similar nodes for your rectangles and lines.</p>
<p>Once you capture the individual intersection shapes, coloring them is easy. Please download my visual tasks network, extract the fragment and ring nodes, and give this a try. Fragment uses a custom node that requires path_string.py, so you will have to add that to the code library of your network.</p>
<p>If you run into any trouble let me know; I will add the fragment node for you and give you back a result that you can tweak and color to your heart's content.</p>
<p>Thanks!</p>
<p>John</p></div>johntag:support.nodebox.net,2012-11-01:Comment/381000662018-04-29T08:55:46Z2018-04-29T08:55:46ZFeature Request: True Ungrouping<div><p>Vander,</p>
<p>I never did hear back from you, so took the liberty of making this image for you. The network requires a custom node that uses my path_string.py.</p>
<p>Network and screenshot attached.</p>
<p>John</p></div>john