Skip to content

N17: Polyhedron-ops #448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions content/posts/newsletter-017/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,45 @@ _Discussions:
[serpinski-carpet]: http://playground.meteorlinker.com/?share=1054
[graphics-playground-source]: https://gitlab.com/DixieDev/rust-graphics-playground

### [polyhedron-ops]

![polyhedron render](polyhedron.jpg)
_Some brutalist polyhedron; rendered with 3Delight and post processed in Darktable._

[polyhedron-ops] implements the [Conway Polyhedron Operators][polyhedron-wiki]
and their extensions by George W. Hart and others.

It is based on Kit Wallace’s OpenSCAD code.
As OpenSCAD Language is functional it lends itself well
to translation into functional Rust:

```rust
// Conway notation: gapcD
let polyhedron = Polyhedron::dodecahedron()
.chamfer(None, true)
.propellor(None, true)
.ambo(None, true)
.gyro(None, None, true)
.finalize();
// Export as ./polyhedron-gapcD.obj
polyhedron.write_to_obj(&Path::new("."), false);
```

The internal representation uses mesh buffers that need furter preprocessing
before they can be sent to a GPU
but are almost fine to send to an offline renderer, as-is.

Optionally enabled features include:

- Converting a polyhedron [into a bevy Mesh][polyhedron-bevy].
- Sending a polyhedron to an offline renderer via the [nsi] crate.
- Writing data out as Wavefront OBJ.

[polyhedron-ops]: https://github.com/virtualritz/polyhedron-ops
[polyhedron-wiki]: http://en.wikipedia.org/wiki/Conway_polyhedron_notation
[polyhedron-bevy]: https://github.com/virtualritz/polyhedron-ops/blob/76a0c4b83examples/bevy/bevy.rs
[nsi]: https://crates.io/crates/nsi

## Popular Workgroup Issues in Github

<!-- Up to 10 links to interesting issues -->
Expand Down
Binary file added content/posts/newsletter-017/polyhedron.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.