I need to draw an electrical circuit using processing… and I am almost done. I need to draw them using some “vertex” codes. But there is a diagonally line that appeared and I can’t remove it. The lines are changing positions after changing the order of the codes…maybe this could help you to find a solution!
void setup ()
{
size (900, 600);
}
void draw ()
{
background (255);
stroke (0);
strokeWeight (3);
fill (255);
beginShape();
vertex (400, 450); //left short line
vertex (225, 450); //left short line
vertex (225, 150);// upper line
vertex (675, 150);//upper line
vertex (675, 450); //right short line
vertex (500, 450); //right short line
vertex (225, 300); //middle line
vertex (675, 300); //middle line
endShape ();