# Cleaning up Geometry for a Pen Plot

**URL:** <https://discourse.mcneel.com/t/cleaning-up-geometry-for-a-pen-plot/222441>\
**Category:** Grasshopper\
**Tags:** windows, rhino8\
**Created:** [September 6, 2026, 6:53am UTC](https://discourse.mcneel.com/t/cleaning-up-geometry-for-a-pen-plot/222441 "2026-09-06T06:53:48Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sheida3](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/sheida3/32/760570_2.png) [@Sheida3](https://discourse.mcneel.com/u/Sheida3)\
**Post date:** [September 6, 2026, 6:53am UTC](https://discourse.mcneel.com/t/cleaning-up-geometry-for-a-pen-plot/222441/1 "2026-09-06T06:53:48Z")

</div>

I have this geometry in GH, and I would like to convert it into clean vector linework and plot it using a pen plotter. However, as you can see in the image, there are some missing lines, extra/unnecessary lines, and overlapping or fragmented curves in the geometry.

I have two questions:

1. What would be the best way to clean up this geometry?  
I would like to remove the unnecessary lines and make sure the geometry is continuous and suitable for pen plotting.

2. What is the best way to convert the geometry into vectors?  
My current idea is:

Thanks in advance for your help.

---

<div class="post-metadata">

**Author:** ![Eef\_Weenink](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/eef_weenink/32/764753_2.png) [@Eef\_Weenink](https://discourse.mcneel.com/u/Eef_Weenink)\
**Post date:** [September 6, 2026, 8:12am UTC](https://discourse.mcneel.com/t/cleaning-up-geometry-for-a-pen-plot/222441/2 "2026-09-06T08:12:50Z")

</div>

Please upload a version without plugins (so we can look at your file without installing)  
(internalize the geo you want to show us).

Regards, Eef

---

<div class="post-metadata">

**Author:** ![laurent\_delrieu](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/laurent_delrieu/32/601605_2.png) [@laurent\_delrieu](https://discourse.mcneel.com/u/laurent_delrieu)\
**Post date:** [September 6, 2026, 10:43am UTC](https://discourse.mcneel.com/t/cleaning-up-geometry-for-a-pen-plot/222441/3 "2026-09-06T10:43:09Z")

</div>

I think what you need is what you thought

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/7/f/d/7fd89c2c8337543ff78420dd28644c29012db9f8.png)

6048 curves to 5899 lines

---

<div class="post-metadata">

**Author:** ![Volker\_Rakow](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/volker_rakow/32/758767_2.png) [@Volker\_Rakow](https://discourse.mcneel.com/u/Volker_Rakow)\
**Post date:** [September 6, 2026, 10:47am UTC](https://discourse.mcneel.com/t/cleaning-up-geometry-for-a-pen-plot/222441/4 "2026-09-06T10:47:46Z")

</div>

Here’s the general idea:

 ![high res test](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/5/d/d/5dd94aee2f1ceced0b3a9f115e184e0f2e06cf97.png)

 ![Screenshot 2026-09-06 124625](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/7/e/7/7e763d79f280f3396f82d230566996a7526ecb0a.png)

[Pen Plot Polylines VR 1.gh](https://discourse.mcneel.com/uploads/short-url/hcvJOQLOqOlARy7yF7b0iRuDWuh.gh) (28.3 KB)

[Pen Plot Polylines VR 2.gh](https://discourse.mcneel.com/uploads/short-url/xxNC0W85C6eSqZsOFmQhYbzBPmt.gh) (46.9 KB)

---

<div class="post-metadata">

**Author:** ![Volker\_Rakow](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/volker_rakow/32/758767_2.png) [@Volker\_Rakow](https://discourse.mcneel.com/u/Volker_Rakow)\
**Post date:** [September 6, 2026, 10:59am UTC](https://discourse.mcneel.com/t/cleaning-up-geometry-for-a-pen-plot/222441/5 "2026-09-06T10:59:19Z")

</div>

I lost the duplicate lines when I had to rebuild the invalid polylines anyhow.

It is sad that Sort Points does not allow you to choose the hierarchy of points (for example z,y,x instead of x,y,z)… or do polar sorting… or create branches based on the hierarchy. A limited component to my mind.

---

<div class="post-metadata">

**Author:** ![Volker\_Rakow](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/volker_rakow/32/758767_2.png) [@Volker\_Rakow](https://discourse.mcneel.com/u/Volker_Rakow)\
**Post date:** [September 6, 2026, 11:36am UTC](https://discourse.mcneel.com/t/cleaning-up-geometry-for-a-pen-plot/222441/6 "2026-09-06T11:36:52Z")

</div>

And here are your vectors:

[Pen Plot Polylines VR 3.gh](https://discourse.mcneel.com/uploads/short-url/juyQJIIuuyauWJznU2tJH6U7bHL.gh) (41.2 KB)

* * *

With some internalized example curves for @Eef_Weenink :

[Pen Plot Polylines VR 4.gh](https://discourse.mcneel.com/uploads/short-url/erj2AA1S3GdvG02trvy5RcosjmA.gh) (145.9 KB)

---

<div class="post-metadata">

**Author:** ![Volker\_Rakow](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/volker_rakow/32/758767_2.png) [@Volker\_Rakow](https://discourse.mcneel.com/u/Volker_Rakow)\
**Post date:** [September 6, 2026, 1:06pm UTC](https://discourse.mcneel.com/t/cleaning-up-geometry-for-a-pen-plot/222441/7 "2026-09-06T13:06:16Z")

</div>

Correction: line-like curves first need to be cast to lines before being cast to vectors.

 ![Screenshot 2026-09-06 150357](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/c/3/9/c3930b77a20ababa08442d61233ea62e2b343088.png)  
[Pen Plot Polylines VR 5.gh](https://discourse.mcneel.com/uploads/short-url/4Vfo5PWiuBzyoIRcudKLMAqZNtK.gh) (148.8 KB)

---

<div class="post-metadata">

**Author:** ![Volker\_Rakow](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/volker_rakow/32/758767_2.png) [@Volker\_Rakow](https://discourse.mcneel.com/u/Volker_Rakow)\
**Post date:** [September 6, 2026, 4:28pm UTC](https://discourse.mcneel.com/t/cleaning-up-geometry-for-a-pen-plot/222441/8 "2026-09-06T16:28:56Z")

</div>

@Sheida3 added a trim:

 ![Screenshot 2026-09-06 211506](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/2/1/7/21787c0859f649310e0a5939066df9a57d755615.png)  
[Pen Plot Polylines VR 6.gh](https://discourse.mcneel.com/uploads/short-url/jCoofnHkkeN3iUrK24y4FgX4wUo.gh) (141.5 KB)

Please mark a solution.

---

<div class="post-metadata">

**Author:** ![Sheida3](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/sheida3/32/760570_2.png) [@Sheida3](https://discourse.mcneel.com/u/Sheida3)\
**Post date:** [September 6, 2026, 5:21pm UTC](https://discourse.mcneel.com/t/cleaning-up-geometry-for-a-pen-plot/222441/9 "2026-09-06T17:21:00Z")

</div>

Thank you Volkar for your great help 🙂

---

<div class="post-metadata">

**Author:** ![Sheida3](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/sheida3/32/760570_2.png) [@Sheida3](https://discourse.mcneel.com/u/Sheida3)\
**Post date:** [September 7, 2026, 1:56am UTC](https://discourse.mcneel.com/t/cleaning-up-geometry-for-a-pen-plot/222441/10 "2026-09-07T01:56:11Z")

</div>

@Volker_Rakow

I just have a quick question about the final polyline you created in the script. Is it usable directly as a toolpath for the pen plotter, or do I need to convert it into one continuous polyline?

---

<div class="post-metadata">

**Author:** ![Volker\_Rakow](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/volker_rakow/32/758767_2.png) [@Volker\_Rakow](https://discourse.mcneel.com/u/Volker_Rakow)\
**Post date:** [September 7, 2026, 6:40am UTC](https://discourse.mcneel.com/t/cleaning-up-geometry-for-a-pen-plot/222441/11 "2026-09-07T06:40:23Z")

</div>

> [@Sheida3](#):
>
> I just have a quick question about the final polyline you created in the script. Is it usable directly as a toolpath for the pen plotter, or do I need to convert it into one continuous polyline?

I don’t know. I don’t own a pen plotter. 😂 We’re talking about old technology that predates the bubble jet printer.

I am also unsure of what you are asking as the final polyline is already single and continuous.

I mostly created the continuous polyline as a check that the vectors I created were correct, i.e. that when added together, they create a polyline that covers the entire drawing.

With the vectors that I created, I was careful to split them so that in alternating branches of the data tree you get purely move, and then draw-and-move vectors.

However, do you even need the vectors? Most pen plotters I know come with software that takes a drawing, breaks it down into lines, and creates a toolpath itself.

And if you’re working with some homebrew, you’re going to need separate instructions for the movement of the pen (which is linear) and movement of the roller that moves the page up and down agains the pen.

In short, we need more information on your situation. If you come back with that, perhaps @Bruce_Shapiro can help you; pen plotters being movement and machinery and all that good stuff.

---

<div class="post-metadata">

**Author:** ![Bruce\_Shapiro](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/bruce_shapiro/32/525171_2.png) [@Bruce\_Shapiro](https://discourse.mcneel.com/u/Bruce_Shapiro)\
**Post date:** [September 7, 2026, 4:04pm UTC](https://discourse.mcneel.com/t/cleaning-up-geometry-for-a-pen-plot/222441/12 "2026-09-07T16:04:19Z")

</div>

Not sure I fully follow everything above, but I think some of the confusion lies in semantics – especially “vector” and “continuous.” The only pen plotters I own now are spherical. But I spent many years playing with pre-inkjet, state-of-the-art HP pen plotters that I bought at 3M’s monthly “junk” auctions in St. Paul (the E-size were originally $10k). Amazingly engineered beasts! This was the spark that led me to create [Eggbot](https://egg-bot.com/history/) in 1990. It also made me keenly aware of the difference between “vector” (line-based) and pixel-based images. I this case, I’m guessing the OP is using “vector” in this way and not the way Rhino / GH does. As for making drawings composed of lines / curves “plottable,” it depends on whether your plotter can do “pen ups.” All OG pen plotters as well [current ones](https://axidraw.com/) and Eggbots can move the pen without drawing. A single continuous polyline is not essential (though pen-up moves can cost a lot of time, so optimization algorithms are usually included in commercial plotter-ware). But continuous paths are essential for sand-plotters (with which I am [rather well acquainted](https://www.taomc.com/sisyphus)), or desired for aesthetic reasons (search “single-line art” in the forum).

Looking at the OP’s drawing, it looks like an example of “[parquet deformation](https://www.theguardian.com/artanddesign/alexs-adventures-in-numberland/2014/sep/09/crazy-paving-the-twisted-world-of-parquet-deformations),” invented by William Huff. I plotted perhaps the simplest version, seamlessly on an egg ~1995: (definitely NOT a continuous pline!)

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/6/5/c/65c54d0d810f0f234d4bb05b4263c62830d6ab14.jpeg)

---

<div class="post-metadata">

**Author:** ![Volker\_Rakow](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/volker_rakow/32/758767_2.png) [@Volker\_Rakow](https://discourse.mcneel.com/u/Volker_Rakow)\
**Post date:** [September 7, 2026, 4:12pm UTC](https://discourse.mcneel.com/t/cleaning-up-geometry-for-a-pen-plot/222441/13 "2026-09-07T16:12:28Z")

</div>

I was aware that you were the creator of the Eggbot, which is why I brought you into this discussion. The OP needs to tell us what their machine is otherwise we are talking in circles.

---

<div class="post-metadata">

**Author:** ![Sheida3](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/sheida3/32/760570_2.png) [@Sheida3](https://discourse.mcneel.com/u/Sheida3)\
**Post date:** [September 9, 2026, 11:21pm UTC](https://discourse.mcneel.com/t/cleaning-up-geometry-for-a-pen-plot/222441/14 "2026-09-09T23:21:00Z")

</div>

Thank you! I just want to clarify that this is not specifically for a pen plotter. My main goal is to convert the entire geometry into one single continuous line/curve. same for the geometry in the following file.

[Problem\_in\_my \_file.gh](https://discourse.mcneel.com/uploads/short-url/f8nc4G82ZWyemgs8iSudaqpeWjM.gh) (16.9 KB)

---

<div class="post-metadata">

**Author:** ![Volker\_Rakow](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/volker_rakow/32/758767_2.png) [@Volker\_Rakow](https://discourse.mcneel.com/u/Volker_Rakow)\
**Post date:** [September 9, 2026, 11:28pm UTC](https://discourse.mcneel.com/t/cleaning-up-geometry-for-a-pen-plot/222441/15 "2026-09-09T23:28:00Z")

</div>

From the opening post:

> [@Sheida3](#):
>
> I have this geometry in GH, and I would like to convert it into clean vector linework and plot it using a pen plotter.

Now:

> [@Sheida3](#):
>
> Thank you! I just want to clarify that this is not specifically for a pen plotter. My main goal is to convert the entire geometry into one single continuous line/curve.

What is it that you are planning to do?

> [@Sheida3](#):
>
> same for the geometry in the following file.
> 
> [Problem\_in\_my \_file.gh](https://discourse.mcneel.com/uploads/short-url/f8nc4G82ZWyemgs8iSudaqpeWjM.gh) (16.9 KB)

This has no longer any thing to do with this thread. It belongs [here](https://discourse.mcneel.com/t/unjointed-geometry-with-curve/222320/4).

If you are looking to create a continuous curve that does not back up on itself, then you should investigate “space-filling curves”. Or just use your own sensibilities.

---

<div class="post-metadata">

**Author:** ![Sheida3](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/sheida3/32/760570_2.png) [@Sheida3](https://discourse.mcneel.com/u/Sheida3)\
**Post date:** [September 9, 2026, 11:42pm UTC](https://discourse.mcneel.com/t/cleaning-up-geometry-for-a-pen-plot/222441/16 "2026-09-09T23:42:16Z")

</div>

for this radial tessellation, I need to convert the entire geometry into one single continuous line that can be plotted using a pen plotter or another robotic pen system. (it is like a mandatory requirement:) ) I have tried several approaches but have not been able to find a solution yet.

If this would be better addressed as a new topic, please let me know.

---

<div class="post-metadata">

**Author:** ![Bruce\_Shapiro](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/bruce_shapiro/32/525171_2.png) [@Bruce\_Shapiro](https://discourse.mcneel.com/u/Bruce_Shapiro)\
**Post date:** [September 9, 2026, 11:43pm UTC](https://discourse.mcneel.com/t/cleaning-up-geometry-for-a-pen-plot/222441/17 "2026-09-09T23:43:57Z")

</div>

Not sure – but [this thread](https://discourse.mcneel.com/t/single-line-drawing-of-hyperbolic-tiling/134621) might give you some strategic approach.

---

<div class="post-metadata">

**Author:** ![Volker\_Rakow](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/volker_rakow/32/758767_2.png) [@Volker\_Rakow](https://discourse.mcneel.com/u/Volker_Rakow)\
**Post date:** [September 10, 2026, 12:09am UTC](https://discourse.mcneel.com/t/cleaning-up-geometry-for-a-pen-plot/222441/18 "2026-09-10T00:09:36Z")

</div>

~~I don’t see how that network can be traced without passing over existing edges twice.~~ 🤔

You point as much out:

> [@Single Line Drawing of Hyperbolic Tiling](https://discourse.mcneel.com/t/single-line-drawing-of-hyperbolic-tiling/134621/1):
>
> I understand this will include a lot of redundant tracing

Also sorting that is pretty easy if you simply convert the face centers to polar points. Surprised it was resolved using circles.

---

<div class="post-metadata">

**Author:** ![Sheida3](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/sheida3/32/760570_2.png) [@Sheida3](https://discourse.mcneel.com/u/Sheida3)\
**Post date:** [September 10, 2026, 1:33am UTC](https://discourse.mcneel.com/t/cleaning-up-geometry-for-a-pen-plot/222441/19 "2026-09-10T01:33:23Z")

</div>

Thank you! I suppose this solution divide the whole geometry into some same zones not a-single continuous line.

---

<div class="post-metadata">

**Author:** ![Sheida3](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/sheida3/32/760570_2.png) [@Sheida3](https://discourse.mcneel.com/u/Sheida3)\
**Post date:** [September 10, 2026, 1:45am UTC](https://discourse.mcneel.com/t/cleaning-up-geometry-for-a-pen-plot/222441/20 "2026-09-10T01:45:16Z")

</div>

![model](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/1/8/7/187535076598a7f2e2287409179c7fc86239476a.png)

[Problem\_single\_line.gh](https://discourse.mcneel.com/uploads/short-url/7ULDNje9Y5zK9L08IZhz21iNiM.gh) (18.7 KB) I tried to follow what you said, instead of face center I used discontinuity but my final geometry has been distorteted.

[Next page](https://discourse.mcneel.com/t/cleaning-up-geometry-for-a-pen-plot/222441.md?page=2)
