Skip to content

Commit c900f74

Browse files
committed
Re-export coarse_prof, update readmes and changelog
1 parent dc6ee32 commit c900f74

10 files changed

Lines changed: 42 additions & 14 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
## Version 0.3.0
22

33
- Move `vtkio` convenience trait implementations in `splashsurf_lib` behind a non-default feature flag (flag `vtk-extras`). Flag is enabled in the CLI crate.
4-
- Re-export `vtkio` from lib, use this from CLI
4+
- Re-export `vtkio` from lib if feature is enabled and use this from CLI
55
- Move `coarse_prof` usage in `splashsurf_lib` behind a non-default feature flag (flag `profiling`). Flag is enabled in the CLI crate.
6+
- Re-export `coarse_prof` from lib if feature is enabled and use this from CLI
67

78
## Version 0.2.0
89

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
# ![splashsurf logo](logos/logo_small.svg "splashsurf")
1+
# ![splashsurf logo](https://raw.githubusercontent.com/w1th0utnam3/splashsurf/master/logos/logo_small.svg "splashsurf")
22
[![On crates.io](https://img.shields.io/crates/v/splashsurf)](https://crates.io/crates/splashsurf)
33
[![On docs.rs](https://docs.rs/splashsurf_lib/badge.svg)](https://docs.rs/splashsurf_lib)
44
[![License: MIT](https://img.shields.io/crates/l/splashsurf)](https://github.com/w1th0utnam3/splashsurf/blob/master/LICENSE)
55
![Build and test GitHub Actions workflow](https://github.com/w1th0utnam3/splashsurf/workflows/Build%20and%20test/badge.svg)
66

7-
Surface reconstruction for particle data from SPH simulations, written in Rust.
7+
Surface reconstruction library and CLI for particle data from SPH simulations, written in Rust.
8+
9+
# The `splashsurf` CLI
10+
11+
The following sections mainly focus on the CLI of `splashsurf`. For more information on the library parts, see the [corresponding readme](https://github.com/w1th0utnam3/splashsurf/blob/master/splashsurf_lib/README.md) in the `splashsurf_lib` subfolder.
812

913
## Introduction
1014

@@ -128,7 +132,7 @@ With these parameters, a scene with 13353401 particles is reconstructed in nearl
128132

129133
## Input file formats
130134

131-
TODO: Document more details about the expected formats of supported file extensions
135+
*TODO: Document more details about the expected format of supported file extensions*
132136

133137
### Ply
134138

splashsurf/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ log = "0.4"
1919
fern = "0.6"
2020
chrono = "0.4"
2121
anyhow = "1.0"
22-
coarse-prof = "0.2"
2322
num = "0.3"
2423
rayon = "1.5"
2524
ply-rs = "0.1.3"

splashsurf/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
# ![splashsurf logo](logos/logo_small.svg "splashsurf")
1+
# ![splashsurf logo](https://raw.githubusercontent.com/w1th0utnam3/splashsurf/master/logos/logo_small.svg "splashsurf")
22
[![On crates.io](https://img.shields.io/crates/v/splashsurf)](https://crates.io/crates/splashsurf)
33
[![On docs.rs](https://docs.rs/splashsurf_lib/badge.svg)](https://docs.rs/splashsurf_lib)
44
[![License: MIT](https://img.shields.io/crates/l/splashsurf)](https://github.com/w1th0utnam3/splashsurf/blob/master/LICENSE)
55
![Build and test GitHub Actions workflow](https://github.com/w1th0utnam3/splashsurf/workflows/Build%20and%20test/badge.svg)
66

7-
Surface reconstruction for particle data from SPH simulations, written in Rust.
7+
Surface reconstruction library and CLI for particle data from SPH simulations, written in Rust.
8+
9+
# The `splashsurf` CLI
10+
11+
The following sections mainly focus on the CLI of `splashsurf`. For more information on the library parts, see the [corresponding readme](https://github.com/w1th0utnam3/splashsurf/blob/master/splashsurf_lib/README.md) in the `splashsurf_lib` subfolder.
812

913
## Introduction
1014

@@ -128,7 +132,7 @@ With these parameters, a scene with 13353401 particles is reconstructed in nearl
128132

129133
## Input file formats
130134

131-
TODO: Document more details about the expected formats of supported file extensions
135+
*TODO: Document more details about the expected format of supported file extensions*
132136

133137
### Ply
134138

splashsurf/src/io.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ use std::io::{BufWriter, Write};
33
use std::path::Path;
44

55
use anyhow::{anyhow, Context};
6-
use coarse_prof::profile;
76
use log::info;
8-
7+
use splashsurf_lib::coarse_prof::profile;
98
use splashsurf_lib::nalgebra::Vector3;
109
use splashsurf_lib::Real;
1110

splashsurf/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,6 @@ fn log_program_info() {
498498
/// Returns the coarse_prof::write output as a string
499499
fn coarse_prof_write_string() -> Result<String, anyhow::Error> {
500500
let mut buffer = Vec::new();
501-
coarse_prof::write(&mut buffer)?;
501+
splashsurf_lib::coarse_prof::write(&mut buffer)?;
502502
Ok(String::from_utf8_lossy(buffer.as_slice()).into_owned())
503503
}

splashsurf/src/reconstruction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use anyhow::{anyhow, Context};
2-
use coarse_prof::profile;
32
use log::info;
3+
use splashsurf_lib::coarse_prof::profile;
44
use splashsurf_lib::mesh::PointCloud3d;
55
use splashsurf_lib::{density_map, Index, Real};
66

splashsurf_lib/README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,23 @@ Library for surface reconstruction of SPH particle data
44
The library is mainly used by the `splashsurf` command-line tool which is [also available](https://crates.io/crates/splashsurf) on crates.io.
55

66
This readme is currently a placeholder that will be extended over time.
7-
For now, check the [GitHub repository](https://github.com/w1th0utnam3/splashsurf) for more information.
7+
For now, check the [GitHub repository](https://github.com/w1th0utnam3/splashsurf) for more information.
8+
9+
## Usage
10+
11+
*TODO: Describe main "entry points" of the library, parameters, inputs/outputs etc.*
12+
13+
The library re-exports `nalgebra` to avoid version conflicts for users of the library.
14+
15+
## Feature flags
16+
17+
By default none of the following features are enabled to reduce the dependencies introduced by this library. The following feature flags are available for `splashsurf_lib`:
18+
19+
- **vtk-extras**: Enables convenience traits and helper functions to convert the mesh types returned by the library to [`vtkio`](https://crates.io/crates/vtkio) data structures (in particular [`UnstructuredGridPiece`](https://docs.rs/vtkio/latest/vtkio/model/struct.UnstructuredGridPiece.html)) that can be used to easily write the meshes to VTK files (e.g. for viewing them with [Paraview](https://www.paraview.org/)). Check out the documentation of `vtkio` or the [corresponding io module](https://github.com/w1th0utnam3/splashsurf/blob/master/splashsurf/src/io/vtk_format.rs) of the `splashsurf` CLI for reference.
20+
- **profiling**: Enables profiling of the library using [`coarse-prof`](https://crates.io/crates/coarse-prof). Several functions in the library will use the [`profile!`](https://docs.rs/coarse-prof/latest/coarse_prof/macro.profile.html) macro with the function name as an argument to record their runtime. The user of the library can then obtain the profiling data using the functions provided by the `coarse-prof` crate. Note that profiling using this crate might reduce performance for surface reconstructions with a very small number of particles (i.e. only a few hundred).
21+
22+
For each of the features, `splashsurf_lib` re-exports the corresponding dependencies to avoid version conflicts for users of the library.
23+
24+
## The surface reconstruction procedure
25+
26+
*TODO: Describe the surface reconstruction "algorithm" implemented in this crate*

splashsurf_lib/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
//! Library for surface reconstruction using marching cubes for SPH particle data. Entry point is the [reconstruct_surface] function.
33
//!
44
5+
/// Re-export the version of coarse_prof used by this crate, if profiling is enabled
6+
#[cfg(feature = "profiling")]
7+
pub use coarse_prof;
58
/// Re-export the version of nalgebra used by this crate
69
pub use nalgebra;
710
/// Re-export the version of vtkio used by this crate, if vtk support is enabled

0 commit comments

Comments
 (0)