tag:support.nodebox.net,2012-11-01:/discussions/show-your-work/538-occlude-nodeNodeBox: Discussion 2023-01-26T01:48:00Ztag:support.nodebox.net,2012-11-01:Comment/575111022023-01-15T12:04:17Z2023-01-15T12:04:23ZOcclude Node<div><p>John,<br>
Thanks again for this amazing node!<br>
I tested it with overlapping shapes and it seems to be working great and produced consistent result compared to my flattener tool. The end result is definitely plottable. As far as I can consider, the result doesn't even need to be tested on plotter – one can check the result for example in Illustrator – if there are no overlapping lines then it will most definitely be fine. With complex drawings one might anyway use some line ordering / processing tool like vpype before plotting, so as long as original file hasn't got those hidden lines it'll be good.</p>
<p>There's another point from my experience in plotting though: for me the problem hasn't really been the occlusion of _ closed shapes_. Illustrator (and probably Inkscape and alike) has the tool called Trim, that does the job ok. Of course it'd be cooler to get the plottable svg directly from Nodebox, but at least in my process 1min extra step before plotting hasn't been much of an inconvenience, since the plotting itself might take hours anyway. (for this reason I wouldn't worry at all about occlusion node being slow – I wouldn't run it all the time, probably just at the time of the exporting)</p>
<p>The problems has been the occlusion of _ open lines / paths_. Illustrator cannot do this without extruding the lines to shapes. And in plotting you normally want to avoid that. Manually occluding lines is just pain or not doable. I attached a dead simple Nodebox example to illustrate my point. This was mainly the problem that made me write it myself since no viable solution couldn't be found.</p></div>Jussi Jokinentag:support.nodebox.net,2012-11-01:Comment/575111022023-01-15T12:19:34Z2023-01-15T12:19:35ZOcclude Node<div><p>Here is another, more complex real life example of the problem with hidden shapes and lines.</p></div>Jussi Jokinentag:support.nodebox.net,2012-11-01:Comment/575111022023-01-16T02:00:02Z2023-01-16T02:10:27ZOcclude Node<div><p>Jussi,</p>
<p>You raise a good point and thanks also for providing clarifying examples.</p>
<p>My recent clip node does have the capability of handing both closed and open paths (which was not easy by the way). If I were to use it inside the occlude node it should be able to handle your open path examples.</p>
<p>Unfortunately, my current clip node only clips inside a bounding area; it does not have an option like my mask node to reverse clip everything outside a bounding area. This feature is a pain to add but would obviously be useful, so was already on my TO DO list.</p>
<p>I will attack that problem as soon as I finish some other projects. As soon as I have that working I will then try updating the occlude node to see if I can make it universal.</p>
<p>So stand by. I will report back once I have made some progress.</p>
<p>John</p>
<p>P.S. In your second example you have "spider curves" drawn atop black "blobs". How would you want to plot this? I understand that you would want to occlude the curves underneath other spiders. But would you want to try to fill the blobs somehow to create that black look? Or would you only plot the boundary of the blobs to create transparent regions instead of black ones?</p>
<p>This raises a more general question. Would you want an occlude node to automatically make all closed paths show only boundaries (make their fill alpha 0) so that the output on the screen more closely matches the actual plotted output? Or maybe provide this as an option?</p></div>johntag:support.nodebox.net,2012-11-01:Comment/575111022023-01-26T01:24:51Z2023-01-26T01:48:00ZOcclude Node<div><p>Jussi, All,</p>
<p>I am pleased to announce an improved version of the occlude node!</p>
<p>Once I finished the improvements to my clip node (just posted on the forum) I was able to use it inside the occlude node. The improved occlude now is just a tad slower than it was, but should be universal. That is, is should be able to handle occluded solid shapes, occluded lines, and even occluded open curved spline paths.</p>
<p>I also added an option to show edges only. If you check this box it will recolor the shapes to be transparent with one-pixel wide black strokes. Exact same shapes either way, but the edges only view should look more like the actual plotter output (if you are going to use it on a plotter).</p>
<p>I have attached your original folder with both examples updated to include the new node - see screenshots. Change the shuffle seed on your spiders plot to watch different spiders move into the foreground or background. Be patient: the node takes almost 30 seconds to handle your list of complex spiders.</p>
<p>I have also included an updated version of the occlude demo which looks just like the previous demo but now contains the new occlude nodes.</p>
<p>I've been testing it and so far, so good. But the real test will be all the Nodebox plotters out there throwing all their creations at this. So please, give this thing a spin and report back!</p>
<p>I will add the occlude node to the next rev of my Cartan Node Library.</p>
<p>Happy Occlusions!</p>
<p>John</p></div>john