# Ellipse with 2D Voronoi Cells

## Grasshopper - Rhino Ellipse to Grasshopper Curve

In the first iteration, the idea is to use an ellipse as the bounding surface for creating voronoi patterned dragonfly wings.

Final Design ![](https://3659607454-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0-KLg_ficxV7B_8SgA%2F-M0-KNNPhCRj2ku0AG0P%2F-M0-KQSSS3b0vuycx1fc%2FScreenshot%202017-10-04%2007.01.36.png?generation=1581627358269374\&alt=media)

Step 1: Create an Ellipse in Rhino5WIP

Step 2: Create reference to Rhino ellipse, using grasshopper curve primitive.

Step 3: Extrude Along the default z axis, this turns the ellipse into a boundry representation (bRep), then cap the bRep which allows for testing whether a point is within the bRep.

Step 4: Put a bounding box around the ellipse, the bounding box is used as the defining rectangular region for random point generation - for randomly seeded sites for the voronoi cell centers.

Step 5: Output of points from the point-cloud generator, is processed in the point in bRep component, creating a list of points that do belong to the bRep, these are the voronoi site points.

![](https://3659607454-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0-KLg_ficxV7B_8SgA%2F-M0-KNNPhCRj2ku0AG0P%2F-M0-KQSULT-n8e6q5pV6%2FScreenshot%202017-10-01%2021.36.39.png?generation=1581627356000366\&alt=media)

![](https://3659607454-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0-KLg_ficxV7B_8SgA%2F-M0-KNNPhCRj2ku0AG0P%2F-M0-KQSWuhJkXv_iyz1A%2FScreenshot%202017-10-01%2021.49.26.png?generation=1581627354598959\&alt=media)

Step 6: Cull Points: The green highlighted component: cull points, takes the list generated 2D points within the bounding box, it compares against the output of the bRep points, it only keeps points defined within the bRep. Those points are input into the 2D voronoi component and functions as voronoi sites. These sites define the space partition where they are the closest site-point to all points within their region.

Once the randomly generated points that lie within the ellipse, have been filtered using the cull-points component, the voronoi component takes those points as site locations. Number sliders provide radius and the bounding box provides the rectangluar bounding region required by the voronoi 2D component. The image below shows the components in this region of logic. The Region Intersection component is the next component in the definition's logic flow. Input A takes the list of voronoi boundry curves that output from the voronoi component, it does an intersection with input B, which is the ellipse that was the original Rhino geometry - and calculates an intersection between those curves and forms surface. The pipe component creates revolved pipe surfaces along each of the curve sections output from the Region Intersection, it also has a number slider to control the radius of the pipe surface.

![](https://3659607454-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0-KLg_ficxV7B_8SgA%2F-M0-KNNPhCRj2ku0AG0P%2F-M0-KQSYemArLTrYBK7y%2FScreenshot%202017-10-03%2022.16.51.png?generation=1581627355674582\&alt=media)

## Final Details

Adding a supplemental Pipe component to the original Rhino ellipse allows for custom sizing the outer object surface. The Solid Union component can be used to join the curves output from both pipe components.

![](https://3659607454-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0-KLg_ficxV7B_8SgA%2F-M0-KNNPhCRj2ku0AG0P%2F-M0-KQS_R63_2Ycxf8s9%2FScreenshot%202017-10-04%2007.01.36.png?generation=1581627356719024\&alt=media)

![](https://3659607454-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0-KLg_ficxV7B_8SgA%2F-M0-KNNPhCRj2ku0AG0P%2F-M0-KQSbEI8Qr2UyFXqp%2FScreenshot%202017-10-04%2010.12.25.png?generation=1581627357885074\&alt=media)

## Analysis

This grasshopper definition is nice because it's simple, using only a few components, easy to understand and creates an elegant voronoi object.

Problems: 1. The ellipse form must lie within a flat planar area, there can be no distortion of the shape outside it's planar configuration.

1. Pipe configuration limits the density of the surface pattern, it creates a design with tubular sections. This tubular structure may not be the desired object dimensional shape, so let's explore other options.
2. Some of the pipe section joins have defects. It's possible to play with the point generator count and seeding values to find configurations that don't have visible defects, it is also possible to fix these in Rhino after the object has been baked.
