https://github.com/pistonite/prism
Prism Hex Grid Drawing Tool
https://github.com/pistonite/prism
Last synced: about 1 month ago
JSON representation
Prism Hex Grid Drawing Tool
- Host: GitHub
- URL: https://github.com/pistonite/prism
- Owner: Pistonite
- License: mit
- Created: 2023-06-12T02:15:29.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-24T01:14:42.000Z (2 months ago)
- Last Synced: 2025-03-24T02:25:02.529Z (2 months ago)
- Language: Rust
- Homepage: https://prism.pistonite.dev/
- Size: 485 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Prism


Hex Grid Drawing Tool. https://prism.pistonite.dev
The shapes are defined using TypeScript, which is transpiled with SWC
and executed using a custom runtime built with the BOA JS engine to
create the 3D shape data. The data is then rendered onto a 2D hex grid
and turned into an optimized SVG.The web app allows for quick prototyping of a design. However, it is hard
to keep track of the source code after the design is made. Therefore,
prism is also a CLI tool to help with just that!```
cargo install prism-cli --git https://github.com/Pistonite/prism
```The CLI tool has the same functionality as the web app, but exposed as CLI.
For example, to render `shape.ts` to an SVG:
```
prism shape.ts > shape.svg
```The CLI tool can also render to PNG:
```
prism shape.ts --png shape.png
```You can also import multiple files or specifying additional command to run directly
from the CLI. (note the `-c` command is not transpiled)
```
# suppose the TS files define a function `main` to be called with a color
prism util.ts common.ts -c "main('red')"
```Moreover, the CLI tool supports `import "script";` statements in TypeScript.
The path is resolved as a local path and the full file path
must be given (i.e. `script.ts` instead of `script`). ESM and node_modules
are not supported - you shouldn't need them anywayLastly, you can emit the `.d.ts` file for local development by calling
without an input
```
prism > prism.d.ts
```This is the minimal `tsconfig.json` to get LSP working:
```json
{
"compilerOptions": {
"lib": ["esnext"]
},
}
```