Skip to content

Commit a2b9b6c

Browse files
doc: update rustdoc, user guide & readme (#19)
* chore: bump version to 0.1.3 * doc: add honeycomb-render section to UG * doc: change the Cargo toml example to include other workspace member * doc: add content to honeycomb-render section * doc: add documentation of the SmaaMode enum * doc: add RenderParameters documentation * doc: add Runner documentation * doc: add module-level documentation across honeycomb-render * doc: finish UG section of honeycomb-render * doc: update honeycomb-core section in UG * doc: update README * chore: update changelog file & create 0.1.3 section * doc: update examples to use ? operator instead of unwrap suggestion from @cedricchevalier19 * remove empty line in Coords2 example Co-authored-by: Cédric Chevalier <[email protected]> * doc: add link to Coords2 example in user guide * chore: update changelog --------- Co-authored-by: Cédric Chevalier <[email protected]>
1 parent 48d0713 commit a2b9b6c

File tree

18 files changed

+181
-66
lines changed

18 files changed

+181
-66
lines changed

CHANGELOG.md

Lines changed: 49 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,41 @@
22

33
## To be released
44

5-
### Repository Changes
6-
75
...
86

7+
---
8+
9+
## 0.1.3
10+
911
### New Features
1012

1113
#### honeycomb-core
1214

15+
<sup>core definitions and tools for combinatorial map implementation</sup>
16+
1317
- `Orbit<'a, const N_MARKS: usize, T: CoordsFloat>` - Generic implementation for
1418
2D orbit computations. The structure itself only contains meta-data, the orbit
15-
computation is done through the `Iterator` trait implementation.
19+
computation is done through the `Iterator` trait implementation (#18)
1620
- `OrbitPolicy<'a>` - Enum used to specify the beta functions used by an orbit.
17-
It currently does not not support compositions.
21+
It currently does not support compositions (#18)
1822
- New (temporary?) method for `TwoMap`: `beta_runtime`. It works by redirecting
1923
to the original `beta` method, using match block and a beta identifier provided
20-
at runtime.
24+
at runtime (#18)
25+
26+
#### honeycomb-guide
27+
28+
<sup>**mdbook**-based user guide with information regarding usage & non-code-related
29+
aspects of the project</sup>
30+
31+
- update content of the workspace section to include new member (#19)
32+
- update **honeycomb-core**'s page content (#19)
33+
34+
#### honeycomb-render (new member)
35+
36+
<sup>visualization tool for combinatorial maps</sup>
37+
38+
- implement `TwoMap` rendering code
39+
- add examples illustrating basic usage
2140

2241
---
2342

@@ -32,6 +51,8 @@
3251

3352
#### honeycomb-core
3453

54+
<sup>core definitions and tools for combinatorial map implementation</sup>
55+
3556
- `Coords2<T: CoordsFloat>` - Custom 2D coordinates representation using a
3657
generic type for inner value.
3758
- refactor two attributes of `TwoMap`:
@@ -40,10 +61,15 @@
4061

4162
#### honeycomb-guide
4263

64+
<sup>**mdbook**-based user guide with information regarding usage & non-code-related
65+
aspects of the project</sup>
66+
4367
- update usage instructions
4468

4569
#### honeycomb-utils
4670

71+
<sup>utility routines used in benchmarking and testing</sup>
72+
4773
- update content according to features introduced in #15, #16
4874

4975
---
@@ -52,22 +78,31 @@
5278

5379
### Repository Changes
5480

55-
- new project members: `honeycomb-utils` (#10)
5681
- new CI workflow:
5782
- `bench`: run hardware-counter based benchmarks on new version release
5883

5984
### New Features
6085

6186
#### honeycomb-core
6287

88+
<sup>core definitions and tools for combinatorial map implementation</sup>
89+
6390
- introduce `benchmarking_utils` feature, used to compile additional methods &
6491
trait implementation useful for benchmarking
6592

6693
#### honeycomb-guide
6794

68-
- update content (#5, #12)
95+
<sup>**mdbook**-based user guide with information regarding usage & non-code-related
96+
aspects of the project.</sup>
6997

70-
#### honeycomb-utils
98+
- complete (partially) definition sections (#5)
99+
- add documentation for the core implementatiosn (#5)
100+
- add usage instructions (#12)
101+
- add `honeycomb-utils` section (#12)
102+
103+
#### honeycomb-utils (new member)
104+
105+
<sup>utility routines used in benchmarking and testing</sup>
71106

72107
- benchmarks for the `TwoMap` structure and methods (#10, #11)
73108
- utility functions for benchmarking and testing.
@@ -83,19 +118,20 @@
83118

84119
### Repository Changes
85120

86-
- new project members: `honeycomb-core`, `honeycomb-guide`
87121
- new CI workflows:
88122
- `doc`: build & deploy user guide and code documentation
89123
- `rust-test`: run Rust tests, format checker & linter (`clippy`)
90124

91125
### New Features
92126

93-
#### honeycomb-core
127+
#### honeycomb-core (new member)
128+
129+
<sup>core definitions and tools for combinatorial map implementation</sup>
94130

95131
- `TwoMap` - basic 2D combinatorial map implementation
96132
- full documentation support & deployment
97133

98-
#### honeycomb-guide
134+
#### honeycomb-guide (new member)
99135

100-
- **mdbook**-based user guide with information regarding usage &
101-
non-code-related aspects of the project.
136+
<sup>**mdbook**-based user guide with information regarding usage & non-code-related
137+
aspects of the project</sup>

README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# Honeycomb
22

3-
Honeycomb aims to provide a safe, efficient and scalable implementation of
3+
Honeycomb aims to provide a safe, efficient and scalable implementation of
44
combinatorial maps for meshing applications. More specifically, the goal is
5-
to converge towards a (or multiple) structure(s) adapted to algorithms
5+
to converge towards a (or multiple) structure(s) adapted to algorithms
66
exploiting GPUs and many-core architectures.
77

8-
The current objective is to write a first implementation in Rust, to then
9-
improve the structure without having to deal with data races and similar
8+
The current objective is to write a first implementation in Rust, to then
9+
improve the structure without having to deal with data races and similar
1010
issues, thanks to the language's guarantees.
1111

1212
## Usage
1313

14-
The [user guide][UG] provides an overview of everything available in the
15-
project. It can be generated offline using **mdbook**:
14+
The [user guide][UG] provides an overview of everything available in the
15+
project. It can be generated offline using **mdbook**:
1616

1717
```shell
1818
# Serve the doc on a local server
@@ -34,13 +34,18 @@ kill $(ps -e | awk '/mdbook/ {print $1}')
3434

3535
The content of each member as well as instructions for usage are available in the [user guide][UGW].
3636

37-
- Basic structure are provided in the **honeycomb-core** crate ([Rust Doc][DOCHC]).
37+
- Basic structures are provided in the **honeycomb-core** crate ([Rust Doc][DOCHC]).
3838
- Utilities for tests and benchmarks are provided in the **honeycomb-utils** crate ([Rust Doc][DOCHU])
39+
- A visualing tool is provided in the **honeycomb-render** crate ([Rust Doc][DOCHR]).
3940

4041
[UGW]: https://lihpc-computational-geometry.github.io/honeycomb/project-structure/workspace.html
42+
4143
[DOCHC]: https://lihpc-computational-geometry.github.io/honeycomb/honeycomb_core/
44+
4245
[DOCHU]: https://lihpc-computational-geometry.github.io/honeycomb/honeycomb_utils/
4346

47+
[DOCHR]: https://lihpc-computational-geometry.github.io/honeycomb/honeycomb_render/
48+
4449
## Contributing
4550

4651
## License

honeycomb-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "honeycomb-core"
3-
version = "0.1.2"
3+
version = "0.1.3"
44
edition = "2021"
55

66
[features]

honeycomb-core/src/coords.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ pub enum CoordsError {
5454
/// # Example
5555
///
5656
/// ```rust
57+
/// # use honeycomb_core::CoordsError;
58+
/// # fn main() -> Result<(), CoordsError> {
5759
/// use honeycomb_core::{Coords2, FloatType};
5860
///
5961
/// let unit_x = Coords2::unit_x();
@@ -66,7 +68,9 @@ pub enum CoordsError {
6668
/// let x_plus_y: Coords2<FloatType> = unit_x + unit_y;
6769
///
6870
/// assert_eq!(x_plus_y.norm(), two.sqrt());
69-
/// assert_eq!(x_plus_y.unit_dir().unwrap(), Coords2::from((1.0 / two.sqrt(), 1.0 / two.sqrt())));
71+
/// assert_eq!(x_plus_y.unit_dir()?, Coords2::from((1.0 / two.sqrt(), 1.0 / two.sqrt())));
72+
/// # Ok(())
73+
/// # }
7074
/// ```
7175
///
7276
#[derive(Debug, Clone, Copy, Default, PartialEq)]

honeycomb-core/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub mod twomap;
2424

2525
// ------ RE-EXPORTS
2626

27-
pub use coords::{Coords2, CoordsFloat, FloatType};
27+
pub use coords::{Coords2, CoordsError, CoordsFloat, FloatType};
2828
pub use dart::{DartIdentifier, NULL_DART_ID};
2929
pub use embed::{
3030
FaceIdentifier, SewPolicy, UnsewPolicy, Vertex2, VertexIdentifier, VolumeIdentifier,

honeycomb-core/src/twomap.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ const TWO_MAP_BETA: usize = 3;
8888
/// progressive changes applied to the structure.
8989
///
9090
/// ```
91+
/// # use honeycomb_core::twomap::MapError;
92+
/// # fn main() -> Result<(), MapError> {
9193
/// use honeycomb_core::{ DartIdentifier, SewPolicy, TwoMap, UnsewPolicy, VertexIdentifier, NULL_DART_ID, Orbit, OrbitPolicy};
9294
///
9395
/// // --- Map creation
@@ -100,9 +102,9 @@ const TWO_MAP_BETA: usize = 3;
100102
/// let (v1, v2, v3): (VertexIdentifier, VertexIdentifier, VertexIdentifier) = (0, 1, 2);
101103
///
102104
/// // place the vertices in space
103-
/// map.set_vertex(v1, [0.0, 0.0]).unwrap();
104-
/// map.set_vertex(v2, [0.0, 10.0]).unwrap();
105-
/// map.set_vertex(v3, [10.0, 0.0]).unwrap();
105+
/// map.set_vertex(v1, [0.0, 0.0])?;
106+
/// map.set_vertex(v2, [0.0, 10.0])?;
107+
/// map.set_vertex(v3, [10.0, 0.0])?;
106108
/// // associate dart to vertices
107109
/// map.set_vertexid(d1, v1);
108110
/// map.set_vertexid(d2, v2);
@@ -164,8 +166,8 @@ const TWO_MAP_BETA: usize = 3;
164166
/// let v4 = map.add_vertex(Some([15.0, 0.0].into())); // v4
165167
/// let v5 = map.add_vertices(2); // v5, v6
166168
/// let v6 = v5 + 1;
167-
/// map.set_vertex(v5, [5.0, 10.0]).unwrap(); // v5
168-
/// map.set_vertex(v6, [15.0, 10.0]).unwrap(); // v6
169+
/// map.set_vertex(v5, [5.0, 10.0])?; // v5
170+
/// map.set_vertex(v6, [15.0, 10.0])?; // v6
169171
/// // associate dart to vertices
170172
/// map.set_vertexid(d4, v4);
171173
/// map.set_vertexid(d5, v5);
@@ -202,7 +204,7 @@ const TWO_MAP_BETA: usize = 3;
202204
/// // --- (c)
203205
///
204206
/// // shift the position of d6 to build a square using the two faces
205-
/// map.set_vertex(map.vertexid(d6), [10.0, 10.0]).unwrap();
207+
/// map.set_vertex(map.vertexid(d6), [10.0, 10.0])?;
206208
///
207209
/// // --- (d)
208210
///
@@ -248,6 +250,8 @@ const TWO_MAP_BETA: usize = 3;
248250
/// assert!(new_two_cell.contains(&d3));
249251
/// assert_eq!(new_two_cell.len(), 4);
250252
///
253+
/// # Ok(())
254+
/// # }
251255
/// ```
252256
///
253257
#[cfg_attr(feature = "benchmarking_utils", derive(Clone))]

honeycomb-guide/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- [Workspace](./project-structure/workspace.md)
88
- [honeycomb-core](./project-structure/honeycomb-core.md)
99
- [honeycomb-guide](./project-structure/honeycomb-guide.md)
10+
- [honeycomb-render](./project-structure/honeycomb-render.md)
1011
- [honeycomb-utils](./project-structure/honeycomb-utils.md)
1112

1213
# Definitions

honeycomb-guide/src/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ following line to the manifest of the project:
3131
[dependencies]
3232
# Other dependencies...
3333
honeycomb-core = { git = "https://github.com/LIHPC-Computational-Geometry/honeycomb.git" }
34+
honeycomb-utils = { git = "https://github.com/LIHPC-Computational-Geometry/honeycomb.git" }
35+
honeycomb-render = { git = "https://github.com/LIHPC-Computational-Geometry/honeycomb.git" }
3436
```
3537

36-
Optionally, you can add other member(s) of the workspace and specify which version to use.
37-
3838
#### Documentation
3939

4040
You can generate this documentation locally using **mdbook** and **cargo doc**:
@@ -50,6 +50,7 @@ cargo doc --all --no-deps
5050
### Documentation
5151

5252
- [honeycomb-core](honeycomb_core/) *Core definitions and tools*
53+
- [honeycomb-render](honeycomb_render/) *Visualization tool*
5354
- [honeycomb-utils](honeycomb_utils/) *Utility routines*
5455

5556
### References

honeycomb-guide/src/project-structure/honeycomb-core.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ representation.
1414
A quickstart example encompassing most features is provided for the following
1515
structures:
1616

17+
- [Coords2](../honeycomb_core/struct.Coords2.html#example)
1718
- [TwoMap](../honeycomb_core/twomap/struct.TwoMap.html#example)
1819

1920
## Content
@@ -22,6 +23,7 @@ structures:
2223

2324
- **TwoMap**: 2D combinatorial map implementation
2425
- **Coords2**: 2D coordinates implementation
26+
- **Orbit**: Generic 2D implementation for orbit computation
2527

2628
### Aliases
2729

@@ -33,15 +35,10 @@ structures:
3335

3436
### Enums
3537

38+
- **OrbitPolicy**: Orbit parameterization.
3639
- **SewPolicy**: Logic to follow for the geometrical part of the sewing operation.
3740
- **UnsewPolicy**: Logic to follow for the geometrical part of the unsewing operation.
3841

39-
## Future additions
42+
### Traits
4043

41-
- [x] Write structure benchmarks (2D) - done as of **0.1.1**
42-
- [x] Add a custom vector type for spatial representation (2D)
43-
- [x] Add orientation ~checks~ assertions (2D)
44-
- [ ] Replace returned `Vec` by an alternative structure or type
45-
to prevent too many runtime allocations.
46-
- [ ] Add I/O support for mesh formats (2D)
47-
- [ ] Implement 3D maps
44+
- **CoordsFloat**: Common trait implemented by types used for coordinate representation.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# honeycomb-render
2+
3+
[Documentation](../honeycomb_render/)
4+
5+
---
6+
7+
**honeycomb-render** is a Rust crate that provides a simple visualization framework
8+
to allow the user to render their combinatorial map. It is designed to be used
9+
directly in the code by reading data through a reference to the map (as opposed to
10+
a binary that would read serialized data).
11+
12+
## Usage
13+
14+
### Quickstart
15+
16+
Because this crate is meant to be used in tandem with other members of the workspace,
17+
no quickstart example is provided in the documentation. Instead, standalone examples
18+
provided in the crate cover basic usage and parameterization.
19+
20+
### Examples
21+
22+
You can run examples using the following command:
23+
24+
```shell
25+
# Run a specific example
26+
cargo run --example <EXAMPLE>
27+
```
28+
29+
The following examples are available:
30+
31+
| Name | Description |
32+
|-------------------------|----------------------------------------------------------------------------------|
33+
| `render_default_no_aa` | Render a hardcoded arrow without anti-aliasing |
34+
| `render_default_smaa1x` | Render a hardcoded arrow with anti-aliasing |
35+
| `render_splitsquaremap` | Render a map generated using functions provided by the **honeycomb-utils** crate |
36+
| `render_squaremap` | Render a map generated using functions provided by the **honeycomb-utils** crate |
37+
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
# Workspace
22

3-
The project root is organized using Cargo workspaces at
4-
the moment. This may change when other languages are
3+
The project root is organized using Cargo workspaces at
4+
the moment. This may change when other languages are
55
introduced to the project.
66

77
## Members
88

99
These entries are members of the Cargo workspace.
1010

1111
- [honeycomb-core](honeycomb-core.html) *Core definitions and tools for combinatorial map implementation*
12+
- [honeycomb-render](honeycomb-render.html) *Visualization tool for combinatorial map*
1213
- [honeycomb-utils](honeycomb-utils.html) *Utility routines used in benchmarking and testing*
1314

1415
## Others
1516

16-
These entries are additional sections that are not linked to
17-
the project through Cargo, most likely because they require a
17+
These entries are additional sections that are not linked to
18+
the project through Cargo, most likely because they require a
1819
different building process.
1920

2021
- [honeycomb-guide](honeycomb-guide.html) *Source files of the user guide*

0 commit comments

Comments
 (0)