tag:support.nodebox.net,2012-11-01:/discussions/nodebox-2-3/6077-best-way-to-create-a-circle-with-gapsNodeBox: Discussion 2019-10-09T22:04:55Ztag:support.nodebox.net,2012-11-01:Comment/460485422018-09-09T10:18:40Z2018-09-09T10:18:40ZBest way to create a circle with gaps?<div><p>Hello Elliot,</p>
<p>There are several different ways of doing this. One simple way is to represent the gaps as a series of pie slices (using the arc node) and subtract them from a circle using a compound node.</p>
<p>Zipped example code and screenshot attached.</p>
<p>I begin by building a table of gap starting points (in degrees from 0 to 360) and gap widths (in degrees). You could import these values from a CSV file or generate them within NodeBox.</p>
<p>For this example I used random numbers. You can adjust the number node at the top to change the number of gaps and fiddle with the random nodes to control the range of gap widths or try different random seeds. You can replace this section with whatever logic you want to create a gap table.</p>
<p>Once I have the gap starts and widths I feed them into an arc node set to "pie" mode and group them to produce a single shape representing all the gaps (including overlaps and wraparounds).</p>
<p>I then create a ring by using a compound node to subtract a slightly smaller circle from the main circle. Notice that this compound node is set to Difference with Invert Difference checked. You can adjust the diameter of the outer circle and the thickness of the circle outline. The Diameter node also controls the size of the gap pie slices; I use a slightly bigger circle for them to make sure they extend beyond the main circle.</p>
<p>Now all we have to do is subtract the gap pies from the ring using another compound node. This one is set to Difference but with Invert Difference unchecked.</p>
<p>Please let me know if that solves your conundrum and if you have any other questions. Welcome to the NodeBox community!</p>
<p>John</p></div>johntag:support.nodebox.net,2012-11-01:Comment/460485422018-09-10T02:05:56Z2018-09-10T02:05:59ZBest way to create a circle with gaps?<div><p>Thank you! Incredibly helpful and very informative. Very appreciated.</p>
<p>Thanks again,</p>
<p>Elliot</p></div>Elliot