@@ -242,11 +242,8 @@ function render!(scene, ::typeof(Body), sys, sol, t)
242242 color = get_color (sys, sol, :purple )
243243 r_cm = get_fun (sol, collect (sys. r_cm))
244244 framefun = get_frame_fun (sol, sys. frame_a)
245- radius = try
246- sol (sol. t[1 ], idxs= sys. radius)
247- catch
248- 0.05f0
249- end
245+ radius = sol (sol. t[1 ], idxs= sys. radius) |> Float32
246+ cylinder_radius = sol (sol. t[1 ], idxs= sys. cylinder_radius) |> Float32
250247 thing = @lift begin # Sphere
251248 Ta = framefun ($ t)
252249 coords = (Ta* [r_cm ($ t); 1 ])[1 : 3 ] # TODO : make use of a proper transformation library instead of rolling own?
@@ -257,7 +254,7 @@ function render!(scene, ::typeof(Body), sys, sol, t)
257254
258255 iszero (r_cm (sol. t[1 ])) && (return true )
259256
260- thing = @lift begin # Cylinder
257+ thing2 = @lift begin # Cylinder
261258 Ta = framefun ($ t)
262259
263260 r_cmt = r_cm ($ t) # r_cm is the center of the sphere in frame a
@@ -274,10 +271,9 @@ function render!(scene, ::typeof(Body), sys, sol, t)
274271 extremity = tip
275272 origin = point
276273
277- radius = 0.05f0
278- Makie. GeometryBasics. Cylinder (origin, extremity, radius)
274+ Makie. GeometryBasics. Cylinder (origin, extremity, cylinder_radius)
279275 end
280- mesh! (scene, thing ; color, specular = Vec3f (1.5 ), shininess= 20f0 , diffuse= Vec3f (1 ))
276+ mesh! (scene, thing2 ; color, specular = Vec3f (1.5 ), shininess= 20f0 , diffuse= Vec3f (1 ))
281277 true
282278end
283279
0 commit comments