This commit is contained in:
parent
501cf43e03
commit
926acf8fdb
1 changed files with 545 additions and 2 deletions
547
slides/icons.typ
547
slides/icons.typ
|
|
@ -37,6 +37,22 @@
|
||||||
((x1, y1), (x_q1, y_q1), (x_q2, y_q2), (x2, y2))
|
((x1, y1), (x_q1, y_q1), (x_q2, y_q2), (x2, y2))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#let circle_path(
|
||||||
|
center: (0pt, 0pt),
|
||||||
|
r: 0pt,
|
||||||
|
) = {
|
||||||
|
(
|
||||||
|
curve.move(
|
||||||
|
polar(x0: center.at(0), y0: center.at(1), r: r, th: 0deg)
|
||||||
|
),
|
||||||
|
..for i in range(4) {
|
||||||
|
let (p0, q0, q1, p1) = arc(center: center, r: r, th0: i*90deg, th1: (i+1)*90deg)
|
||||||
|
(curve.cubic(q0, q1, p1),)
|
||||||
|
},
|
||||||
|
curve.close()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#let phone(
|
#let phone(
|
||||||
width: 200pt,
|
width: 200pt,
|
||||||
|
|
@ -468,9 +484,536 @@
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
#gear()
|
#let file(
|
||||||
|
height: 200pt,
|
||||||
|
stroke: black + 3pt,
|
||||||
|
fill: white,
|
||||||
|
fill_back: none,
|
||||||
|
type: "cornered",
|
||||||
|
body: [],
|
||||||
|
) = {
|
||||||
|
let width = height / 1.414
|
||||||
|
let fill_back = if fill_back == none { fill.lighten(30%) } else { fill_back }
|
||||||
|
|
||||||
|
let types = (
|
||||||
|
"cornered",
|
||||||
|
"plain",
|
||||||
|
"clip",
|
||||||
|
)
|
||||||
|
assert(
|
||||||
|
type in types,
|
||||||
|
message: "type for file must be in " + repr(types)
|
||||||
|
)
|
||||||
|
|
||||||
|
let corner = (
|
||||||
|
width - height / 5,
|
||||||
|
height / 5,
|
||||||
|
)
|
||||||
|
let corner_up = (
|
||||||
|
corner.at(0),
|
||||||
|
0pt,
|
||||||
|
)
|
||||||
|
let corner_dw = (
|
||||||
|
width,
|
||||||
|
corner.at(1)
|
||||||
|
)
|
||||||
|
/*
|
||||||
|
let corner_up_q = (
|
||||||
|
(corner_up.at(0) + width) / 2,
|
||||||
|
corner_up.at(1)
|
||||||
|
)
|
||||||
|
let corner_q0 = (
|
||||||
|
corner.at(0),
|
||||||
|
corner.at(1)
|
||||||
|
)
|
||||||
|
let corner_q1 = (
|
||||||
|
corner.at(0),
|
||||||
|
corner.at(1)
|
||||||
|
)
|
||||||
|
let corner_dw_q = (
|
||||||
|
corner_dw.at(0),
|
||||||
|
corner_dw.at(1) / 3
|
||||||
|
)*/
|
||||||
|
|
||||||
|
let corner_pth = if type == "cornered" {
|
||||||
|
(
|
||||||
|
curve.line(corner_up),
|
||||||
|
curve.line(corner),
|
||||||
|
//curve.cubic(
|
||||||
|
// corner_up_q,
|
||||||
|
// corner_q0,
|
||||||
|
// corner
|
||||||
|
//),
|
||||||
|
curve.line(corner_dw)
|
||||||
|
//curve.cubic(
|
||||||
|
// corner_q1,
|
||||||
|
// corner_dw_q,
|
||||||
|
// corner_dw,
|
||||||
|
//),
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
(curve.line((width, 0pt)),)
|
||||||
|
}
|
||||||
|
|
||||||
|
box(
|
||||||
|
width: width,
|
||||||
|
height: height,
|
||||||
|
//stroke: black,
|
||||||
|
{
|
||||||
|
if type == "cornered" {
|
||||||
|
let stroke = std.stroke(
|
||||||
|
join: "round",
|
||||||
|
paint: stroke.paint,
|
||||||
|
thickness: stroke.thickness,
|
||||||
|
)
|
||||||
|
place(top+left, {
|
||||||
|
curve(
|
||||||
|
fill: fill_back,
|
||||||
|
stroke: stroke,
|
||||||
|
curve.move(corner_up),
|
||||||
|
curve.line(corner),
|
||||||
|
curve.line(corner_dw),
|
||||||
|
curve.close()
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
place(top+left, {
|
||||||
|
curve(
|
||||||
|
fill: fill,
|
||||||
|
stroke: stroke,
|
||||||
|
curve.move((0pt, 0pt)),
|
||||||
|
..corner_pth,
|
||||||
|
curve.line((width, height)),
|
||||||
|
curve.line((0pt, height)),
|
||||||
|
curve.close(),
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
#let android(
|
||||||
|
height: 200pt,
|
||||||
|
stroke: black + 3pt,
|
||||||
|
stroke_eye: none,
|
||||||
|
fill: green,
|
||||||
|
fill_eye: white,
|
||||||
|
) = {
|
||||||
|
let width = height * 0.78
|
||||||
|
|
||||||
|
let body_height = height * 0.47
|
||||||
|
let body_width = body_height * 1
|
||||||
|
|
||||||
|
let leg_height = body_height / 2
|
||||||
|
let leg_width = body_width / 4
|
||||||
|
let leg_gap = body_width / 4
|
||||||
|
|
||||||
|
let arm_width = leg_width
|
||||||
|
let arm_length = body_height * 0.8
|
||||||
|
let arm_gap = arm_width / 4
|
||||||
|
let arm_offset_to_body = 0pt
|
||||||
|
|
||||||
|
let head_gap = body_height * 0.1
|
||||||
|
|
||||||
|
let antenna_angle = 45deg
|
||||||
|
let antenna_width = body_width * 0.07
|
||||||
|
let antenna_width_angle = calc.asin(2*antenna_width/body_width)
|
||||||
|
let antenna_length = body_width * 0.2
|
||||||
|
|
||||||
|
let eye_rad = body_width * 0.05
|
||||||
|
let rad_eye_in_head = body_width * 0.35
|
||||||
|
let angle_eye = 45deg
|
||||||
|
|
||||||
|
let leg_r_1 = (
|
||||||
|
width / 2 + leg_gap / 2,
|
||||||
|
height - leg_height
|
||||||
|
)
|
||||||
|
let leg_r_c = (
|
||||||
|
width / 2 + leg_gap / 2 + leg_width / 2,
|
||||||
|
height - leg_width / 2
|
||||||
|
)
|
||||||
|
let (
|
||||||
|
leg_r_2,
|
||||||
|
leg_r_2_q,
|
||||||
|
leg_r_3_q0,
|
||||||
|
leg_r_3,
|
||||||
|
) = arc(
|
||||||
|
center: leg_r_c,
|
||||||
|
r: leg_width / 2,
|
||||||
|
th0: 180deg,
|
||||||
|
th1: 90deg,
|
||||||
|
)
|
||||||
|
let (
|
||||||
|
_,
|
||||||
|
leg_r_3_q1,
|
||||||
|
leg_r_4_q,
|
||||||
|
leg_r_4,
|
||||||
|
) = arc(
|
||||||
|
center: leg_r_c,
|
||||||
|
r: leg_width / 2,
|
||||||
|
th0: 90deg,
|
||||||
|
th1: 0deg,
|
||||||
|
)
|
||||||
|
let leg_r_5 = (
|
||||||
|
width / 2 + leg_gap / 2 + leg_width,
|
||||||
|
height - leg_height
|
||||||
|
)
|
||||||
|
let body_dr = (
|
||||||
|
width / 2 + body_width / 2,
|
||||||
|
height - leg_height
|
||||||
|
)
|
||||||
|
let body_ur = (
|
||||||
|
width / 2 + body_width / 2,
|
||||||
|
height - body_height - leg_height
|
||||||
|
)
|
||||||
|
let body_ul = (
|
||||||
|
width / 2 - body_width / 2,
|
||||||
|
height - body_height - leg_height
|
||||||
|
)
|
||||||
|
let body_dl = (
|
||||||
|
width / 2 - body_width / 2,
|
||||||
|
height - leg_height
|
||||||
|
)
|
||||||
|
let leg_l_1 = (
|
||||||
|
width / 2 - leg_gap / 2 - leg_width,
|
||||||
|
height - leg_height
|
||||||
|
)
|
||||||
|
let leg_l_c = (
|
||||||
|
width / 2 - leg_gap / 2 - leg_width / 2,
|
||||||
|
height - leg_width / 2
|
||||||
|
)
|
||||||
|
let (
|
||||||
|
leg_l_2,
|
||||||
|
leg_l_2_q,
|
||||||
|
leg_l_3_q0,
|
||||||
|
leg_l_3,
|
||||||
|
) = arc(
|
||||||
|
center: leg_l_c,
|
||||||
|
r: leg_width / 2,
|
||||||
|
th0: 180deg,
|
||||||
|
th1: 90deg,
|
||||||
|
)
|
||||||
|
let (
|
||||||
|
_,
|
||||||
|
leg_l_3_q1,
|
||||||
|
leg_l_4_q,
|
||||||
|
leg_l_4,
|
||||||
|
) = arc(
|
||||||
|
center: leg_l_c,
|
||||||
|
r: leg_width / 2,
|
||||||
|
th0: 90deg,
|
||||||
|
th1: 0deg,
|
||||||
|
)
|
||||||
|
let leg_l_5 = (
|
||||||
|
width / 2 - leg_gap / 2,
|
||||||
|
height - leg_height
|
||||||
|
)
|
||||||
|
|
||||||
|
let head_center = (
|
||||||
|
width / 2,
|
||||||
|
height - leg_height - body_height - head_gap,
|
||||||
|
)
|
||||||
|
let (
|
||||||
|
head_r,
|
||||||
|
head_r_q,
|
||||||
|
head_ra1_q,
|
||||||
|
head_ra1
|
||||||
|
) = arc(
|
||||||
|
center: head_center,
|
||||||
|
r: body_width / 2,
|
||||||
|
th0: 0deg,
|
||||||
|
th1: - antenna_angle + antenna_width_angle/2,
|
||||||
|
)
|
||||||
|
let antenna_r_c = polar(
|
||||||
|
x0: head_center.at(0),
|
||||||
|
y0: head_center.at(1),
|
||||||
|
r: body_width / 2 + antenna_length - antenna_width/2,
|
||||||
|
th: - antenna_angle
|
||||||
|
)
|
||||||
|
let (
|
||||||
|
antenna_r_0,
|
||||||
|
antenna_r_0_q,
|
||||||
|
antenna_r_1_q0,
|
||||||
|
antenna_r_1
|
||||||
|
) = arc(
|
||||||
|
center: antenna_r_c,
|
||||||
|
r: antenna_width/2,
|
||||||
|
th0: - antenna_angle + 90deg,
|
||||||
|
th1: - antenna_angle,
|
||||||
|
)
|
||||||
|
let (
|
||||||
|
_,
|
||||||
|
antenna_r_1_q1,
|
||||||
|
antenna_r_2_q,
|
||||||
|
antenna_r_2
|
||||||
|
) = arc(
|
||||||
|
center: antenna_r_c,
|
||||||
|
r: antenna_width/2,
|
||||||
|
th0: - antenna_angle,
|
||||||
|
th1: - antenna_angle - 90deg,
|
||||||
|
)
|
||||||
|
let (
|
||||||
|
head_ra2,
|
||||||
|
head_ra2_q,
|
||||||
|
head_t_q0,
|
||||||
|
head_t
|
||||||
|
) = arc(
|
||||||
|
center: head_center,
|
||||||
|
r: body_width / 2,
|
||||||
|
th0: - antenna_angle - antenna_width_angle/2,
|
||||||
|
th1: -90deg,
|
||||||
|
)
|
||||||
|
let (
|
||||||
|
head_la1,
|
||||||
|
head_la1_q,
|
||||||
|
head_t_q1,
|
||||||
|
_,
|
||||||
|
) = arc(
|
||||||
|
center: head_center,
|
||||||
|
r: body_width / 2,
|
||||||
|
th0: 180deg + antenna_angle + antenna_width_angle/2,
|
||||||
|
th1: 270deg,
|
||||||
|
)
|
||||||
|
|
||||||
|
let antenna_l_c = polar(
|
||||||
|
x0: head_center.at(0),
|
||||||
|
y0: head_center.at(1),
|
||||||
|
r: body_width / 2 + antenna_length - antenna_width/2,
|
||||||
|
th: 180deg + antenna_angle
|
||||||
|
)
|
||||||
|
let (
|
||||||
|
antenna_l_0,
|
||||||
|
antenna_l_0_q,
|
||||||
|
antenna_l_1_q0,
|
||||||
|
antenna_l_1
|
||||||
|
) = arc(
|
||||||
|
center: antenna_l_c,
|
||||||
|
r: antenna_width/2,
|
||||||
|
th0: 180deg + antenna_angle + 90deg,
|
||||||
|
th1: 180deg + antenna_angle,
|
||||||
|
)
|
||||||
|
let (
|
||||||
|
_,
|
||||||
|
antenna_l_1_q1,
|
||||||
|
antenna_l_2_q,
|
||||||
|
antenna_l_2
|
||||||
|
) = arc(
|
||||||
|
center: antenna_l_c,
|
||||||
|
r: antenna_width/2,
|
||||||
|
th0: 180deg + antenna_angle,
|
||||||
|
th1: 180deg + antenna_angle -90deg,
|
||||||
|
)
|
||||||
|
let (
|
||||||
|
head_la2,
|
||||||
|
head_la2_q,
|
||||||
|
head_l_q,
|
||||||
|
head_l
|
||||||
|
) = arc(
|
||||||
|
center: head_center,
|
||||||
|
r: body_width / 2,
|
||||||
|
th0: 180deg + antenna_angle - antenna_width_angle/2,
|
||||||
|
th1: 180deg,
|
||||||
|
)
|
||||||
|
|
||||||
|
let eye_l = circle_path(
|
||||||
|
center: polar(
|
||||||
|
x0: head_center.at(0),
|
||||||
|
y0: head_center.at(1),
|
||||||
|
r: rad_eye_in_head,
|
||||||
|
th: 180deg + angle_eye,
|
||||||
|
),
|
||||||
|
r: eye_rad
|
||||||
|
)
|
||||||
|
let eye_r = circle_path(
|
||||||
|
center: polar(
|
||||||
|
x0: head_center.at(0),
|
||||||
|
y0: head_center.at(1),
|
||||||
|
r: rad_eye_in_head,
|
||||||
|
th: - angle_eye,
|
||||||
|
),
|
||||||
|
r: eye_rad
|
||||||
|
)
|
||||||
|
|
||||||
|
let arm_lup_c = (
|
||||||
|
width/2 - body_width/2 - arm_gap - arm_width/2,
|
||||||
|
height - leg_height - body_height + arm_width/2 - arm_offset_to_body,
|
||||||
|
)
|
||||||
|
let arm_ldw_c = (
|
||||||
|
width/2 - body_width/2 - arm_gap - arm_width/2,
|
||||||
|
height - leg_height - body_height - arm_width/2 - arm_offset_to_body + arm_length
|
||||||
|
)
|
||||||
|
let arm_rup_c = (
|
||||||
|
width/2 + body_width/2 + arm_gap + arm_width/2,
|
||||||
|
height - leg_height - body_height + arm_width/2 - arm_offset_to_body
|
||||||
|
)
|
||||||
|
let arm_rdw_c = (
|
||||||
|
width/2 + body_width/2 + arm_gap + arm_width/2,
|
||||||
|
height - leg_height - body_height - arm_width/2 - arm_offset_to_body + arm_length
|
||||||
|
)
|
||||||
|
|
||||||
|
let (
|
||||||
|
arm_lup_0,
|
||||||
|
arm_lup_0_q,
|
||||||
|
arm_lup_1_q0,
|
||||||
|
arm_lup_1,
|
||||||
|
) = arc(
|
||||||
|
center: arm_lup_c,
|
||||||
|
r: arm_width/2,
|
||||||
|
th0: 0deg,
|
||||||
|
th1: -90deg,
|
||||||
|
)
|
||||||
|
let (
|
||||||
|
_,
|
||||||
|
arm_lup_1_q1,
|
||||||
|
arm_lup_2_q,
|
||||||
|
arm_lup_2,
|
||||||
|
) = arc(
|
||||||
|
center: arm_lup_c,
|
||||||
|
r: arm_width/2,
|
||||||
|
th0: -90deg,
|
||||||
|
th1: -180deg,
|
||||||
|
)
|
||||||
|
let (
|
||||||
|
arm_ldw_0,
|
||||||
|
arm_ldw_0_q,
|
||||||
|
arm_ldw_1_q0,
|
||||||
|
arm_ldw_1,
|
||||||
|
) = arc(
|
||||||
|
center: arm_ldw_c,
|
||||||
|
r: arm_width/2,
|
||||||
|
th0: -180deg,
|
||||||
|
th1: -270deg,
|
||||||
|
)
|
||||||
|
let (
|
||||||
|
_,
|
||||||
|
arm_ldw_1_q1,
|
||||||
|
arm_ldw_2_q,
|
||||||
|
arm_ldw_2,
|
||||||
|
) = arc(
|
||||||
|
center: arm_ldw_c,
|
||||||
|
r: arm_width/2,
|
||||||
|
th0: -270deg,
|
||||||
|
th1: -360deg,
|
||||||
|
)
|
||||||
|
|
||||||
|
let (
|
||||||
|
arm_rup_0,
|
||||||
|
arm_rup_0_q,
|
||||||
|
arm_rup_1_q0,
|
||||||
|
arm_rup_1,
|
||||||
|
) = arc(
|
||||||
|
center: arm_rup_c,
|
||||||
|
r: arm_width/2,
|
||||||
|
th0: 0deg,
|
||||||
|
th1: -90deg,
|
||||||
|
)
|
||||||
|
let (
|
||||||
|
_,
|
||||||
|
arm_rup_1_q1,
|
||||||
|
arm_rup_2_q,
|
||||||
|
arm_rup_2,
|
||||||
|
) = arc(
|
||||||
|
center: arm_rup_c,
|
||||||
|
r: arm_width/2,
|
||||||
|
th0: -90deg,
|
||||||
|
th1: -180deg,
|
||||||
|
)
|
||||||
|
let (
|
||||||
|
arm_rdw_0,
|
||||||
|
arm_rdw_0_q,
|
||||||
|
arm_rdw_1_q0,
|
||||||
|
arm_rdw_1,
|
||||||
|
) = arc(
|
||||||
|
center: arm_rdw_c,
|
||||||
|
r: arm_width/2,
|
||||||
|
th0: -180deg,
|
||||||
|
th1: -270deg,
|
||||||
|
)
|
||||||
|
let (
|
||||||
|
_,
|
||||||
|
arm_rdw_1_q1,
|
||||||
|
arm_rdw_2_q,
|
||||||
|
arm_rdw_2,
|
||||||
|
) = arc(
|
||||||
|
center: arm_rdw_c,
|
||||||
|
r: arm_width/2,
|
||||||
|
th0: -270deg,
|
||||||
|
th1: -360deg,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
box(
|
||||||
|
width: width,
|
||||||
|
height: height,
|
||||||
|
//stroke: black,
|
||||||
|
{
|
||||||
|
place(left+top, curve(
|
||||||
|
stroke: stroke,
|
||||||
|
fill: fill,
|
||||||
|
curve.move(leg_r_1),
|
||||||
|
curve.line(leg_r_2),
|
||||||
|
curve.cubic(leg_r_2_q, leg_r_3_q0, leg_r_3),
|
||||||
|
curve.cubic(leg_r_3_q1, leg_r_4_q, leg_r_4),
|
||||||
|
curve.line(leg_r_5),
|
||||||
|
curve.line(body_dr),
|
||||||
|
curve.line(body_ur),
|
||||||
|
curve.line(body_ul),
|
||||||
|
curve.line(body_dl),
|
||||||
|
curve.line(leg_l_1),
|
||||||
|
curve.line(leg_l_2),
|
||||||
|
curve.cubic(leg_l_2_q, leg_l_3_q0, leg_l_3),
|
||||||
|
curve.cubic(leg_l_3_q1, leg_l_4_q, leg_l_4),
|
||||||
|
curve.line(leg_l_5),
|
||||||
|
curve.close(),
|
||||||
|
|
||||||
|
curve.move(head_r),
|
||||||
|
curve.cubic(head_r_q, head_ra1_q, head_ra1),
|
||||||
|
curve.line(antenna_r_0),
|
||||||
|
curve.cubic(antenna_r_0_q, antenna_r_1_q0, antenna_r_1),
|
||||||
|
curve.cubic(antenna_r_1_q1, antenna_r_2_q, antenna_r_2),
|
||||||
|
curve.line(head_ra2),
|
||||||
|
curve.cubic(head_ra2_q, head_t_q0, head_t),
|
||||||
|
curve.cubic(head_t_q1, head_la1_q, head_la1),
|
||||||
|
curve.line(antenna_l_0),
|
||||||
|
curve.cubic(antenna_l_0_q, antenna_l_1_q0, antenna_l_1),
|
||||||
|
curve.cubic(antenna_l_1_q1, antenna_l_2_q, antenna_l_2),
|
||||||
|
curve.line(head_la2),
|
||||||
|
curve.cubic(head_la2_q, head_l_q, head_l),
|
||||||
|
curve.close(mode: "straight"),
|
||||||
|
|
||||||
|
curve.move(arm_lup_0),
|
||||||
|
curve.cubic(arm_lup_0_q, arm_lup_1_q0, arm_lup_1),
|
||||||
|
curve.cubic(arm_lup_1_q1, arm_lup_2_q, arm_lup_2),
|
||||||
|
curve.line(arm_ldw_0),
|
||||||
|
curve.cubic(arm_ldw_0_q, arm_ldw_1_q0, arm_ldw_1),
|
||||||
|
curve.cubic(arm_ldw_1_q1, arm_ldw_2_q, arm_ldw_2),
|
||||||
|
curve.close(mode: "straight"),
|
||||||
|
|
||||||
|
curve.move(arm_rup_0),
|
||||||
|
curve.cubic(arm_rup_0_q, arm_rup_1_q0, arm_rup_1),
|
||||||
|
curve.cubic(arm_rup_1_q1, arm_rup_2_q, arm_rup_2),
|
||||||
|
curve.line(arm_rdw_0),
|
||||||
|
curve.cubic(arm_rdw_0_q, arm_rdw_1_q0, arm_rdw_1),
|
||||||
|
curve.cubic(arm_rdw_1_q1, arm_rdw_2_q, arm_rdw_2),
|
||||||
|
curve.close(mode: "straight"),
|
||||||
|
))
|
||||||
|
place(left+top, curve(
|
||||||
|
stroke: stroke_eye,
|
||||||
|
fill: fill_eye,
|
||||||
|
..eye_l,
|
||||||
|
..eye_r
|
||||||
|
))
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
//#gear()
|
||||||
//#phone(body: [Hello World!])
|
//#phone(body: [Hello World!])
|
||||||
#wrench()
|
//#wrench()
|
||||||
|
|
||||||
|
#file(fill: green)
|
||||||
|
#h(2em)
|
||||||
|
#android(height: 200pt)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#apk()
|
#apk()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue