pof
This commit is contained in:
147
composants.typ
147
composants.typ
@ -160,19 +160,26 @@
|
||||
(17, 6),
|
||||
)
|
||||
|
||||
let darken_ration = 20%
|
||||
|
||||
for e in edges {
|
||||
let vp = vpos.at(e.at(0))
|
||||
let cp = cpos.at(e.at(1))
|
||||
line((vp.at(0), vp.at(1)), (cp.at(0), cp.at(1)), stroke: 0.45pt + rgb("#e0e0e0"))
|
||||
line((vp.at(0), vp.at(1)), (cp.at(0), cp.at(1)), stroke: 0.45pt + rgb("#e0e0e0").darken(darken_ration))
|
||||
}
|
||||
|
||||
for p in vpos {
|
||||
circle((p.at(0), p.at(1)), radius: 0.25, fill: white, stroke: 0.8pt + rgb("#cccccc"))
|
||||
circle((p.at(0), p.at(1)), radius: 0.25, fill: white, stroke: 0.8pt + rgb("#cccccc").darken(darken_ration))
|
||||
}
|
||||
|
||||
for p in cpos {
|
||||
let (x, y) = p
|
||||
rect((x - 0.25, y - 0.25), (x + 0.25, y + 0.25), fill: white, stroke: 0.8pt + rgb("#cccccc"))
|
||||
rect(
|
||||
(x - 0.25, y - 0.25),
|
||||
(x + 0.25, y + 0.25),
|
||||
fill: white,
|
||||
stroke: 0.8pt + rgb("#cccccc").darken(darken_ration),
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -992,6 +999,140 @@
|
||||
})
|
||||
}
|
||||
|
||||
#let hldpc_triple(row1: 0, row2: 9, row3: 14) = {
|
||||
import cetz.draw
|
||||
let points = (
|
||||
(7, 0),
|
||||
(10, 0),
|
||||
(15, 0),
|
||||
(22, 0),
|
||||
(24, 0),
|
||||
(29, 0),
|
||||
(3, 1),
|
||||
(6, 1),
|
||||
(18, 1),
|
||||
(19, 1),
|
||||
(25, 1),
|
||||
(27, 1),
|
||||
(5, 2),
|
||||
(9, 2),
|
||||
(13, 2),
|
||||
(14, 2),
|
||||
(17, 2),
|
||||
(28, 2),
|
||||
(0, 3),
|
||||
(8, 3),
|
||||
(11, 3),
|
||||
(16, 3),
|
||||
(20, 3),
|
||||
(26, 3),
|
||||
(1, 4),
|
||||
(2, 4),
|
||||
(4, 4),
|
||||
(12, 4),
|
||||
(21, 4),
|
||||
(23, 4),
|
||||
(5, 5),
|
||||
(6, 5),
|
||||
(8, 5),
|
||||
(10, 5),
|
||||
(21, 5),
|
||||
(29, 5),
|
||||
(14, 6),
|
||||
(15, 6),
|
||||
(16, 6),
|
||||
(18, 6),
|
||||
(22, 6),
|
||||
(28, 6),
|
||||
(0, 7),
|
||||
(1, 7),
|
||||
(4, 7),
|
||||
(9, 7),
|
||||
(20, 7),
|
||||
(26, 7),
|
||||
(2, 8),
|
||||
(3, 8),
|
||||
(11, 8),
|
||||
(12, 8),
|
||||
(17, 8),
|
||||
(19, 8),
|
||||
(7, 9),
|
||||
(13, 9),
|
||||
(23, 9),
|
||||
(24, 9),
|
||||
(25, 9),
|
||||
(27, 9), // Ligne 9 contient 24
|
||||
(0, 10),
|
||||
(6, 10),
|
||||
(15, 10),
|
||||
(18, 10),
|
||||
(21, 10),
|
||||
(26, 10),
|
||||
(2, 11),
|
||||
(7, 11),
|
||||
(10, 11),
|
||||
(17, 11),
|
||||
(22, 11),
|
||||
(27, 11),
|
||||
(8, 12),
|
||||
(11, 12),
|
||||
(14, 12),
|
||||
(20, 12),
|
||||
(23, 12),
|
||||
(29, 12),
|
||||
(4, 13),
|
||||
(5, 13),
|
||||
(9, 13),
|
||||
(13, 13),
|
||||
(16, 13),
|
||||
(19, 13),
|
||||
(1, 14),
|
||||
(3, 14),
|
||||
(12, 14),
|
||||
(24, 14),
|
||||
(25, 14),
|
||||
(28, 14), // Ligne 14 contient 24
|
||||
)
|
||||
|
||||
cetz.canvas(length: 0.35cm, {
|
||||
let nx = 30
|
||||
let ny = 15
|
||||
let col_1 = orange
|
||||
let col_2 = green.darken(15%)
|
||||
let col_3 = blue
|
||||
|
||||
draw.content((-3.4, -7.5), text(size: 1.6em)[$H =$])
|
||||
|
||||
// Fonds de lignes (Highlight)
|
||||
draw.rect((0, -row1), (nx, -row1 - 1), fill: col_1.lighten(90%), stroke: none)
|
||||
draw.rect((0, -row2), (nx, -row2 - 1), fill: col_2.lighten(90%), stroke: none)
|
||||
draw.rect((0, -row3), (nx, -row3 - 1), fill: col_3.lighten(90%), stroke: none)
|
||||
|
||||
// Crochets
|
||||
draw.set-style(stroke: (thickness: 1.2pt))
|
||||
draw.line((0.5, 0.3), (0, 0.3), (0, -ny - 0.3), (0.5, -ny - 0.3))
|
||||
draw.line((nx - 0.5, 0.3), (nx, 0.3), (nx, -ny - 0.3), (nx - 0.5, -ny - 0.3))
|
||||
|
||||
for (x, y) in points {
|
||||
let d_col = gray.darken(30%)
|
||||
let r = 0.15
|
||||
|
||||
if y == row1 {
|
||||
d_col = col_1
|
||||
r = 0.22
|
||||
} else if y == row2 {
|
||||
d_col = col_2
|
||||
r = 0.22
|
||||
} else if y == row3 {
|
||||
d_col = col_3
|
||||
r = 0.22
|
||||
}
|
||||
|
||||
draw.circle((x + 0.5, -y - 0.5), radius: r, fill: d_col, stroke: none)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// Données de H partagées (mêmes points que hldpc / hldpc_dual)
|
||||
#let _h_pts = (
|
||||
(7, 0),
|
||||
|
||||
Reference in New Issue
Block a user