mirror of
https://gitlab.rlp.net/mobitar/ReCo.jl.git
synced 2024-12-21 00:51:21 +00:00
Higher resolution and fixed segments colors
This commit is contained in:
parent
b6f7a58b06
commit
bfd3cf783c
1 changed files with 14 additions and 14 deletions
|
@ -3,7 +3,7 @@ function animate(sol::Solution, args, name_part::String; framerate::Int64=10)
|
|||
|
||||
set_theme!(theme_black())
|
||||
|
||||
fig = Figure()
|
||||
fig = Figure(resolution=(1080, 1080))
|
||||
ax = Axis(
|
||||
fig[1, 1];
|
||||
limits=(-args.l, args.l, -args.l, args.l),
|
||||
|
@ -29,6 +29,18 @@ function animate(sol::Solution, args, name_part::String; framerate::Int64=10)
|
|||
skin_colors = Vector{RGBAf}(undef, args.N)
|
||||
|
||||
@showprogress 0.5 for frame in 1:args.n_frames
|
||||
@simd for i in 1:args.N
|
||||
circles[i] = Circle(Point2(sol.center[i, frame]), args.particle_diameter / 2)
|
||||
interaction_circles[i] = Circle(Point2(sol.center[i, frame]), args.interaction_r)
|
||||
skin_circles[i] = Circle(Point2(sol.center[i, frame]), args.skin_r)
|
||||
|
||||
color = get(ColorSchemes.rainbow, rem2pi(sol.φ[i, frame] / (2 * π), RoundDown))
|
||||
|
||||
colors[i] = RGBAf(color)
|
||||
interaction_colors[i] = RGBAf(color, 0.15)
|
||||
skin_colors[i] = RGBAf(color, 0.05)
|
||||
end
|
||||
|
||||
if frame > 1
|
||||
empty!(ax)
|
||||
|
||||
|
@ -40,23 +52,11 @@ function animate(sol::Solution, args, name_part::String; framerate::Int64=10)
|
|||
segments_y[2 * i] = sol.center[i, frame][2]
|
||||
end
|
||||
|
||||
linesegments!(ax, segments_x, segments_y; color=1:(args.N))
|
||||
linesegments!(ax, segments_x, segments_y; color=colors)
|
||||
else
|
||||
println("Started recording!")
|
||||
end
|
||||
|
||||
@simd for i in 1:args.N
|
||||
circles[i] = Circle(Point2(sol.center[i, frame]), args.particle_diameter / 2)
|
||||
interaction_circles[i] = Circle(Point2(sol.center[i, frame]), args.interaction_r)
|
||||
skin_circles[i] = Circle(Point2(sol.center[i, frame]), args.skin_r)
|
||||
|
||||
color = get(ColorSchemes.rainbow, rem2pi(sol.φ[i, frame] / (2 * π), RoundDown))
|
||||
|
||||
colors[i] = RGBAf(color)
|
||||
interaction_colors[i] = RGBAf(color, 0.2)
|
||||
skin_colors[i] = RGBAf(color, 0.05)
|
||||
end
|
||||
|
||||
poly!(ax, circles; color=colors)
|
||||
poly!(ax, interaction_circles; color=interaction_colors)
|
||||
poly!(ax, skin_circles; color=skin_colors)
|
||||
|
|
Loading…
Reference in a new issue