Code Sketch


House
By: Vinod Naik
Category: Art
cleari

showAxes()
showGrid()


def shape3 = Picture{
    right(135)
    forward(70.71)
    right(90)
    forward(70.71)
    right(90)
    forward(70.71)
    right(90)
    forward(70.71)
    right(90)
}.thatsStrokeColored(black)

def shape4 = Picture{
    right()
    forward(100)
    left(135)
    forward(70.71)
    left(90)
    forward(70.71)   
}.thatsStrokeColored(black)

def shape1 = Picture{
    right(135)
    forward(141.42)
    left(135)
    forward(200)
    left(135)
    forward(141.42)
}.thatsStrokeColored(black)

def shape5 = Picture{
    left(45)
    forward(70.71)
    left(135)
    forward(100)
    left(135)
    forward(70.71)
}.thatsStrokeColored(black)

def shape6 = Picture{
    forward(100)
    right(135)
    forward(70.71)
    right(45)
    forward(100)
    right(135)
    forward(70.71)
}.thatsStrokeColored(black)

def shape7 = Picture {
    left(45)
    forward(141.42)
    left(135)
    forward(100)
    left(90)
    forward(100)
}.thatsStrokeColored(black)

//code for duck

//def tangram = picStack(
//    Picture {},
//    shape3.thatsRotated(-45),
//    shape5.thatsRotated(45).thatsTranslated(0, -70.71),
//    shape1.thatsRotated(45).thatsTranslated(0, -(70.71+70.71)),
//    shape1.thatsRotated(90).thatsTranslated(100, -100),
//    shape6.withFlippedX.thatsRotated(-45),
//    shape7.thatsRotated(-135).thatsTranslated(-70.71, 70.71),
//    shape4.thatsRotated(-45).thatsTranslated(0, 141.42)
//)


//code for fish

//def tangram = picStack(
//    Picture{},
//    shape1.thatsTranslated(-100, 0).thatsFilledWith(blue),
//    shape3.thatsRotated(45).thatsTranslated(0, 70).thatsFilledWith(blue),
//    shape5.thatsRotated(-45).thatsTranslated(71, 70).thatsFilledWith(blue),
//    shape4.thatsRotated(-45).thatsFilledWith(blue),
//    shape6.withFlippedX.thatsRotated(-135)
//    .thatsTranslated(0, -70.71).thatsFilledWith(blue),
//    shape1.withFlippedX.thatsTranslated(171, 0).thatsFilledWith(blue),
//    shape7.thatsRotated(-45).thatsTranslated(240, -71).thatsFilledWith(blue),
//  
//)
//
//.thatsRotated(45)

//code for bird
//def tangram = picStack(
//    Picture{},
//    shape5.thatsRotated(90).thatsTranslated(-150, 50).thatsFilledWith(green),
//    shape1.thatsRotated(-90).thatsTranslated(0, 100).thatsFilledWith(red),
//    shape4.thatsRotated(-45).thatsTranslated(-100, 0).thatsFilledWith(yellow),
//    shape3.thatsRotated(-45).thatsTranslated(41, 0).thatsFilledWith(orange),
//    shape7.thatsRotated(135).thatsTranslated(41, 0).thatsFilledWith(blue),
//    shape6.withFlippedX.thatsRotated(90).thatsTranslated(140, 0).thatsFilledWith(pink),
//    shape1.thatsRotated(90).thatsTranslated(100, 0).thatsFilledWith(magenta),
//    
//    
//    )
//.thatsRotated(-35)

def tangram = picStack(
    Picture{},
    shape1.thatsRotated(-45).thatsTranslated(-75, 0).thatsFilledWith(yellow),
    shape1.thatsRotated(-135).withFlippedY.thatsTranslated(69, -142).thatsFilledWith(red),
    shape7.thatsRotated(-135).thatsTranslated(-110, 0).thatsFilledWith(magenta),
    shape6.thatsRotated(45).thatsTranslated(30, 0).thatsFilledWith(green),
    shape3.thatsRotated(45).thatsTranslated(-40, 144).thatsFilledWith(pink),
    shape4.thatsRotated(-45).thatsTranslated(-75, -145).withFlippedY.thatsFilledWith(orange),
    shape4.thatsRotated(-135).withFlippedX.thatsTranslated(-5, 215).thatsFilledWith(blue)
    
    )

tangram.draw