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 all 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 @@ -606,6 +606,45 @@ _Discussions:
[/r/rust](https://www.reddit.com/r/rust/comments/kkf1jz/kira_game_audio_library_v030_persequence_custom/),
[Twitter](https://twitter.com/tesselode/status/1342878087990685700)_

### [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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That link is missing a /.
Should be https://github.com/virtualritz/polyhedron-ops/blob/76a0c4b83/examples/bevy/bevy.rs, I think

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops. will fix in the final draft.

[nsi]: https://crates.io/crates/nsi

### [raw-gl-context]

[raw-gl-context] is a cross-platform library for OpenGL context creation which
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.