package shape

import (
	

	
	
	
)

type shapePerson struct {
	*baseShape
}

func ( *geo.Box) Shape {
	 := shapePerson{
		baseShape: &baseShape{
			Type: PERSON_TYPE,
			Box:  ,
		},
	}
	.FullShape = go2.Pointer(Shape())
	return 
}

const (
	PERSON_AR_LIMIT = 1.5

	personShoulderWidthFactor = 20.2 / 68.3
)

func ( shapePerson) () *geo.Box {
	 := .Box.Width
	 := .Box.TopLeft.Copy()
	 := personShoulderWidthFactor * 
	.X += 
	 -=  * 2
	return geo.NewBox(, , .Box.Height)
}

func personPath( *geo.Box) *svg.SvgPathContext {
	 := svg.NewSVGPathContext(.TopLeft, .Width/68.3, .Height/77.4)

	// Bottom side
	.StartAt(.Absolute(68.3, 77.4))
	.H(false, 0)
	.V(true, -1.1)
	.C(true, 0, -13.2, 7.5, -25.1, 19.3, -30.8)
	.C(false, 12.8, 40.9, 8.9, 33.4, 8.9, 25.2)
	.C(false, 8.9, 11.3, 20.2, 0, 34.1, 0)

	// TODO: implement s command with mirroring last control point
	// s 			25.2,11.3, 	25.2,25.2
	// mirroring last control point (20.2,0) -> (34.1,0) = relative(13.9,0)
	.C(true, 13.9, 0, 25.2, 11.3, 25.2, 25.2)

	.C(true, 0, 8.2, -3.8, 15.6, -10.4, 20.4)
	.C(true, 11.8, 5.7, 19.3, 17.6, 19.3, 30.8)
	.V(true, 1)
	.H(false, 68.3)
	.Z()
	return 
}

func ( shapePerson) () []geo.Intersectable {
	return personPath(.Box).Path

}

func ( shapePerson) () []string {
	return []string{
		personPath(.Box).PathData(),
	}
}

func ( shapePerson) (, , ,  float64) (float64, float64) {
	 :=  + 
	// see shapePackage
	 :=  * personShoulderWidthFactor / (1 - 2*personShoulderWidthFactor)
	 += 2 * 
	 :=  + 

	// prevent the shape's aspect ratio from becoming too extreme
	,  = LimitAR(, , PERSON_AR_LIMIT)
	return math.Ceil(), math.Ceil()
}

func ( shapePerson) () (,  float64) {
	return 10, defaultPadding
}