mirror of
https://github.com/Sheldan/canvas.git
synced 2026-01-01 06:49:08 +00:00
moving orbits to directory
This commit is contained in:
767
orbits/package-lock.json
generated
Normal file
767
orbits/package-lock.json
generated
Normal file
@@ -0,0 +1,767 @@
|
||||
{
|
||||
"name": "orbits",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "orbits",
|
||||
"version": "1.0.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"three": "^0.162.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vite": "^5.1.5"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/aix-ppc64": {
|
||||
"version": "0.19.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz",
|
||||
"integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"aix"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm": {
|
||||
"version": "0.19.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz",
|
||||
"integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm64": {
|
||||
"version": "0.19.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz",
|
||||
"integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-x64": {
|
||||
"version": "0.19.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz",
|
||||
"integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-arm64": {
|
||||
"version": "0.19.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz",
|
||||
"integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-x64": {
|
||||
"version": "0.19.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz",
|
||||
"integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-arm64": {
|
||||
"version": "0.19.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz",
|
||||
"integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-x64": {
|
||||
"version": "0.19.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz",
|
||||
"integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm": {
|
||||
"version": "0.19.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz",
|
||||
"integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm64": {
|
||||
"version": "0.19.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz",
|
||||
"integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ia32": {
|
||||
"version": "0.19.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz",
|
||||
"integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-loong64": {
|
||||
"version": "0.19.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz",
|
||||
"integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==",
|
||||
"cpu": [
|
||||
"loong64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-mips64el": {
|
||||
"version": "0.19.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz",
|
||||
"integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==",
|
||||
"cpu": [
|
||||
"mips64el"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ppc64": {
|
||||
"version": "0.19.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz",
|
||||
"integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-riscv64": {
|
||||
"version": "0.19.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz",
|
||||
"integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-s390x": {
|
||||
"version": "0.19.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz",
|
||||
"integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-x64": {
|
||||
"version": "0.19.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz",
|
||||
"integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/netbsd-x64": {
|
||||
"version": "0.19.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz",
|
||||
"integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"netbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-x64": {
|
||||
"version": "0.19.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz",
|
||||
"integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"openbsd"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/sunos-x64": {
|
||||
"version": "0.19.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz",
|
||||
"integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"sunos"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-arm64": {
|
||||
"version": "0.19.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz",
|
||||
"integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-ia32": {
|
||||
"version": "0.19.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz",
|
||||
"integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-x64": {
|
||||
"version": "0.19.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz",
|
||||
"integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/rollup-android-arm-eabi": {
|
||||
"version": "4.12.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.1.tgz",
|
||||
"integrity": "sha512-iU2Sya8hNn1LhsYyf0N+L4Gf9Qc+9eBTJJJsaOGUp+7x4n2M9dxTt8UvhJl3oeftSjblSlpCfvjA/IfP3g5VjQ==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-android-arm64": {
|
||||
"version": "4.12.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.1.tgz",
|
||||
"integrity": "sha512-wlzcWiH2Ir7rdMELxFE5vuM7D6TsOcJ2Yw0c3vaBR3VOsJFVTx9xvwnAvhgU5Ii8Gd6+I11qNHwndDscIm0HXg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"android"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-darwin-arm64": {
|
||||
"version": "4.12.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.1.tgz",
|
||||
"integrity": "sha512-YRXa1+aZIFN5BaImK+84B3uNK8C6+ynKLPgvn29X9s0LTVCByp54TB7tdSMHDR7GTV39bz1lOmlLDuedgTwwHg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-darwin-x64": {
|
||||
"version": "4.12.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.1.tgz",
|
||||
"integrity": "sha512-opjWJ4MevxeA8FhlngQWPBOvVWYNPFkq6/25rGgG+KOy0r8clYwL1CFd+PGwRqqMFVQ4/Qd3sQu5t7ucP7C/Uw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-arm-gnueabihf": {
|
||||
"version": "4.12.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.1.tgz",
|
||||
"integrity": "sha512-uBkwaI+gBUlIe+EfbNnY5xNyXuhZbDSx2nzzW8tRMjUmpScd6lCQYKY2V9BATHtv5Ef2OBq6SChEP8h+/cxifQ==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-arm64-gnu": {
|
||||
"version": "4.12.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.1.tgz",
|
||||
"integrity": "sha512-0bK9aG1kIg0Su7OcFTlexkVeNZ5IzEsnz1ept87a0TUgZ6HplSgkJAnFpEVRW7GRcikT4GlPV0pbtVedOaXHQQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-arm64-musl": {
|
||||
"version": "4.12.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.1.tgz",
|
||||
"integrity": "sha512-qB6AFRXuP8bdkBI4D7UPUbE7OQf7u5OL+R94JE42Z2Qjmyj74FtDdLGeriRyBDhm4rQSvqAGCGC01b8Fu2LthQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-riscv64-gnu": {
|
||||
"version": "4.12.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.1.tgz",
|
||||
"integrity": "sha512-sHig3LaGlpNgDj5o8uPEoGs98RII8HpNIqFtAI8/pYABO8i0nb1QzT0JDoXF/pxzqO+FkxvwkHZo9k0NJYDedg==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-x64-gnu": {
|
||||
"version": "4.12.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.1.tgz",
|
||||
"integrity": "sha512-nD3YcUv6jBJbBNFvSbp0IV66+ba/1teuBcu+fBBPZ33sidxitc6ErhON3JNavaH8HlswhWMC3s5rgZpM4MtPqQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-linux-x64-musl": {
|
||||
"version": "4.12.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.1.tgz",
|
||||
"integrity": "sha512-7/XVZqgBby2qp/cO0TQ8uJK+9xnSdJ9ct6gSDdEr4MfABrjTyrW6Bau7HQ73a2a5tPB7hno49A0y1jhWGDN9OQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-win32-arm64-msvc": {
|
||||
"version": "4.12.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.1.tgz",
|
||||
"integrity": "sha512-CYc64bnICG42UPL7TrhIwsJW4QcKkIt9gGlj21gq3VV0LL6XNb1yAdHVp1pIi9gkts9gGcT3OfUYHjGP7ETAiw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-win32-ia32-msvc": {
|
||||
"version": "4.12.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.1.tgz",
|
||||
"integrity": "sha512-LN+vnlZ9g0qlHGlS920GR4zFCqAwbv2lULrR29yGaWP9u7wF5L7GqWu9Ah6/kFZPXPUkpdZwd//TNR+9XC9hvA==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
]
|
||||
},
|
||||
"node_modules/@rollup/rollup-win32-x64-msvc": {
|
||||
"version": "4.12.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.1.tgz",
|
||||
"integrity": "sha512-n+vkrSyphvmU0qkQ6QBNXCGr2mKjhP08mPRM/Xp5Ck2FV4NrHU+y6axzDeixUrCBHVUS51TZhjqrKBBsHLKb2Q==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
]
|
||||
},
|
||||
"node_modules/@types/estree": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz",
|
||||
"integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/esbuild": {
|
||||
"version": "0.19.12",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz",
|
||||
"integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"bin": {
|
||||
"esbuild": "bin/esbuild"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@esbuild/aix-ppc64": "0.19.12",
|
||||
"@esbuild/android-arm": "0.19.12",
|
||||
"@esbuild/android-arm64": "0.19.12",
|
||||
"@esbuild/android-x64": "0.19.12",
|
||||
"@esbuild/darwin-arm64": "0.19.12",
|
||||
"@esbuild/darwin-x64": "0.19.12",
|
||||
"@esbuild/freebsd-arm64": "0.19.12",
|
||||
"@esbuild/freebsd-x64": "0.19.12",
|
||||
"@esbuild/linux-arm": "0.19.12",
|
||||
"@esbuild/linux-arm64": "0.19.12",
|
||||
"@esbuild/linux-ia32": "0.19.12",
|
||||
"@esbuild/linux-loong64": "0.19.12",
|
||||
"@esbuild/linux-mips64el": "0.19.12",
|
||||
"@esbuild/linux-ppc64": "0.19.12",
|
||||
"@esbuild/linux-riscv64": "0.19.12",
|
||||
"@esbuild/linux-s390x": "0.19.12",
|
||||
"@esbuild/linux-x64": "0.19.12",
|
||||
"@esbuild/netbsd-x64": "0.19.12",
|
||||
"@esbuild/openbsd-x64": "0.19.12",
|
||||
"@esbuild/sunos-x64": "0.19.12",
|
||||
"@esbuild/win32-arm64": "0.19.12",
|
||||
"@esbuild/win32-ia32": "0.19.12",
|
||||
"@esbuild/win32-x64": "0.19.12"
|
||||
}
|
||||
},
|
||||
"node_modules/fsevents": {
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
||||
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.3.7",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
|
||||
"integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/ai"
|
||||
}
|
||||
],
|
||||
"bin": {
|
||||
"nanoid": "bin/nanoid.cjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/picocolors": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
|
||||
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/postcss": {
|
||||
"version": "8.4.35",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz",
|
||||
"integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/postcss/"
|
||||
},
|
||||
{
|
||||
"type": "tidelift",
|
||||
"url": "https://tidelift.com/funding/github/npm/postcss"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/ai"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"nanoid": "^3.3.7",
|
||||
"picocolors": "^1.0.0",
|
||||
"source-map-js": "^1.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || >=14"
|
||||
}
|
||||
},
|
||||
"node_modules/rollup": {
|
||||
"version": "4.12.1",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.12.1.tgz",
|
||||
"integrity": "sha512-ggqQKvx/PsB0FaWXhIvVkSWh7a/PCLQAsMjBc+nA2M8Rv2/HG0X6zvixAB7KyZBRtifBUhy5k8voQX/mRnABPg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/estree": "1.0.5"
|
||||
},
|
||||
"bin": {
|
||||
"rollup": "dist/bin/rollup"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0",
|
||||
"npm": ">=8.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@rollup/rollup-android-arm-eabi": "4.12.1",
|
||||
"@rollup/rollup-android-arm64": "4.12.1",
|
||||
"@rollup/rollup-darwin-arm64": "4.12.1",
|
||||
"@rollup/rollup-darwin-x64": "4.12.1",
|
||||
"@rollup/rollup-linux-arm-gnueabihf": "4.12.1",
|
||||
"@rollup/rollup-linux-arm64-gnu": "4.12.1",
|
||||
"@rollup/rollup-linux-arm64-musl": "4.12.1",
|
||||
"@rollup/rollup-linux-riscv64-gnu": "4.12.1",
|
||||
"@rollup/rollup-linux-x64-gnu": "4.12.1",
|
||||
"@rollup/rollup-linux-x64-musl": "4.12.1",
|
||||
"@rollup/rollup-win32-arm64-msvc": "4.12.1",
|
||||
"@rollup/rollup-win32-ia32-msvc": "4.12.1",
|
||||
"@rollup/rollup-win32-x64-msvc": "4.12.1",
|
||||
"fsevents": "~2.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/source-map-js": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz",
|
||||
"integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/three": {
|
||||
"version": "0.162.0",
|
||||
"resolved": "https://registry.npmjs.org/three/-/three-0.162.0.tgz",
|
||||
"integrity": "sha512-xfCYj4RnlozReCmUd+XQzj6/5OjDNHBy5nT6rVwrOKGENAvpXe2z1jL+DZYaMu4/9pNsjH/4Os/VvS9IrH7IOQ=="
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "5.1.5",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-5.1.5.tgz",
|
||||
"integrity": "sha512-BdN1xh0Of/oQafhU+FvopafUp6WaYenLU/NFoL5WyJL++GxkNfieKzBhM24H3HVsPQrlAqB7iJYTHabzaRed5Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"esbuild": "^0.19.3",
|
||||
"postcss": "^8.4.35",
|
||||
"rollup": "^4.2.0"
|
||||
},
|
||||
"bin": {
|
||||
"vite": "bin/vite.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.0.0 || >=20.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/vitejs/vite?sponsor=1"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"fsevents": "~2.3.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/node": "^18.0.0 || >=20.0.0",
|
||||
"less": "*",
|
||||
"lightningcss": "^1.21.0",
|
||||
"sass": "*",
|
||||
"stylus": "*",
|
||||
"sugarss": "*",
|
||||
"terser": "^5.4.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/node": {
|
||||
"optional": true
|
||||
},
|
||||
"less": {
|
||||
"optional": true
|
||||
},
|
||||
"lightningcss": {
|
||||
"optional": true
|
||||
},
|
||||
"sass": {
|
||||
"optional": true
|
||||
},
|
||||
"stylus": {
|
||||
"optional": true
|
||||
},
|
||||
"sugarss": {
|
||||
"optional": true
|
||||
},
|
||||
"terser": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
14
orbits/package.json
Normal file
14
orbits/package.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "orbits",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"private": true,
|
||||
"author": "Sheldan",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"three": "^0.162.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vite": "^5.1.5"
|
||||
}
|
||||
}
|
||||
40
orbits/src/index.html
Normal file
40
orbits/src/index.html
Normal file
@@ -0,0 +1,40 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Orbits</title>
|
||||
<style>
|
||||
html, body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
.container {
|
||||
height: 100%;
|
||||
}
|
||||
.timeContainer {
|
||||
position: absolute;
|
||||
color: yellow;
|
||||
top: 50px
|
||||
}
|
||||
.help {
|
||||
position: absolute;
|
||||
color: yellow;
|
||||
top: 65px
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script type="module" src="js/main.js"></script>
|
||||
<div class="container" id="container">
|
||||
<div class="timeContainer">
|
||||
Current time
|
||||
<span id="currentTime"></span>
|
||||
</div>
|
||||
<span class="help">
|
||||
R -> reset to 2024-03-17 <br>
|
||||
F -> reset camera <br>
|
||||
P -> toggle pause
|
||||
</span>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
229
orbits/src/js/main.js
Normal file
229
orbits/src/js/main.js
Normal file
@@ -0,0 +1,229 @@
|
||||
import * as THREE from 'three';
|
||||
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
|
||||
import {TextGeometry} from 'three/addons/geometries/TextGeometry.js'
|
||||
import Stats from 'three/addons/libs/stats.module.js';
|
||||
import createSpheres from './setup'
|
||||
import spheresAct from './physics'
|
||||
import {FontLoader} from "three/addons";
|
||||
|
||||
const loader = new FontLoader();
|
||||
|
||||
|
||||
const config = {
|
||||
gravitationalConstant: 6.67430e-11,
|
||||
timeStep: 1 * 3600,
|
||||
AU: 149_597_870_700,
|
||||
pause: false,
|
||||
lines: true,
|
||||
currentTime: 1710633600 // Sun Mar 17 2024 00:00:00 GMT+0000
|
||||
}
|
||||
|
||||
const maxPoints = 50_000;
|
||||
const scene = new THREE.Scene();
|
||||
const container = document.getElementById( 'container' );
|
||||
const currentTimeSpan = document.getElementById( 'currentTime' );
|
||||
const renderer = new THREE.WebGLRenderer({ antialias: true, logarithmicDepthBuffer: true });
|
||||
renderer.setPixelRatio(window.devicePixelRatio);
|
||||
renderer.setSize(container.offsetWidth, container.offsetHeight);
|
||||
container.appendChild(renderer.domElement);
|
||||
const stats = new Stats();
|
||||
container.appendChild( stats.dom );
|
||||
const camera = new THREE.PerspectiveCamera( 45, container.offsetWidth / container.offsetHeight, 1, 150 * config.AU);
|
||||
|
||||
const controls = new OrbitControls(camera, renderer.domElement);
|
||||
const texts = [];
|
||||
let lines = {}
|
||||
|
||||
let axesHelper;
|
||||
const spheres = createSpheres();
|
||||
const initialSpheres = JSON.parse(JSON.stringify(spheres));
|
||||
loader.load(
|
||||
// resource URL
|
||||
"https://threejs.org/examples/fonts/helvetiker_regular.typeface.json", function(font) {
|
||||
initScene(font);
|
||||
animate()
|
||||
})
|
||||
|
||||
|
||||
function animate() {
|
||||
requestAnimationFrame( animate );
|
||||
controls.update();
|
||||
stats.update();
|
||||
render();
|
||||
}
|
||||
|
||||
function reset() {
|
||||
config.currentTime = 1710633600;
|
||||
spheres.spheres.forEach(sphereConfig => {
|
||||
sphereConfig.line.material.dispose();
|
||||
sphereConfig.line.geometry.dispose();
|
||||
sphereConfig.group.remove(sphereConfig.line)
|
||||
scene.remove(sphereConfig.line)
|
||||
const oldSphere = initialSpheres.spheres.find((sphere => sphere.name === sphereConfig.name))
|
||||
sphereConfig.x = oldSphere.x;
|
||||
sphereConfig.y = oldSphere.y;
|
||||
sphereConfig.z = oldSphere.z;
|
||||
sphereConfig.vx = oldSphere.vx;
|
||||
sphereConfig.vy = oldSphere.vy;
|
||||
sphereConfig.vz = oldSphere.vz;
|
||||
sphereConfig.group.position.x = sphereConfig.x;
|
||||
sphereConfig.group.position.y = sphereConfig.y;
|
||||
sphereConfig.group.position.z = sphereConfig.z;
|
||||
const textMesh = sphereConfig.text;
|
||||
const labelLine = [];
|
||||
labelLine.push(new THREE.Vector3(textMesh.position.x, textMesh.position.y, textMesh.position.z));
|
||||
labelLine.push(new THREE.Vector3(0, 0, 0 ));
|
||||
const lineMaterial = new THREE.LineBasicMaterial({color: sphereConfig.sphereColor});
|
||||
const lineGeometry = new THREE.BufferGeometry().setFromPoints(labelLine);
|
||||
sphereConfig.line = new THREE.Line( lineGeometry, lineMaterial);;
|
||||
sphereConfig.group.add(sphereConfig.line);
|
||||
lines = {}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
function render() {
|
||||
act()
|
||||
renderer.render(scene, camera);
|
||||
}
|
||||
|
||||
function formatDateTime(input) {
|
||||
var epoch = new Date(0);
|
||||
epoch.setSeconds(parseInt(input));
|
||||
var date = epoch.toISOString();
|
||||
date = date.replace('T', ' ');
|
||||
return date.split('.')[0].split(' ')[0];
|
||||
}
|
||||
|
||||
|
||||
function act() {
|
||||
axesHelper.position.copy(controls.target);
|
||||
texts.forEach(text => {
|
||||
text.lookAt(camera.position)
|
||||
})
|
||||
if(config.pause) {
|
||||
return;
|
||||
}
|
||||
spheresAct(spheres.spheres, config.timeStep)
|
||||
config.currentTime += config.timeStep;
|
||||
currentTimeSpan.innerText = formatDateTime(config.currentTime)
|
||||
if(config.lines) {
|
||||
spheres.spheres.forEach(sphere => {
|
||||
if(!(sphere.name in lines)) {
|
||||
lines[sphere.name] = []
|
||||
const positions = new Float32Array(maxPoints * 3); // 3 vertices per point
|
||||
const geometry = new THREE.BufferGeometry();
|
||||
geometry.setDrawRange(0, 0);
|
||||
geometry.setAttribute('position', new THREE.BufferAttribute(positions, 3));
|
||||
const material = new THREE.LineBasicMaterial( { color: getSphereColor(sphere) } );
|
||||
const line = new THREE.Line(geometry, material);
|
||||
scene.add(line);
|
||||
sphere.line = line;
|
||||
}
|
||||
const pos = {
|
||||
x: sphere.x,
|
||||
y: sphere.y,
|
||||
z: sphere.z
|
||||
}
|
||||
const positionAttribute = sphere.line.geometry.getAttribute( 'position' );
|
||||
lines[sphere.name].push(pos);
|
||||
let currentLength = lines[sphere.name].length - 1;
|
||||
positionAttribute.setXYZ(currentLength, sphere.x, sphere.y, sphere.z);
|
||||
sphere.line.geometry.setDrawRange(0, currentLength);
|
||||
positionAttribute.needsUpdate = true;
|
||||
})
|
||||
}
|
||||
spheres.spheres.forEach(sphere => {
|
||||
sphere.group.position.x = sphere.x;
|
||||
sphere.group.position.y = sphere.y;
|
||||
sphere.group.position.z = sphere.z;
|
||||
})
|
||||
}
|
||||
|
||||
function getSphereColor(sphereConfig) {
|
||||
return new THREE.Color(sphereConfig.color.r / 255, sphereConfig.color.g / 255, sphereConfig.color.b / 255);
|
||||
}
|
||||
|
||||
function resetControls() {
|
||||
const sun = spheres.sphereObj.sun;
|
||||
camera.position.set(sun.x, sun.y, sun.z + config.AU)
|
||||
camera.lookAt(sun.x, sun.y, sun.z)
|
||||
controls.target.set(sun.x, sun.y, sun.z)
|
||||
controls.update();
|
||||
axesHelper.position.copy(controls.target);
|
||||
}
|
||||
|
||||
function initScene(font) {
|
||||
const geometry = new THREE.SphereGeometry(0.5, 24, 12);
|
||||
let scale = config.AU / 10;
|
||||
spheres.spheres.forEach(sphereConfig => {
|
||||
|
||||
let sphereColor = getSphereColor(sphereConfig);
|
||||
const material = new THREE.MeshBasicMaterial({color: sphereColor});
|
||||
|
||||
const sphere = new THREE.Mesh(geometry, material);
|
||||
const group = new THREE.Group();
|
||||
group.position.x = sphereConfig.x;
|
||||
group.position.y = sphereConfig.y;
|
||||
group.position.z = sphereConfig.z;
|
||||
let objectRadius = Math.log(sphereConfig.radius) * 100000000 / 5;
|
||||
sphere.scale.multiplyScalar(objectRadius)
|
||||
group.add(sphere);
|
||||
|
||||
const label = new TextGeometry(sphereConfig.name, {
|
||||
size: 0.25,
|
||||
font: font,
|
||||
height: 0.25
|
||||
});
|
||||
|
||||
let textDistance = 2;
|
||||
if (sphereConfig.isMoon) {
|
||||
textDistance = 5;
|
||||
}
|
||||
const textMesh = new THREE.Mesh(label, material);
|
||||
textMesh.scale.set( scale, scale, scale );
|
||||
textMesh.position.x = textDistance * objectRadius * (Math.random() * textDistance - textDistance) + Math.random() * config.AU / 10;
|
||||
textMesh.position.y = textDistance * objectRadius * (Math.random() * textDistance - textDistance) + Math.random() * config.AU / 10;
|
||||
texts.push(textMesh)
|
||||
group.add(textMesh);
|
||||
sphereConfig.text = textMesh;
|
||||
sphereConfig.group = group;
|
||||
sphereConfig.sphereColor = sphereColor;
|
||||
|
||||
const labelLine = [];
|
||||
labelLine.push(new THREE.Vector3(textMesh.position.x, textMesh.position.y, textMesh.position.z));
|
||||
labelLine.push(new THREE.Vector3(0, 0, 0 ));
|
||||
const lineMaterial = new THREE.LineBasicMaterial({color: sphereColor});
|
||||
const lineGeometry = new THREE.BufferGeometry().setFromPoints(labelLine);
|
||||
const line = new THREE.Line( lineGeometry, lineMaterial);
|
||||
sphereConfig.line = line;
|
||||
group.add(line);
|
||||
scene.add(group);
|
||||
})
|
||||
|
||||
scene.add(new THREE.AmbientLight( 0x777777 ) );
|
||||
|
||||
const light = new THREE.DirectionalLight( 0xffffff, 3 );
|
||||
const sun = spheres.sphereObj.sun
|
||||
light.position.set(sun.x, sun.y, sun.z);
|
||||
scene.add(light);
|
||||
scene.position.set(sun.x, sun.y, sun.z)
|
||||
axesHelper = new THREE.AxesHelper(config.AU / 5);
|
||||
resetControls();
|
||||
scene.add(axesHelper)
|
||||
}
|
||||
|
||||
function keyPress(event) {
|
||||
let keyCode = event.which;
|
||||
if(keyCode === 82) {
|
||||
reset()
|
||||
} else if(keyCode === 70) {
|
||||
resetControls()
|
||||
} else if(keyCode === 80) {
|
||||
config.pause = !config.pause;
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener("keydown", keyPress, false);
|
||||
|
||||
|
||||
57
orbits/src/js/physics.js
Normal file
57
orbits/src/js/physics.js
Normal file
@@ -0,0 +1,57 @@
|
||||
const config = {
|
||||
gravitationalConstant: 6.67428e-11
|
||||
}
|
||||
|
||||
function attraction(sphere1, sphere2) {
|
||||
const dx = sphere1.x - sphere2.x;
|
||||
const dy = sphere1.y - sphere2.y;
|
||||
const dz = sphere1.z - sphere2.z;
|
||||
const direction = {
|
||||
dx: sphere1.x - sphere2.x,
|
||||
dy : sphere1.y - sphere2.y,
|
||||
dz : sphere1.z - sphere2.z
|
||||
};
|
||||
const dist = Math.sqrt(dx * dx + dy * dy + dz * dz);
|
||||
if (dist === 0) {
|
||||
return;
|
||||
}
|
||||
const force = config.gravitationalConstant * sphere2.mass * sphere1.mass / (dist * dist * dist);
|
||||
return {fx: direction.dx * force, fy: direction.dy * force, fz: direction.dz * force}
|
||||
}
|
||||
|
||||
function sphereAct(spheres, sphere, parentIndex) {
|
||||
let totalForce = {
|
||||
fx: 0, fy: 0, fz: 0
|
||||
};
|
||||
for (let sphereI = 0; sphereI < spheres.length; sphereI++) {
|
||||
if (sphereI === parentIndex) {
|
||||
continue;
|
||||
}
|
||||
let forces = attraction(spheres[sphereI], sphere);
|
||||
if (forces) {
|
||||
totalForce.fx += forces.fx;
|
||||
totalForce.fy += forces.fy;
|
||||
totalForce.fz += forces.fz;
|
||||
}
|
||||
}
|
||||
sphere.force = totalForce;
|
||||
}
|
||||
|
||||
function spheresAct(spheres, step) {
|
||||
for (let sphereI = 0; sphereI < spheres.length; sphereI++) {
|
||||
sphereAct(spheres, spheres[sphereI], sphereI);
|
||||
}
|
||||
for (let sphere2I = 0; sphere2I < spheres.length; sphere2I++) {
|
||||
const sphere = spheres[sphere2I];
|
||||
sphere.vx += sphere.force.fx / sphere.mass * step;
|
||||
sphere.vy += sphere.force.fy / sphere.mass * step;
|
||||
sphere.vz += sphere.force.fz / sphere.mass * step;
|
||||
|
||||
sphere.x += sphere.vx * step;
|
||||
sphere.y += sphere.vy * step;
|
||||
sphere.z += sphere.vz * step;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export default spheresAct
|
||||
1025
orbits/src/js/setup.js
Normal file
1025
orbits/src/js/setup.js
Normal file
File diff suppressed because it is too large
Load Diff
406
orbits/utils/client.js
Normal file
406
orbits/utils/client.js
Normal file
@@ -0,0 +1,406 @@
|
||||
var https = require("https");
|
||||
const fs = require('fs');
|
||||
|
||||
var parameter = [
|
||||
{ key: 'COMMAND', value: '\'506\''},
|
||||
{ key: 'CENTER', value: '\'500@0\''},
|
||||
{ key: 'MAKE_EPHEM', value: '\'YES\''},
|
||||
{ key: 'TABLE_TYPE', value: '\'VECTORS\''},
|
||||
{ key: 'START_TIME', value: '\'2024-03-17\''},
|
||||
{ key: 'STOP_TIME', value: '\'2024-03-18\''},
|
||||
{ key: 'STEP_SIZE', value: '\'1 d\''},
|
||||
{ key: 'OUT_UNITS', value: '\'AU-D\''},
|
||||
{ key: 'REF_PLANE', value: '\'ECLIPTIC\''},
|
||||
{ key: 'REF_SYSTEM', value: '\'J2000\''},
|
||||
{ key: 'VECT_CORR', value: '\'NONE\''},
|
||||
{ key: 'VEC_LABELS', value: '\'YES\''},
|
||||
{ key: 'VEC_DELTA_T', value: '\'NO\''},
|
||||
{ key: 'CSV_FORMAT', value: '\'YES\''},
|
||||
{ key: 'OBJ_DATA', value: '\'YES\''},
|
||||
{ key: 'VEC_TABLE', value: '\'3\''}
|
||||
];
|
||||
|
||||
if (!String.prototype.format) {
|
||||
String.prototype.format = function() {
|
||||
var args = arguments;
|
||||
return this.replace(/{(\d+)}/g, function(match, number) {
|
||||
return typeof args[number] != 'undefined'
|
||||
? args[number]
|
||||
: match
|
||||
;
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
var fetched = {}
|
||||
var toFetch = []
|
||||
|
||||
function moonformat(name, object){
|
||||
planetformat(object, name)
|
||||
fs.appendFileSync('planets.js', `${name}.isMoon = true; \n`);
|
||||
}
|
||||
|
||||
function planetformat(values, planetName){
|
||||
var x = 'let {0} = generateBasicPlanet();\n \
|
||||
{0}.radius = {1} * 1000; \n \
|
||||
{0}.name = \'{0}\'; \n \
|
||||
{0}.mass = {2}; \n \
|
||||
{0}.x = {3} * config.AU; \n \
|
||||
{0}.y = {4} * config.AU; \n \
|
||||
{0}.z = {5} * config.AU; \n \
|
||||
\n \
|
||||
{0}.vx = auPerDayToMPerSecond({6}); \n \
|
||||
{0}.vy = auPerDayToMPerSecond({7}); \n \
|
||||
{0}.vz = auPerDayToMPerSecond({8}); \n \
|
||||
';
|
||||
fs.appendFileSync('planets.js', x.format(planetName, values.radius, values.mass, values.x, values.y, values.z, values.vx, values.vy, values.vz));
|
||||
}
|
||||
|
||||
function getObjectIndex(planet, moonIndex) {
|
||||
return '\'' + (planets.indexOf(planet)) + ((moonIndex > 9) ? '' : '0') + moonIndex + '\'';
|
||||
}
|
||||
|
||||
function getPlanetIndex(planet){
|
||||
if(planet === 'sun') {
|
||||
return '10'
|
||||
} else {
|
||||
let index = '\'' + (planets.indexOf(planet)) + '99' + '\'';
|
||||
console.log(`name: ${planet} index ${index}`)
|
||||
return index;
|
||||
}
|
||||
}
|
||||
|
||||
function fetchMoonOfPlanet(planetName, moonIndex, moonName, callback){
|
||||
parameter[0].value = getObjectIndex(planetName, moonIndex);
|
||||
var url = '/horizons_batch.cgi?batch=l';
|
||||
|
||||
parameter.forEach(function(param){
|
||||
url += '&' + param.key + '=' + encodeURIComponent(param.value).replace(/'/g, '%27');
|
||||
});
|
||||
|
||||
var options = {
|
||||
host: 'ssd.jpl.nasa.gov',
|
||||
path: url
|
||||
};
|
||||
var req = https.get(options, function(res){
|
||||
var body = [];
|
||||
res.on('data', function(chunk){
|
||||
body.push(chunk);
|
||||
});
|
||||
res.on('end', function(){
|
||||
try {
|
||||
var responseString = Buffer.concat(body).toString('binary');
|
||||
if(responseString.includes('There was an unexpected problem with server')) {
|
||||
// console.log(moonName + ' failed')
|
||||
return;
|
||||
}
|
||||
var lines = responseString.split(/\r?\n/);
|
||||
var vectorLine = '';
|
||||
var radiusRegex = /Radius\s*\(km\)\s*=\s*~?(\d*\.?\d?)/;
|
||||
let otherRadiusRegex = /Radius\s*\(gravity\),\s*km\s*=\s*~?(\d*\.?\d?)/;
|
||||
let volRadiusRegex = /mean\s*radius,?\s*\(?km\)?\s*=\s*~?(\d*)/i;
|
||||
let meanRadius = /Radius\s*\(km\),\s*mean\s*=\s*~?(\d*\.?\d?)/;
|
||||
var massRegex = /Mass,?\s*\(?10\^(\d*)\s*kg\s*\)?\s*=\s*~?(\d*\.?\d?)/;
|
||||
var otherMassRegex = /Mass,?\s*x10\^(\d*)\s*\(?kg\)?\s*\s*=\s*~?(\d*\.?\d*)/;
|
||||
var gramRegex = /Mass,?\s*\(?10\^(\d*\s*)\s*g\s*\)?\s*=\s*~?(\d*\.?\d*)/;
|
||||
var gramRegexPara = /Mass,?\s*x\s*10\^(\d*)\s*\(g\)\s*=\s*~?(\d*)/;
|
||||
var mass = 0;
|
||||
var radius = 0;
|
||||
lines.forEach(function(line, index, array){
|
||||
// moon and planes return two radius, just take the first one
|
||||
if(line.toUpperCase().indexOf('RADIUS') !== -1 && radius === 0 && line.indexOf('Equat. radius') === -1 && line.indexOf('PHYSICAL') === -1){
|
||||
var radiusMatch;
|
||||
if(line.indexOf('gravity') !== -1){
|
||||
radiusMatch = otherRadiusRegex.exec(line);
|
||||
} else if(line.toUpperCase().indexOf('MEAN RADIUS') !==-1) {
|
||||
radiusMatch = volRadiusRegex.exec(line);
|
||||
} else if(line.indexOf('mean') !== -1){
|
||||
radiusMatch = meanRadius.exec(line);
|
||||
} else {
|
||||
radiusMatch = radiusRegex.exec(line);
|
||||
}
|
||||
radius = radiusMatch[1];
|
||||
}
|
||||
if(line.indexOf('Mass') !== -1 && mass === 0 && line.indexOf('Mass ratio') === -1){
|
||||
var massMatch;
|
||||
if(line.indexOf('x10') !== -1){
|
||||
massMatch = otherMassRegex.exec(line);
|
||||
mass = massMatch[2] + ' * Math.pow(10, ' + massMatch[1] + ')'
|
||||
} else if(line.indexOf('kg') !== -1){
|
||||
massMatch = massRegex.exec(line);
|
||||
mass = massMatch[2] + ' * Math.pow(10, ' + massMatch[1] + ')'
|
||||
} else if(line.indexOf('(g)') !== -1) {
|
||||
massMatch = gramRegexPara.exec(line);
|
||||
mass = (parseInt(massMatch[2]) / 1000) + ' * Math.pow(10, ' + (parseInt(massMatch[1])) + ')';
|
||||
} else {
|
||||
massMatch = gramRegex.exec(line);
|
||||
mass = (parseInt(massMatch[2]) / 1000) + ' * Math.pow(10, ' + (parseInt(massMatch[1])) + ')';
|
||||
}
|
||||
}
|
||||
if(line.indexOf('$$SOE') !== -1) {
|
||||
vectorLine = array[index + 1];
|
||||
}
|
||||
});
|
||||
var values = vectorLine.split(',');
|
||||
var x = values[2];
|
||||
var y = values[3];
|
||||
var z = values[4];
|
||||
var vx = values[5];
|
||||
var vy = values[6];
|
||||
var vz = values[7];
|
||||
|
||||
var moonStats = {
|
||||
x: x,
|
||||
y: y,
|
||||
z: z,
|
||||
vx: vx,
|
||||
vy: vy,
|
||||
vz: vz,
|
||||
radius: radius,
|
||||
mass: mass
|
||||
};
|
||||
fetched[moonName] = 1
|
||||
callback(moonName, moonStats);
|
||||
} catch (e) {
|
||||
console.log(responseString)
|
||||
console.log(e)
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
req.on('error', function(e){
|
||||
console.log(e)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function fetchPlanet(planetName, callback){
|
||||
parameter[0].value = getPlanetIndex(planetName);
|
||||
var url = '/horizons_batch.cgi?batch=l';
|
||||
|
||||
parameter.forEach(function(param){
|
||||
url += '&' + param.key + '=' + encodeURIComponent(param.value).replace(/'/g, '%27');
|
||||
});
|
||||
|
||||
var options = {
|
||||
host: 'ssd.jpl.nasa.gov',
|
||||
path: url
|
||||
};
|
||||
var req = https.get(options, function(res){
|
||||
var body = [];
|
||||
res.on('data', function(chunk){
|
||||
body.push(chunk);
|
||||
});
|
||||
res.on('end', function(){
|
||||
try {
|
||||
var responseString = Buffer.concat(body).toString('binary');
|
||||
if(responseString.includes('There was an unexpected problem with server')) {
|
||||
// console.log(planetName + ' failed')
|
||||
return;
|
||||
}
|
||||
var lines = responseString.split(/\r?\n/);
|
||||
var vectorLine = '';
|
||||
var radiusRegex = /Radius\s*\(km\)\s*=\s*(\d*\.?\d?)/;
|
||||
let otherRadiusRegex = /Radius\s*\(gravity\),\s*km\s*=\s*~?(\d*\.?\d?)/;
|
||||
let volRadiusRegex = /mean\s*radius,?\s*\(?km\)?\s*=\s*~?(\d*)/i;
|
||||
var massRegex = /Mass,?\s*\(?10\^(\d*)\s*kg\s*\)?\s*=\s*~?(\d*\.?\d?)/;
|
||||
var otherMassRegex = /Mass,?\s*x10\^(\d*)\s*\(?kg\)?\s*\s*=\s*~?(\d*\.?\d*)/;
|
||||
var gramRegex = /Mass,?\s*\(?10\^(\d*\s*)\s*g\s*\)?\s*=\s*~?(\d*\.?\d*)/;
|
||||
var gramRegexPara = /Mass,?\s*x\s*10\^(\d*)\s\(g\)\s*=\s*~?(\d*)/;
|
||||
var mass = 0;
|
||||
var radius = 0;
|
||||
lines.forEach(function(line, index, array){
|
||||
// moon and planes return two radius, just take the first one
|
||||
if(line.toUpperCase().indexOf('RADIUS') !== -1 && radius === 0 && line.indexOf('Equat. radius') === -1 && line.indexOf('PHYSICAL') === -1){
|
||||
var radiusMatch;
|
||||
try {
|
||||
if (line.indexOf('gravity') !== -1) {
|
||||
radiusMatch = otherRadiusRegex.exec(line);
|
||||
} else if (line.toUpperCase().indexOf('MEAN RADIUS') !== -1) {
|
||||
radiusMatch = volRadiusRegex.exec(line);
|
||||
} else {
|
||||
radiusMatch = radiusRegex.exec(line);
|
||||
}
|
||||
radius = radiusMatch[1];
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
console.log(line)
|
||||
console.log(responseString)
|
||||
}
|
||||
}
|
||||
if(line.indexOf('Mass') !== -1 && mass === 0 && line.indexOf('Mass ratio') === -1){
|
||||
if(planetName == 'sun') {
|
||||
console.log(line)
|
||||
}
|
||||
var massMatch;
|
||||
if(line.indexOf('x10') !== -1){
|
||||
massMatch = otherMassRegex.exec(line);
|
||||
mass = massMatch[2] + ' * Math.pow(10, ' + massMatch[1] + ')'
|
||||
} else if(line.indexOf('kg') !== -1){
|
||||
massMatch = massRegex.exec(line);
|
||||
mass = massMatch[2] + ' * Math.pow(10, ' + massMatch[1] + ')'
|
||||
} else if(line.indexOf('(g)') !== -1) {
|
||||
massMatch = gramRegexPara.exec(line);
|
||||
mass = (parseInt(massMatch[2]) / 1000) + ' * Math.pow(10, ' + (parseInt(massMatch[1])) + ')';
|
||||
} else {
|
||||
massMatch = gramRegex.exec(line);
|
||||
mass = (parseInt(massMatch[2]) / 1000) + ' * Math.pow(10, ' + (parseInt(massMatch[1])) + ')';
|
||||
}
|
||||
|
||||
}
|
||||
if(line.indexOf('$$SOE') !== -1) {
|
||||
vectorLine = array[index + 1];
|
||||
}
|
||||
});
|
||||
var values = vectorLine.split(',');
|
||||
var x = values[2];
|
||||
var y = values[3];
|
||||
var z = values[4];
|
||||
var vx = values[5];
|
||||
var vy = values[6];
|
||||
var vz = values[7];
|
||||
|
||||
var planet = {
|
||||
x: x,
|
||||
y: y,
|
||||
z: z,
|
||||
vx: vx,
|
||||
vy: vy,
|
||||
vz: vz,
|
||||
radius: radius,
|
||||
mass: mass
|
||||
};
|
||||
fetched[planetName] = 1
|
||||
callback(planet, planetName);
|
||||
} catch (e) {
|
||||
console.log(responseString)
|
||||
console.log(e)
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
req.on('error', function(e){
|
||||
console.log(e)
|
||||
});
|
||||
}
|
||||
|
||||
var planets = ['sun','mercury', 'venus', 'earth', 'mars', 'jupiter', 'saturn', 'uranus', 'neptune', 'pluto'];
|
||||
let planetsToDo = []
|
||||
planets.forEach(plan => planetsToDo.push(plan))
|
||||
|
||||
var moons = {
|
||||
'luna': () => fetchMoonOfPlanet('earth', 1, 'luna', moonformat),
|
||||
|
||||
'phobos': () => fetchMoonOfPlanet('mars', 1, 'phobos', moonformat),
|
||||
'deimos': () => fetchMoonOfPlanet('mars', 2, 'deimos', moonformat),
|
||||
|
||||
'io': () => fetchMoonOfPlanet('jupiter', 1, 'io', moonformat),
|
||||
'europa': () => fetchMoonOfPlanet('jupiter', 2, 'europa', moonformat),
|
||||
'ganymede': () => fetchMoonOfPlanet('jupiter', 3, 'ganymede', moonformat),
|
||||
'callisto': () => fetchMoonOfPlanet('jupiter', 4, 'callisto', moonformat),
|
||||
'amalthea': () => fetchMoonOfPlanet('jupiter', 5, 'amalthea', moonformat),
|
||||
'himalia': () => fetchMoonOfPlanet('jupiter', 6, 'himalia', moonformat),
|
||||
'elara': () => fetchMoonOfPlanet('jupiter', 7, 'elara', moonformat),
|
||||
'pasiphae': () => fetchMoonOfPlanet('jupiter', 8, 'pasiphae', moonformat),
|
||||
'sinope': () => fetchMoonOfPlanet('jupiter', 9, 'sinope', moonformat),
|
||||
'lysithea': () => fetchMoonOfPlanet('jupiter', 10, 'lysithea', moonformat),
|
||||
'carme': () => fetchMoonOfPlanet('jupiter', 11, 'carme', moonformat),
|
||||
'nemausa': () => fetchMoonOfPlanet('jupiter', 12, 'nemausa', moonformat),
|
||||
'ananke': () => fetchMoonOfPlanet('jupiter', 13, 'ananke', moonformat),
|
||||
'thebe': () => fetchMoonOfPlanet('jupiter', 14, 'thebe', moonformat),
|
||||
'adrastea': () => fetchMoonOfPlanet('jupiter', 14, 'adrastea', moonformat),
|
||||
|
||||
'mimas': () => fetchMoonOfPlanet('saturn', 1, 'mimas', moonformat),
|
||||
'enceladus': () => fetchMoonOfPlanet('saturn', 2, 'enceladus', moonformat),
|
||||
'tethys': () => fetchMoonOfPlanet('saturn', 3, 'tethys', moonformat),
|
||||
'dione': () => fetchMoonOfPlanet('saturn', 4, 'dione', moonformat),
|
||||
'rhea': () => fetchMoonOfPlanet('saturn', 5, 'rhea', moonformat),
|
||||
'titan': () => fetchMoonOfPlanet('saturn', 6, 'titan', moonformat),
|
||||
'hyperion': () => fetchMoonOfPlanet('saturn', 7, 'hyperion', moonformat),
|
||||
'iapetus': () => fetchMoonOfPlanet('saturn', 8, 'iapetus', moonformat),
|
||||
'phoebe': () => fetchMoonOfPlanet('saturn', 9, 'phoebe', moonformat),
|
||||
'janus': () => fetchMoonOfPlanet('saturn', 10, 'janus', moonformat),
|
||||
'epimetheus': () => fetchMoonOfPlanet('saturn', 11, 'epimetheus', moonformat),
|
||||
'helene': () => fetchMoonOfPlanet('saturn', 12, 'helene', moonformat),
|
||||
'telesto': () => fetchMoonOfPlanet('saturn', 13, 'telesto', moonformat),
|
||||
'calypso': () => fetchMoonOfPlanet('saturn', 14, 'calypso', moonformat),
|
||||
'atlas': () => fetchMoonOfPlanet('saturn', 15, 'atlas', moonformat),
|
||||
'prometheus': () => fetchMoonOfPlanet('saturn', 16, 'prometheus', moonformat),
|
||||
|
||||
'ariel': () => fetchMoonOfPlanet('uranus', 1, 'ariel', moonformat),
|
||||
'umbriel': () => fetchMoonOfPlanet('uranus', 2, 'umbriel', moonformat),
|
||||
'titania': () => fetchMoonOfPlanet('uranus', 3, 'titania', moonformat),
|
||||
'oberon': () => fetchMoonOfPlanet('uranus', 4, 'oberon', moonformat),
|
||||
'miranda': () => fetchMoonOfPlanet('uranus', 5, 'miranda', moonformat),
|
||||
'cordelia': () => fetchMoonOfPlanet('uranus', 6, 'cordelia', moonformat),
|
||||
'ophelia': () => fetchMoonOfPlanet('uranus', 7, 'ophelia', moonformat),
|
||||
'bianca': () => fetchMoonOfPlanet('uranus', 8, 'bianca', moonformat),
|
||||
'cressida': () => fetchMoonOfPlanet('uranus', 9, 'cressida', moonformat),
|
||||
'desdemona': () => fetchMoonOfPlanet('uranus', 10, 'desdemona', moonformat),
|
||||
'juliet': () => fetchMoonOfPlanet('uranus', 11, 'juliet', moonformat),
|
||||
'portia': () => fetchMoonOfPlanet('uranus', 12, 'portia', moonformat),
|
||||
'rosalind': () => fetchMoonOfPlanet('uranus', 13, 'rosalind', moonformat),
|
||||
'belinda': () => fetchMoonOfPlanet('uranus', 14, 'belinda', moonformat),
|
||||
'puck': () => fetchMoonOfPlanet('uranus', 15, 'puck', moonformat),
|
||||
'caliban': () => fetchMoonOfPlanet('uranus', 16, 'caliban', moonformat),
|
||||
'sycorax': () => fetchMoonOfPlanet('uranus', 17, 'sycorax', moonformat),
|
||||
|
||||
'triton': () => fetchMoonOfPlanet('neptune', 1, 'triton', moonformat),
|
||||
'nereid': () => fetchMoonOfPlanet('neptune', 2, 'nereid', moonformat),
|
||||
'naiad': () => fetchMoonOfPlanet('neptune', 3, 'naiad', moonformat),
|
||||
'thalassa': () => fetchMoonOfPlanet('neptune', 4, 'thalassa', moonformat),
|
||||
'despina': () => fetchMoonOfPlanet('neptune', 5, 'despina', moonformat),
|
||||
'galatea': () => fetchMoonOfPlanet('neptune', 6, 'galatea', moonformat),
|
||||
'larissa': () => fetchMoonOfPlanet('neptune', 7, 'larissa', moonformat),
|
||||
'proteus': () => fetchMoonOfPlanet('neptune', 8, 'proteus', moonformat),
|
||||
'halimede': () => fetchMoonOfPlanet('neptune', 9, 'halimede', moonformat),
|
||||
'psamathe': () => fetchMoonOfPlanet('neptune', 10, 'psamathe', moonformat),
|
||||
|
||||
'charon': () => fetchMoonOfPlanet('pluto', 1, 'charon', moonformat)
|
||||
}
|
||||
|
||||
let moonNames = []
|
||||
for (const [key, value] of Object.entries(moons)) {
|
||||
moonNames.push(key)
|
||||
}
|
||||
|
||||
let totalToDo = moonNames.length + planets.length;
|
||||
console.log(`Todo ${totalToDo}`)
|
||||
const intervalObj = setInterval(() => {
|
||||
//console.log('triggering retry')
|
||||
// console.log(fetched)
|
||||
planetsToDo.forEach(planetName => {
|
||||
if(!(planetName in fetched)) {
|
||||
// console.log('retrying planet ' + planetName)
|
||||
fetchPlanet(planetName, planetformat)
|
||||
} else {
|
||||
var index = planetsToDo.indexOf(planetName);
|
||||
if (index !== -1) {
|
||||
planetsToDo.splice(index, 1);
|
||||
}
|
||||
}
|
||||
})
|
||||
moonNames.forEach(moonName => {
|
||||
if(!(moonName in fetched)) {
|
||||
// console.log('retrying moon ' + moonName)
|
||||
moons[moonName]()
|
||||
} else {
|
||||
var index = moonNames.indexOf(moonName);
|
||||
if (index !== -1) {
|
||||
moonNames.splice(index, 1);
|
||||
}
|
||||
}
|
||||
})
|
||||
let currentlyFetched = Object.keys(fetched).length;
|
||||
console.log(`Progress ${ currentlyFetched}/${totalToDo}`)
|
||||
console.log(fetched)
|
||||
if(currentlyFetched === totalToDo) {
|
||||
clearInterval(intervalObj)
|
||||
}
|
||||
}, 5000 * 2)
|
||||
|
||||
|
||||
|
||||
9
orbits/vite.config.js
Normal file
9
orbits/vite.config.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import { defineConfig } from 'vite'
|
||||
|
||||
export default defineConfig({
|
||||
base: './',
|
||||
root: 'src',
|
||||
build: {
|
||||
outDir: '../../dist/orbits'
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user