Skip to content

Commit

Permalink
Add example image to README.
Browse files Browse the repository at this point in the history
  • Loading branch information
virtualritz committed Feb 24, 2023
1 parent 9e0142f commit 50a41e0
Showing 1 changed file with 37 additions and 15 deletions.
52 changes: 37 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,54 @@
# `truck` ‒ A Rust CAD Kernel

## Overview

`truck` is an open-source [B-rep](https://en.wikipedia.org/wiki/Boundary_representation)
[geometric modeling kernel](https://en.wikipedia.org/wiki/Geometric_modeling_kernel)
written in Rust.

![A bottle modeled with truck](example.gif)

*This bottle is based on [this tutorial](https://dev.opencascade.org/doc/overview/html/occt__tutorial.html)
by Open CASCADE Technology (OCCT), a great senior of truck.
The OCCT tutorial properly models the fillets and the threading.
This shows that truck is still in its infancy in terms of functionality.
Our immediate goal for truck is to be able to model this bottle perfectly.*

## Overview

The guiding principles are:

### Modern Tools

- We are using Rust. We pay special attention to make everything work with WebGPU (`wgpu`).
- We use Cargo's extensive maintenance features to ensure thorough continuous integration.
- We are using Rust. We pay special attention to make everything work with
WebGPU (`wgpu`).
- We use Cargo's extensive maintenance features to ensure thorough continuous
integration.

### Mindful Choices

- Instead of creating another binding to one of the existing geometry kernels we are writing a new B-rep NURBS kernel.
- We use safe Rust (although we give you the choice of using `unsafe` methods in some instances).
- Instead of creating another binding to one of the existing geometry kernels
we are writing a new B-rep NURBS kernel.
- We use safe Rust (although we give you the choice of using `unsafe` methods
in some instances).
- Speed is a priority and that includes the `wgpu` backend.

### Modular Architecture

- Functionality is modularized into smaller crates that can be replaced, like the parts in [the Ship of Theseus](https://en.wikipedia.org/wiki/Ship_of_Theseus).
- Based on the many lessons we learned in the past, we have given up on overall optimizations that a single library/crate would afford. A collection of individual, optimized crates carries less risk and can be made just as efficient.
- Feature creep usually happens over time. While we don't believe to be immune from it, bundling stuff in smaller crates will help us deal with it.
- Functionality is modularized into smaller crates that can be replaced, like
the parts in [the Ship of Theseus](https://en.wikipedia.org/wiki/Ship_of_Theseus).
- Based on the many lessons we learned in the past, we have given up on overall
optimizations that a single library/crate would afford. A collection of
individual, optimized crates carries less risk and can be made just as
efficient.
- Feature creep usually happens over time. While we don't believe to be immune
from it, bundling stuff in smaller crates will help us deal with it.

## Usage

### Examples

All examples are located under the `examples` folder of each crate.
These examples use the default syntax for running examples, as found in the [resp. Cargo documentation](https://doc.rust-lang.org/cargo/reference/cargo-targets.html#examples) .
These examples use the default syntax for running examples, as found in the
[resp. Cargo documentation](https://doc.rust-lang.org/cargo/reference/cargo-targets.html#examples) .

At first, let's run the following example!

Expand All @@ -44,15 +62,18 @@ cargo run --example rotate-objects
There are some learning resources for using `truck` v0.1.x series.

- [`truck-tutorial`](https://ricos.gitlab.io/truck-tutorial/v0.1/)
- [`truck-tutorial-ja`](https://ricos.gitlab.io/truck-tutorial-ja/v0.1/) (Japanese version)
- [`truck-tutorial-code`](https://github.com/ricosjp/truck-tutorial-code/tree/v0.1) (sample code for the tutorial)
- [`truck-tutorial-ja`](https://ricos.gitlab.io/truck-tutorial-ja/v0.1/)
(Japanese version)
- [`truck-tutorial-code`](https://github.com/ricosjp/truck-tutorial-code/tree/v0.1)
(sample code for the tutorial)


## Crates

### `truck-base` [![Crates.io](https://img.shields.io/crates/v/truck-base.svg)](https://crates.io/crates/truck-base) [![Docs.rs](https://docs.rs/truck-base/badge.svg)](https://docs.rs/truck-base)

Basic structs and traits: imports `cgmath`, curve and surface traits, tolerance, etc.
Basic structs and traits: imports `cgmath`, curve and surface traits,
tolerance, etc.

### `truck-geotrait` [![Crates.io](https://img.shields.io/crates/v/truck-geotrait.svg)](https://crates.io/crates/truck-geotrait) [![Docs.rs](https://docs.rs/truck-geotrait/badge.svg)](https://docs.rs/truck-geotrait)

Expand All @@ -68,7 +89,8 @@ Topological structs: vertex, edge, wire, face, shell, and solid.

### `truck-polymesh` [![Crates.io](https://img.shields.io/crates/v/truck-polymesh.svg)](https://crates.io/crates/truck-polymesh) [![Docs.rs](https://docs.rs/truck-polymesh/badge.svg)](https://docs.rs/truck-polymesh)

Polygon data structures and algorithms for handling meshes, including meshing of shapes.
Polygon data structures and algorithms for handling meshes, including meshing
of shapes.

### `truck-meshalgo` [![Crates.io](https://img.shields.io/crates/v/truck-meshalgo.svg)](https://crates.io/crates/truck-meshalgo) [![Docs.rs](https://docs.rs/truck-meshalgo/badge.svg)](https://docs.rs/truck-meshalgo)

Expand Down Expand Up @@ -98,4 +120,4 @@ Javascript bindings for `truck`.

## License

Apache License 2.0.
Apache License 2.0.

0 comments on commit 50a41e0

Please sign in to comment.