Code Sketch


christmas tree
By: Sampada Dhupkar
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)

def tree = picStack(
    Picture {},
    shape3.thatsStrokeColored(Color(30, 149, 34)).thatsFilledWith(Color(30, 149, 3)).withFlippedX.thatsRotated(-45).thatsTranslated(35, 70),
   shape5.thatsStrokeColored(Color(152, 15, 135)).thatsFilledWith(Color(152, 15, 135)).thatsRotated(90).thatsTranslated(50, 170),
   shape5.thatsStrokeColored(Color(235, 129, 15)).thatsFilledWith(Color(235, 129, 15)).withFlippedX.thatsRotated(90).thatsTranslated(0, 120),
    shape1.thatsStrokeColored(Color(183, 59, 59)).thatsFilledWith(Color(235, 17, 17)).withFlippedX.thatsRotated(90).thatsTranslated(-50, 170),
    shape1.thatsStrokeColored(yellow).thatsFilledWith(yellow).withFlippedX.thatsRotated(90).thatsTranslated(0, 270),
//    shape1.thatsRotated(90).thatsTranslated(100, -100),
    shape6.thatsStrokeColored(Color(33, 162, 39)).thatsFilledWith(Color(33, 202, 31)).withFlippedX.thatsRotated(90).thatsTranslated(100, 120),
    shape7.thatsStrokeColored(Color(0, 228, 235)).thatsFilledWith(Color(0, 163, 251)).thatsRotated(-135).thatsTranslated(-70.71, 270),
//    shape4.thatsRotated(-45).thatsTranslated(0, 141.42)
)

tree.draw