Ajustar ancho del recipiente

¡Muy bien!

Habría que revisar...

ACEPTAR

CAMBIAR PIEZAS

t = 0 (slider from 0 to c_1 + c_2 + 4, step 0.01)
ancho = 1 (slider from 1 to 45, step 1)
ancho1 = 2 (slider from 1 to 5, step 1)
c_1 = Div(ancho, ancho1)
ancho2 = 4 (slider from 1 to 5, step 1)
r_2 = Mod(ancho, ancho2)
c_2 = Div(ancho, ancho2)
alto1 = 10
vv_1: (0, -alto1)
bloque1, a, b, c, d = Polygon((0, alto1), (0, alto1 + 1), (ancho1 - 0.1, alto1 + 1), (ancho1 - 0.1, alto1))
vh_1 = Sequence(Vector[(ancho1 * i, 0)], i, 0, c_1 - 1)
t_1 = If(t < c_1, t, c_1)
coefh_1 = Sequence(If[floor(t_1) ≟ i, If[t_1 - floor(t_1) < 0.5, 2 * (t_1 - floor(t_1)), 1], If[floor(t_1) < i, 0, 1]], i, 0, c_1 - 1)
coefv_1 = Sequence(If[floor(t_1) ≟ i, If[t_1 - floor(t_1) < 0.5, 0, 2 * (t_1 - floor(t_1) - 0.5)], If[floor(t_1) < i, 0, 1]], i, 0, c_1 - 1)
bloques1 = Sequence(Translate[bloque1, Vector[Element[coefh_1, i] * Element[vh_1, i] + Element[coefv_1, i] * vv_1]], i, 0, c_1)
r_1 = Mod(ancho, ancho1)
alto2 = 12
vv_2: (0, -alto2 + 1)
bloque2, e, f, g, h = Polygon((0, alto2), (0, alto2 + 1), (ancho2 - 0.1, alto2 + 1), (ancho2 - 0.1, alto2))
t_2 = If((r_1 > 0) ∨ (t < c_1), 0, If[t < c_1 + c_2, t - c_1, c_1 + c_2])
vh_2 = Sequence(Vector[(ancho2 * i, 0)], i, 0, c_2 - 1)
coefv_2 = Sequence(If[floor(t_2) ≟ i, If[t_2 - floor(t_2) < 0.5, 0, 2 * (t_2 - floor(t_2) - 0.5)], If[floor(t_2) < i, 0, 1]], i, 0, c_2 - 1)
coefh_2 = Sequence(If[floor(t_2) ≟ i, If[t_2 - floor(t_2) < 0.5, 2 * (t_2 - floor(t_2)), 1], If[floor(t_2) < i, 0, 1]], i, 0, c_2 - 1)
colorB: {0.11, 0.24, 0.63, 0, 0.09}
colorG: {0.14, 0.57, 0.04, 0.96, 0.47}
colorR: {0.85, 0, 0.56, 1, 0.9}
bloques2 = Sequence(Translate[bloque2, Vector[Element[coefh_2, i] * Element[vh_2, i] + Element[coefv_2, i] * vv_2]], i, 0, c_2)
t_1r = If(r_1 ≟ 0, 0, If[t < c_1, 0, If[t < c_1 + 1, t - c_1, 1]])
recipiente, i, j, k, l, m, n, p, q = Polygon((0, 0), (0, 4), (-1, 4), (-1, -1), (ancho + 1, -1), (ancho + 1, 4), (ancho, 4), (ancho, 0))
t_2r = If(r_2 ≟ 0, 0, If[t < c_1 + c_2, 0, If[t < c_1 + c_2 + 1, t - c_1 - c_2, 1]])
bloques1r = Translate(bloque1, Vector[If[t_1r < 0.5, Vector[2 * t_1r * Vector[(Div[ancho, ancho1] * ancho1, 0)]], Vector[(Div[ancho, ancho1] * ancho1, 2 * (t_1r - 0.5) * (4 - alto1))]]])
bloques2r = Translate(bloque2, Vector[If[t_2r < 0.5, Vector[2 * t_2r * Vector[(Div[ancho, ancho2] * ancho2, 0)]], Vector[(Div[ancho, ancho2] * ancho2, 2 * (t_2r - 0.5) * (4 - alto2))]]])