ico: Display polyhedron animations


ico: Display polyhedron animations

ico is a lightweight tool that renders and animates polyhedrons and basic shapes in your terminal. It supports wireframes, solid faces, color customizations, and simple motion. Below are practical examples to get you started.

Quick-start practical examples

These commands reproduce the examples from the man page. Replace the placeholders with your own values (e.g., 0.1, red, blue) when you run them.

1) Animate an icosahedron by moving its position every 0.1 seconds

ico -sleep 0.1

2) Solid icosahedron with red faces on a blue background

ico -faces -noedges -colors red -bg blue

3) Wireframe of a cube with size 100x100, moving by +1+2 per frame

ico -obj cube -size 100x100 -delta +1+2

4) Inverted wireframe of an icosahedron with line width 10 using 5 threads

ico -i -lw 10 -threads 5

What the options do (quick rundown)

  • -sleep {{seconds}}: pause between frames; a smaller value makes the animation smoother but more CPU usage.
  • -faces: render solid faces instead of a wireframe.
  • -noedges: hide the edges when rendering solid faces.
  • -colors {{color}}: fill or outline color for faces or lines; can be a single color or a gradient in some builds.
  • -bg {{color}}: background color for the scene.
  • -obj {{name}}: choose a predefined mesh like cube, dodecahedron, etc.
  • -size {{WxH}}: size of the rendered object in the scene. Supports formats like 100x100.
  • -delta {{dx+dy}}: movement per frame; use + or - signs to indicate direction.
  • -i: invert the wireframe rendering (opposite depth? depends on implementation).
  • -lw {{width}}: line width for the wireframe.
  • -threads {{n}}: limit or specify how many threads to use for rendering.

Note: The exact behavior of some flags may vary slightly between versions. If something doesn’t seem to work, check your ico version and the man page with man ico or ico --help.

Common pitfalls and tips

  • Mixing -faces with -noedges: if you want solid faces, you typically don’t need -noedges. Using both can result in unexpected visuals depending on the build.
  • Color names vs hex: some builds accept standard color names (red, blue), others may require hex codes like #ff0000. If colors don’t appear, verify what your ico build accepts.
  • Placeholder syntax: in examples you’ll see {{value}} to indicate you should substitute your own value. Do not type the braces in the real command unless the syntax requires them.
  • Performance: lower -sleep values create smoother animation but increase CPU usage. If your terminal becomes unresponsive, raise -sleep a bit.

Quick sanity check

  • Run a simple wireframe pass to confirm rendering works:
ico -obj cube -size 50x50 -delta +0+0 -sleep 0.2

If you see artifacts or no output, ensure your terminal supports graphics output or try a different terminal emulator. Also verify you’re using a reasonably recent version of ico.

Troubleshooting checklist

  • No output or blank screen: check that your terminal supports the rendering mode ico uses; try a different terminal.
  • Colors missing: confirm color support and spelling; test with a basic color name like red or blue.
  • Sluggish performance: increase -sleep or reduce object complexity (size or number of frames).

By starting with these basics and iterating with the examples above, you’ll get comfortable rendering and animating polyhedrons with ico in no time.

See Also