-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganize demos into subfolder (#135)
- Loading branch information
Showing
34 changed files
with
114 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
!*/screenshot.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Fidget demos | ||
## Command-line demo ([`cli`](cli/)) | ||
|
||
Bitmap rendering and meshing from the command line | ||
```shell | ||
$ cargo run -pfidget-cli --release -- -i models/prospero.vm render2d -s512 --eval=vm -oout.png | ||
Finished release [optimized + debuginfo] target(s) in 0.07s | ||
Running `target/release/fidget-cli -i models/prospero.vm render2d -s512 --eval=vm -oout.png` | ||
[2024-06-06T16:08:12Z INFO fidget_cli] Loaded file in 4.528208ms | ||
[2024-06-06T16:08:12Z INFO fidget_cli] Built shape in 2.375208ms | ||
[2024-06-06T16:08:12Z INFO fidget_cli] Rendered 1x at 14.489 ms/frame | ||
``` | ||
|
||
## Script viewer ([`viewer`](viewer/)) | ||
Minimal desktop GUI for interactive exploration, | ||
using [`egui`](https://github.com/emilk/egui) | ||
|
||
```shell | ||
cargo run --release -pfidget-viewer | ||
``` | ||
|
||
![screenshot of script viewer](viewer/screenshot.png) | ||
|
||
## Constraint solving ([`constraints`](constraints/)) | ||
Example of using Fidget for constraint solving. | ||
Uses [`egui`](https://github.com/emilk/egui) | ||
and runs either on the desktop or as a web app. | ||
```shell | ||
cargo run --release -pconstraints | ||
``` | ||
|
||
![screenshot of contraint editor](constraints/screenshot.png) | ||
|
||
See the [subfolder](constraints/) for details on bundling for the web. | ||
|
||
## Web-based editor ([`web-editor`](web-editor/)) | ||
Integrates Fidget into a TypeScript project (web only) | ||
|
||
![screenshot of web editor](web-editor/screenshot.png) | ||
|
||
See the [subfolder](web-editor/) for details on bundling for the web. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
The `web-editor` subfolder embeds Fidget into a web application. | ||
|
||
Building this demo requires [`wasm-pack`](https://rustwasm.github.io/wasm-pack/) | ||
to be installed on the host system. | ||
|
||
Run the editor demo with | ||
|
||
``` | ||
npm install | ||
npm run serve | ||
``` | ||
|
||
Or bundle files for distribution with | ||
|
||
``` | ||
npm run build | ||
``` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ fn intersection(a, b) { | |
} | ||
|
||
fn inverse(a) { | ||
a.neg() | ||
-a | ||
} | ||
|
||
fn difference(a, b) { | ||
|