# Working on the simple Processing Plotter Updates

**URL:** <https://forum.line-us.com/t/working-on-the-simple-processing-plotter-updates/925>\
**Category:** Programming and API\
**Created:** [July 9, 2024, 3:42am UTC](https://forum.line-us.com/t/working-on-the-simple-processing-plotter-updates/925 "2024-07-09T03:42:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bareimage](https://forum.line-us.com/letter_avatar_proxy/v4/letter/b/edb3f5/32.png) [@Bareimage](https://forum.line-us.com/u/Bareimage)\
**Post date:** [July 9, 2024, 3:42am UTC](https://forum.line-us.com/t/working-on-the-simple-processing-plotter-updates/925/1 "2024-07-09T03:42:31Z")

</div>

Hi folks, I updated processing Simple plotter to the latest version of Processing.

> **[GitHub - bareimage/LineUs\_SVG: Simple SVG plotter for the LineUs drawbot](https://github.com/bareimage/LineUs_SVG)**
>
> Simple SVG plotter for the LineUs drawbot

I am thinking of the following code modifications

### Segmentation:

It seems that original code **flattens** all of the path segments even linear ones. As people might be aware Line-Us can do only straight line G-Code, (G00 and G01) lines. So I am thinking of rebuilding the code base of `draw()` and `plot()` functions to increase quality of the printing of the straight lines

### Fix crash on incorrect IP & NAME communication by adding ping error checking

### Fix Aspect ratio “squash” on zoom/rotation of the SVG path

### Experiment with speed inprovement while using G00 commands

Anyhow Download processing and execute 🙂

---

<div class="post-metadata">

**Author:** ![andypiper](https://forum.line-us.com/user_avatar/forum.line-us.com/andypiper/32/262_2.png) [@andypiper](https://forum.line-us.com/u/andypiper)\
**Post date:** [July 9, 2024, 9:49am UTC](https://forum.line-us.com/t/working-on-the-simple-processing-plotter-updates/925/3 "2024-07-09T09:49:41Z")

</div>

Great to see activity here, I’ll take a look at this!

Hoping that a moderator / site owner can get rid of the AI spambot @adeele though…

---

<div class="post-metadata">

**Author:** ![jmnes](https://forum.line-us.com/user_avatar/forum.line-us.com/jmnes/32/249_2.png) [@jmnes](https://forum.line-us.com/u/jmnes)\
**Post date:** [July 9, 2024, 11:11am UTC](https://forum.line-us.com/t/working-on-the-simple-processing-plotter-updates/925/4 "2024-07-09T11:11:11Z")

</div>

> [@Bareimage](#):
>
> /bareimage/LineUs\_SVG

Hi Bareimage,

Sorry, I can’t find the updated code on github you created for the latest version of Processing… Would you mind adding the url link so I can find directly?

---

<div class="post-metadata">

**Author:** ![Bareimage](https://forum.line-us.com/letter_avatar_proxy/v4/letter/b/edb3f5/32.png) [@Bareimage](https://forum.line-us.com/u/Bareimage)\
**Post date:** [July 9, 2024, 12:13pm UTC](https://forum.line-us.com/t/working-on-the-simple-processing-plotter-updates/925/5 "2024-07-09T12:13:36Z")

</div>

Sorry I could not post the links before.

> **[GitHub - bareimage/LineUs\_SVG: Simple SVG plotter for the LineUs drawbot](https://github.com/bareimage/LineUs_SVG)**
>
> Simple SVG plotter for the LineUs drawbot. Contribute to bareimage/LineUs\_SVG development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![Bareimage](https://forum.line-us.com/letter_avatar_proxy/v4/letter/b/edb3f5/32.png) [@Bareimage](https://forum.line-us.com/u/Bareimage)\
**Post date:** [July 9, 2024, 2:55pm UTC](https://forum.line-us.com/t/working-on-the-simple-processing-plotter-updates/925/6 "2024-07-09T14:55:09Z")

</div>

### Updates on Segmentation

I’ve been experimenting with the Polygonizer library to minimize the number of **segments** in the **linear** path components. I found that the library includes a path optimization component, `RG.ADAPTIVE`.

To optimize the resolution for plotting, modify the following code:

javascript

Copy code

```auto
if (lines) {
    RG.setPolygonizer(RG.UNIFORMLENGTH);

    if (mousePressed) {
      resolution = map(mouseY, 0, height, 3, 200);
    }

```

to

javascript

Copy code

```auto
if (lines) {
    RG.setPolygonizer(RG.ADAPTIVE);
}

```

This change should yield the optimal resolution for plotting.

I haven’t tested this in plotting yet but plan to do so later today. For more information on the Polygonizer, check out this link: [Placing points along an Arc using Geomerative Polygonizer and Processing – Louis Christodoulou](https://louisc.co.uk/?p=2657).

Additionally, the original code creates a **single path** , which isn’t ideal as it draws connected lines. I’m working on a different approach using **objects** , but this will take about two weeks as it requires significant code rewrites. In the meantime, I’ll be implementing different Polygonizer modes so users can experiment with various poligonization modes.

Feel free to reach out if you have any questions or suggestions.
