Blame


1 c7146ad4 2022-01-18 falsifian Blog post: https://www.falsifian.org/blog/2022/01/17/s3d/
2 c7146ad4 2022-01-18 falsifian
3 d8b303c4 2022-01-17 falsifian This is a simulation showing what it would be like if the universe were
4 d8b303c4 2022-01-17 falsifian a 3-sphere. It is the three-dimensional analogue to what a
5 d8b303c4 2022-01-17 falsifian two-dimensional person would see if their universe was the surface of a
6 d8b303c4 2022-01-17 falsifian sphere: for example, if you keep walking forward long enough, you'll
7 d8b303c4 2022-01-17 falsifian get back where you started.
8 d8b303c4 2022-01-17 falsifian
9 d8b303c4 2022-01-17 falsifian It's intended to run in any browser that supports WebGL.
10 d8b303c4 2022-01-17 falsifian
11 a95f0ac6 2022-01-17 falsifian To run:
12 c0755cbe 2022-01-17 falsifian
13 d8b303c4 2022-01-17 falsifian 0. It is written in Idris2. As of 2022-01-17, you will need idris2
14 d8b303c4 2022-01-17 falsifian installed with this change:
15 d8b303c4 2022-01-17 falsifian https://github.com/idris-lang/Idris2/pull/2100
16 c0755cbe 2022-01-17 falsifian
17 c0755cbe 2022-01-17 falsifian You'll also need to install the idris2-dom package and its transitive
18 c0755cbe 2022-01-17 falsifian dependencies idris2-experimental, idris2-elab-util and idris2-sop.
19 c0755cbe 2022-01-17 falsifian Each package is available at https://github.com/stefan-hoeck/$package_name
20 c0755cbe 2022-01-17 falsifian
21 a95f0ac6 2022-01-17 falsifian 1. Build the precompute executable:
22 a95f0ac6 2022-01-17 falsifian idris2 --build s3d_precompute.ipkg
23 c0755cbe 2022-01-17 falsifian
24 a95f0ac6 2022-01-17 falsifian 2. Generate the S3D.Polyhedra.Precomputed module:
25 a95f0ac6 2022-01-17 falsifian build/exec/s3d_precompute > src/S3D/Polyhedra/Precomputed.idr
26 c0755cbe 2022-01-17 falsifian
27 a95f0ac6 2022-01-17 falsifian 3. Build by running
28 a95f0ac6 2022-01-17 falsifian idris2 --cg javascript --build s3d.ipkg
29 c0755cbe 2022-01-17 falsifian
30 a95f0ac6 2022-01-17 falsifian 4. Open Main.html in a web browser.
31 a95f0ac6 2022-01-17 falsifian
32 a95f0ac6 2022-01-17 falsifian To run the tests:
33 a95f0ac6 2022-01-17 falsifian idris2 --build s3d_test.ipkg
34 a95f0ac6 2022-01-17 falsifian build/exec/s3d_test
35 a95f0ac6 2022-01-17 falsifian
36 a95f0ac6 2022-01-17 falsifian The src directory is shared by all the *.ipkg files.