diff --git a/slides/icons.typ b/slides/icons.typ index 1ba48e8..4fff52e 100644 --- a/slides/icons.typ +++ b/slides/icons.typ @@ -414,8 +414,8 @@ head_fdw_in.at(1) -= head_width box( - width: 200pt, - height: 200pt, + width: length, + height: 2*head_rad, //stroke: black, place(left+horizon, { @@ -464,23 +464,6 @@ })) } -#let transfo(height: 200pt) = { - box(width: height, height: height, { - place( - left+bottom, - dx: height / 12, - dy: - height * 3 / 12, - gear(out-rad: height/3) - ) - place( - left+bottom, - dx: height * 2 / 5, - dy: 0pt, - wrench(length: height*7/8) - ) - }) -} - #let loop(height: 100pt) = image("imgs/ico/loop.svg", height: height) #let analyse(height: 200pt) = { @@ -1308,7 +1291,431 @@ place(dx: height * 6 / 10, dy: height / 10, apk(height: height)) } -#report(height: 200pt) +#let machinery(height: 200pt) = context { + let gear_rad = height * 2 / 5 + let gear = gear(out-rad: gear_rad) + let width = height + let wrench_h = height * 4 / 5 + let wrench_angle = -45deg + let aura_wrench = 9pt + let wrench_0 = rotate(wrench_angle, wrench( + length: wrench_h, + stroke: aura_wrench+white, + )) + let wrench_0_size = measure(wrench_0) + let wrench_1 = rotate(wrench_angle, wrench( + length: wrench_h, + stroke: 3pt+black, + )) + let wrench_1_size = measure(wrench_1) + let wrench_center = ( + width * 2 / 3 - aura_wrench/2, + height * 1 / 3 + aura_wrench/2, + ) + box( + height: height, + width: height, + //stroke: black, + { + place( + left+bottom, + dx: 0pt,//width / 2 - gear_raad, + dy: -height + 2*gear_rad, + gear + ) + place( + left+bottom, + dx: wrench_center.at(0) - wrench_0_size.width / 2, + dy: -wrench_center.at(1) + wrench_0_size.height / 2, + wrench_0 + ) + place( + left+bottom, + dx: wrench_center.at(0) - wrench_1_size.width / 2, + dy: -wrench_center.at(1) + wrench_1_size.height / 2, + wrench_1 + ) + } + ) +} + +#let circle-arrows( + out-rad: 100pt, + in-rad: none, + nb-arrows: 2, + tail-width: none, + point-angle: none, + gap-angle: none, + fill: green, + stroke: 3pt+black, +) = { + let in-rad = if in-rad == none { out-rad / 2 } else { in-rad } + let tail-width = if tail-width == none { (out-rad - in-rad)/2 } else { tail-width } + let gap-angle = if gap-angle == none { 360deg / nb-arrows / 10 } else { gap-angle } + let point-angle = if point-angle == none { 360deg / nb-arrows * 0.15} else { point-angle } + + let th0 = -180deg + let center = (out-rad, out-rad) + let center-rad = (out-rad + in-rad) / 2 + let out-tail-rad = center-rad + tail-width / 2 + let in-tail-rad = center-rad - tail-width / 2 + let arrow-angle = 360deg / nb-arrows + + box( + width: out-rad * 2, + height: out-rad * 2, + //stroke: black, + place(left+top, curve( + fill: fill, + stroke: stroke, + ..for i in range(nb-arrows) { + let ( + p0, + q0, + q1, + p1 + ) = arc( + center: center, + r: out-tail-rad, + th0: th0 + gap-angle, + th1: th0 + arrow-angle - point-angle, + ) + let p2 = polar( + origin: center, + r: out-rad, + th: th0 + arrow-angle - point-angle + ) + let c3 = polar( + origin: center, + r: center-rad, + th: th0 + arrow-angle - point-angle + ) + let p3 = polar( + origin: c3, + r: center-rad * calc.tan(-point-angle), + th: th0 + arrow-angle - point-angle - 90deg + ) + let p4 = polar( + origin: center, + r: in-rad, + th: th0 + arrow-angle - point-angle + ) + + let ( + p5, + q5, + q6, + p6 + ) = arc( + center: center, + r: in-tail-rad, + th0: th0 + arrow-angle - point-angle, + th1: th0 + gap-angle, + ) + th0 += arrow-angle + ( + curve.move(p0), + curve.cubic(q0, q1, p1), + curve.line(p2), + curve.line(p3), + curve.line(p4), + curve.line(p5), + curve.cubic(q5, q6, p6), + curve.close(mode: "straight") + ) + } + )) + ) +} + +#let analyse( + height: 200pt, + stroke: 3pt + black, + node_fill: white, + fill: gray, +) = { + let width = height + let loop_out_rad = height / 4 + let loop_in_rad = height * 0.17 + let loop_width = height / 10 + let loop_len = height + let angle = 60deg + + let text_line_height = height * 0.03 + let text_line_width = width * 0.2 + let text_line_delta = text_line_height * 2 + + let inter_center = loop_len - loop_width / 2 - loop_out_rad + + let hangle_delta_angle = calc.asin(loop_width / 2 / loop_out_rad) + + let center_handle = ( + width - inter_center * calc.cos(angle) - loop_out_rad, + height - loop_width / 2 + ) + let center_loop = polar( + origin: center_handle, + r: inter_center, + th: - angle + ) + + let node_rad = loop_in_rad / 5 + let line_width = node_rad * 2 / 3 + + let node_1_center = ( + center_loop.at(0) + loop_in_rad * 0.2, + center_loop.at(1) - loop_in_rad * 0.4 + ) + let node_2_center = ( + width * 1 / 4, + node_1_center.at(1) - loop_in_rad * 0.3 + ) + let bend_nodes_12 = ( + width * 0.3, + center_loop.at(1) - loop_in_rad * 0.4 + ) + + let node_3_center = ( + center_loop.at(0) - loop_in_rad * 0.3, + center_loop.at(1) + loop_in_rad * 0.4 + ) + let node_4_center = ( + width* 0.2, + node_3_center.at(1) + loop_in_rad / 2, + ) + let bend_nodes_34 = ( + width * 0.35, + node_3_center.at(1) + ) + + + let ( + p0, + q0, + q1_0, + p1 + ) = arc( + center: center_handle, + r: loop_width / 2, + th0: 270deg - angle, + th1: 180deg - angle + ) + let ( + _, + q1_1, + q2, + p2 + ) = arc( + center: center_handle, + r: loop_width / 2, + th0: 180deg - angle, + th1: 90deg - angle + ) + let ( + p3, + q3, + q4_0, + p4 + ) = arc( + center: center_loop, + r: loop_out_rad, + th0: (90deg - angle) + 90deg - hangle_delta_angle, + th1: 90deg + ) + let ( + _, + q4_1, + q5_0, + p5 + ) = arc( + center: center_loop, + r: loop_out_rad, + th0: 90deg, + th1: 0deg + ) + let ( + _, + q5_1, + q6_0, + p6 + ) = arc( + center: center_loop, + r: loop_out_rad, + th0: 0deg, + th1: -90deg + ) + let ( + _, + q6_1, + q7_0, + p7 + ) = arc( + center: center_loop, + r: loop_out_rad, + th0: -90deg, + th1: -180deg + ) + let ( + _, + q7_1, + q8_0, + p8 + ) = arc( + center: center_loop, + r: loop_out_rad, + th0: -180deg, + th1: -270deg + (90deg - angle) + hangle_delta_angle + ) + + let ( + lp0, + lq0, + lq1_0, + lp1 + ) = arc( + center: center_loop, + r: loop_in_rad, + th0: 0deg, + th1: 90deg, + ) + let ( + _, + lq1_1, + lq2_0, + lp2 + ) = arc( + center: center_loop, + r: loop_in_rad, + th0: 90deg, + th1: 180deg, + ) + let ( + _, + lq2_1, + lq3_0, + lp3 + ) = arc( + center: center_loop, + r: loop_in_rad, + th0: 180deg, + th1: 270deg, + ) + let ( + _, + lq3_1, + lq4, + lp4 + ) = arc( + center: center_loop, + r: loop_in_rad, + th0: 270deg, + th1: 360deg, + ) + + + box( + height: height, + width: width, + //stroke: black, + { + place(top+left,curve( + fill: fill, + stroke: stroke, + curve.move(p0), + curve.cubic(q0, q1_0, p1), + curve.cubic(q1_1, q2, p2), + curve.line(p3), + curve.cubic(q3, q4_0, p4), + curve.cubic(q4_1, q5_0, p5), + curve.cubic(q5_1, q6_0, p6), + curve.cubic(q6_1, q7_0, p7), + curve.cubic(q7_1, q8_0, p8), + curve.close(mode: "straight"), + + curve.move(lp0), + curve.cubic(lq0, lq1_0, lp1), + curve.cubic(lq1_1, lq2_0, lp2), + curve.cubic(lq2_1, lq3_0, lp3), + curve.cubic(lq3_1, lq4, lp4), + curve.close(mode: "straight"), + + )) + + for (st, nd) in ( + (node_1_center, bend_nodes_12), + (bend_nodes_12, node_2_center), + (node_3_center, bend_nodes_34), + (bend_nodes_34, node_4_center), + ) { + place(top+left, line(start: st, end: nd, stroke: line_width)) + } + + for i in range(3) { + let y = node_2_center.at(1) - (i+0.75) * text_line_delta - node_rad + let st = ( + node_2_center.at(0) - text_line_width, + y + ) + let nd = ( + node_2_center.at(0), + y + ) + place( + top+left, + line( + start: st, + end: nd, + stroke: std.stroke( + thickness: text_line_height, + cap: "round", + ) + ) + ) + } + + for i in range(4) { + let y = node_4_center.at(1) + (i+0.75) * text_line_delta + node_rad + let st = ( + node_4_center.at(0) - text_line_width / 2, + y + ) + let nd = ( + node_4_center.at(0) + text_line_width / 2, + y + ) + place( + top+left, + line( + start: st, + end: nd, + stroke: std.stroke( + thickness: text_line_height, + cap: "round", + ) + ) + ) + } + + for bend in (bend_nodes_12, bend_nodes_34) { + place( + top+left, + dx: bend.at(0) - line_width / 2, + dy: bend.at(1) - line_width / 2, + circle(radius: line_width/2, fill: black, stroke: none) + ) + } + for node in (node_1_center, node_2_center, node_3_center, node_4_center) { + place(top+left, + dx: node.at(0) - node_rad, + dy: node.at(1) - node_rad, + circle(radius: node_rad, fill: node_fill, stroke: stroke) + ) + } + } + ) +} + +//#report(height: 200pt) //#gear() //#phone(body: [Hello World!]) diff --git a/slides/outlines.typ b/slides/outlines.typ index d9c4f61..13c3e62 100644 --- a/slides/outlines.typ +++ b/slides/outlines.typ @@ -15,12 +15,7 @@ height: small_icon_size ) let rprt = report(height: small_icon_size) - let analyser = box( - height: big_icon_size, - width: big_icon_size, - stroke: black, - align(center+horizon, text(fill: red)[TODO]) - ) + let analyser = analyse(height: big_icon_size) let app_size = measure(app) let app_pos = ( @@ -110,6 +105,11 @@ let phone = phone( width: big_icon_size / 2, height: big_icon_size, + body: align(center+horizon, circle-arrows( + stroke: black + 2pt, + nb-arrows: 3, + out-rad: big_icon_size * 0.19) + ) ) let app_size = measure(app) @@ -255,6 +255,11 @@ let phone = phone( width: big_icon_size * 0.75, height: big_icon_size * 1.5, + body: align(center+horizon, circle-arrows( + stroke: black + 2pt, + nb-arrows: 3, + out-rad: big_icon_size * 0.75 * 0.3) + ) ) let app_size = measure(app) @@ -297,12 +302,7 @@ let arrow_1_y1_1 = dex_pos1.at(1) - dex_size.height / 2 let arrow_1_y1_2 = rprt_pos2.at(1) - dex_size.height / 2 - let patcher = box( - height: big_icon_size, - width: big_icon_size, - stroke: black, - align(center+horizon, text(fill: red)[TODO PATCHER]) - ) + let patcher = machinery(height: big_icon_size) let patcher_size = measure(patcher) let patcher_pos = ( width * 3.3 / 7 - patcher_size.width / 2, @@ -327,12 +327,7 @@ -y0 + app2_size.height / 2 ) - let analyser = box( - height: big_icon_size, - width: big_icon_size, - stroke: black, - align(center+horizon, text(fill: red)[TODO ANALYSER]) - ) + let analyser = analyse(height: big_icon_size) let analyser_size = measure(analyser) let analyser_pos = ( width * 5.7 / 7 - analyser_size.width / 2, @@ -564,6 +559,6 @@ #set page(flipped: true) #set align(center+horizon) -//#dexhunter_outline() -//#static_outline() +#dexhunter_outline() +#static_outline() #theseus_outline()