Hitomezashi 001

From page 145 of Make + Mend by Jessica Marquez
ISBN 978-0-399-57943-1

Log in to post a comment.

// Hitomezashi Pattern
// Horizontal RTows (Yokogushi)
// Ten Cross Stitch (Jujizashi)
// Star Stitch
// Marquez, J. (2018). *Make + Mend: Sashiko‑Inspired embroidery projects to customize and repair textiles and decorate your home*. Watson‑Guptill. ([biblio.ie][1])
// https://biblio.ie/9780399579431?utm_source=chatgpt.com "BIBLIO | Make and Mend: Sashiko-Inspired Embroidery Projects to Customize and Repair Textiles and Decorate Your Home by Jessica Marquez | Hardcover | 2018-08-21 | Watson-Guptill | 9780399579431"
// https://turtletoy.net/turtle/b0611f8c69#

// You can find the Turtle API reference here: https://turtletoy.net/syntax
Canvas.setpenopacity(1);

// Global code will be evaluated once.
const turtle = new Turtle();
const xCount=15; /// min=1 max=50 step=1
const yCount=16; /// min=1 max=50 step=1
const size=6; /// min=1 max=50 step=1
const xMargin=7; /// min=5 max=50 step=1
const yMargin=7; /// min=5 max=50 step=1

// Horizontal RTows (Yokogushi)
for(let i = 0; i < yCount; i++){
   row(i);
}

// Ten Cross Stitch top row
for(let x=5; x < 15; x++){
    
    for(let y = 0; y < yCount; y++){
        turtle.penup();
        TenCrossStitch((xMargin + x * size * 2) - 91,-100 + yMargin + y * size * 2);
    }
}

// Ten Cross Stitch second row
for(let x=5; x < 15; x++){
    
    for(let y = 1; y < yCount * 2; y=y+2){
        turtle.penup();
        TenCrossStitch((xMargin + x * size * 2) - 85,-100 + yMargin  + y * size  );
    }
}

// Star Stitch top row
for(let x=10; x < 15; x++){
    
    for(let y = 0; y < yCount; y++){
        turtle.penup();
        StarStitch(x * size * 2  + -100 + xMargin + 1.5 * size ,-100 + yMargin + y * size * 2);
    }
}

// StarStitch second row
for(let x=10; x < 15; x++){
    
    for(let y = 1; y < yCount * 2; y=y+2){
        turtle.penup();
        StarStitch(x * size * 2 + size  -100 + xMargin + 1.5 * size ,-100 + yMargin  + y * size  );
    }
}

// Horizontal RTows (Yokogushi)
function row(rowNumber) {
    turtle.penup();
    turtle.goto(size + -100 + xMargin,-100 + yMargin + rowNumber * size * 2 );
    
    for (let i = 0; i < xCount; i++) {
    turtle.pendown();
    turtle.forward(size);
    turtle.penup();
    turtle.right(90)
    turtle.forward(size);
    turtle.left(90)
    turtle.pendown();
    turtle.forward(size);
    turtle.penup();
    turtle.left(90)
    turtle.forward(size);
    turtle.right(90)
    turtle.pendown();
    }
}

// Ten Cross Stitch
function TenCrossStitch(xPos, yPos){
turtle.penup();
turtle.goto(xPos,yPos);
turtle.setheading(0) // East 
turtle.back(size/2);
// turtle.pendown();
turtle.forward(size);
turtle.penup();
turtle.back(size/2);
turtle.setheading(90) // South
turtle.forward(size/2)
turtle.pendown();
turtle.setheading(270) // North
turtle.forward(size)
}

// Star Stitch
function StarStitch(xPos, yPos){
turtle.penup();
turtle.goto(xPos,yPos);
turtle.setheading(45) // North-West to South East 
turtle.back(size/2);
turtle.pendown();
turtle.forward(size);
turtle.penup();
turtle.goto(xPos,yPos);
turtle.setheading(45+90) // South
turtle.penup();
turtle.back(size/2)
turtle.pendown();
turtle.forward(size)
}