├── LICENSE ├── README.md ├── clebsch.html ├── images ├── 201.jpg ├── 202.jpg ├── 202_norm.jpg ├── 208.jpg ├── 208_norm.jpg ├── 215.jpg ├── 218.jpg ├── 218_norm.jpg ├── 220.jpg ├── 220_norm.jpg ├── 221.jpg ├── 221_norm.jpg ├── 239.jpg ├── 239_norm.jpg └── ball.png ├── index.html ├── js ├── OFFLoader.js ├── bf.js ├── clebsch.js ├── desmic.js ├── geometry.js ├── hyper.js ├── maze.js ├── maze3.js ├── poly.js └── three │ ├── OrbitControls.js │ └── three.min.js ├── maze.html ├── off ├── 80cell.off ├── Icosagyrexcavated_Icosahedron.off ├── N8-T1s.off ├── basket.off ├── cubo.off ├── geo_3_2_d.off ├── ico.off ├── icosid.off ├── leo.off ├── leo2.off ├── mobius.off ├── rh_icosid.off ├── spiral.off ├── teapot.off ├── tet.off ├── torus.off ├── tr_icosid.off ├── u34.off ├── u36.off ├── u37.off ├── u38.off ├── u47.off ├── u54.off ├── u58.off ├── u66.off └── weave2.off └── poly.html /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 matthewarcus 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | polyjs 2 | ====== 3 | 4 | Animating uniform polyhedra and compounds with Javascript & THREE.js 5 | 6 | https://matthewarcus.github.io/polyjs 7 | -------------------------------------------------------------------------------- /clebsch.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |49 | 50 | maze.js 51 | 52 |
53 | Given a surface, defined as collection of cells divided 54 | by walls, we can generated a simple maze by finding a 55 | spanning tree of the graph whose nodes are the cells and 56 | whose edges are the walls. Here we use Kruskal's algorithm 57 | to build up the spanning tree: pick walls randomly to 58 | include or exclude from the tree; include if the cells on 59 | either side are already connected, otherwise exclude 60 | (so as to connect the cells on either side in the 61 | resulting tree). Repeat until all walls have been 62 | considered. 63 |
64 | We can describe a 3-dimensional surface by a set of points 65 | and a set of faces, with each face having a list of 66 | points as its boundary. A wall is then just a pair of 67 | points that are adjacent in one or two cell boundaries and 68 | we can then apply our maze generating algorithm as above. 69 |
70 | Having determined the set of walls in the maze, we can 71 | then use the coordinates of the points to 72 | construct a 3-dimensional model. All we need is a base 73 | model to start with, and this is conveniently given by an 74 | OFF file as generated by a tool such as 75 | Antiprism, used here 76 | to generate models for a (dual) geodesic sphere, a torus 77 | and a Möbius strip. 78 |
Click on a pane for an expanded, more interactive 79 | view. Controls for the expanded view are:
80 |91 | 92 | maze3.js 93 | 94 |
95 | Alternatively, we can construct a true 3d maze. Here we 96 | generate the underlying geometry directly with some Javascript: 97 |
98 | 109 |This is all using a framework I've been experimenting with, 111 | based on Three.js, for 112 | drawing polyhedra and other geometric objects: 113 |