# Achieving a noodle shape

**URL:** <https://discourse.processing.org/t/achieving-a-noodle-shape/28922>\
**Category:** Coding Questions\
**Created:** [March 28, 2021, 12:37pm UTC](https://discourse.processing.org/t/achieving-a-noodle-shape/28922 "2021-03-28T12:37:52Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [March 28, 2021, 10:21pm UTC](https://discourse.processing.org/t/achieving-a-noodle-shape/28922/6 "2021-03-28T22:21:57Z")

</div>

Hello,

I created a simple shape with curveVertex() and overlaid them to show an outline.

A line is a shape. `:)`

My first version for testing:

> **Code**
>
> ```auto
> // Worm
> // v1.0.0
> // GLV 2021-03-28
> 
> float amp;
> 
> void setup() 
> {
> size(640, 360);
> }
> 
> void draw() 
> {
> amp = map(mouseX, 0, width, 3*height/4, height/4);
>   
> background(255);
> strokeWeight(20);
> noFill();
> stroke(0);
> myShape();
> 
> strokeWeight(15);
> stroke(255);
> myShape();
> }
> 
> void myShape()
> {
> beginShape();
> curveVertex(width/8, height/2);
> curveVertex(width/8, height/2);;
> curveVertex(width/8 + 7*width/32, amp);
> curveVertex(3*width/4 - 3*width/32, height -amp);  
> curveVertex(7*width/8, height/2);
> curveVertex(7*width/8, height/2);
> endShape();
> }
> 
> ```

![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/f/f755189c51960c66416fa15e80ef0b0bb02cc8a2.png)

I then replaced all the fixed co-ordinates with variables and manipulated them (algebra and trigonometry) with code.

Not quite there yet but a work in progress:  
 ![canvas](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/d/d293ed1cb52b6a3f89eaf9f00005478cbff13884.png)

`:)`

---

_[View the full topic](https://discourse.processing.org/t/achieving-a-noodle-shape/28922)._
