Skip to content

Commit e148b9b

Browse files
committed
Improve sweep-line triangulation
1 parent c84648b commit e148b9b

35 files changed

+1994
-830
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
/target
22
/target-bin
33
bench_results.jl
4+
bench_results.jl.back
45
graph.png
6+
flamegraph.svg
7+
*.old
8+
*.data

Cargo.lock

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

Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ license = "MIT OR Apache-2.0"
1010
readme = "README.md"
1111
repository = "https://github.com/bevy-procedural/modelling"
1212
documentation = "https://docs.rs/procedural_modelling"
13-
rust-version = "1.81.0"
13+
rust-version = "1.80.0"
1414
include = [
1515
"src/**/*",
1616
"doc/**/*",
@@ -61,6 +61,7 @@ ab_glyph = { version = "0.2.29", optional = true }
6161
nalgebra = { version = "0.33.0", optional = true }
6262
num-traits = "0.2.19"
6363
criterion = { version = "0.5.1", features = ["html_reports"], optional = true }
64+
web-sys = "0.3.72"
6465

6566
[features]
6667
default = ["nalgebra", "netsci", "fonts"]
@@ -105,3 +106,7 @@ inherits = "release"
105106
opt-level = "z"
106107
lto = "fat"
107108
codegen-units = 1
109+
110+
[profile.profiling]
111+
inherits = "release"
112+
debug = true

README.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -213,25 +213,10 @@ The package supports different triangulation algorithms. The robustness and rend
213213
- **Heuristic** Heuristic algorithm that tries to find a compromise between the speed of `Sweep` and the quality of `MinWeight`.
214214
- **Auto** (default) Automatically choose the "best" algorithm based on the input. The edge-weight will be the same as Delaunay or better. Uses specialized fast implementations for small polygons to quickly generate min-weight triangulations. Falls back to Delaunay for larger polygons.
215215

216-
<!--
217-
| Algorithm | Requirements | Worst Case | Circle 10 | Circle 100 | Circle 1000 | Circle 10000 | ZigZag 1000 | ZigZag 10000 |
218-
| ------------ | ------------ | ---------- | ---------------- | ------------------ | ----------------- | ----------------- | ------------------ | ----------------- |
219-
| Fan | Convex | $n$ | 0.258µs (195fps) | 2.419µs¹ (154fps)² | 71.0µs (52.4fps) | 161.8µs (15.7fps) | - | - |
220-
| EarClipping | Simple | $n^2$ | 0.746µs (196fps) | 21.75µs (155fps) | 1.746ms (70.8fps) | 3.276s (15.9fps) | 49.10ms (77.1fps) | 46.03s (17.3fps) |
221-
| Sweep | None | $n \log n$ | 1.584µs (196fps) | 13.58µs (161fps) | 142.4µs (73.4fps) | 1.556ms (15.6fps) | 402.3µs (77.3fps) | 4.334ms (17.2fps) |
222-
| Delaunay | Simple | $n \log n$ | 2.778µs (194fps) | 29.89µs (178fps) | 308.5µs (178fps) | 3.296ms (172fps) | 3.002ms (77.0fps) | 158.7ms (17.2fps) |
223-
| EdgeFlip | Simple | $n^3$ | | | | | |
224-
| SweepDynamic | Simple | $n^3$ | 4.087µs (196fps) | 2.320ms (181fps) | 1.817s (177fps) | | 684.74µs (77.3fps) | 7.550ms (17.2fps) |
225-
| MinWeight | Simple | $n^3$ | 4.087µs (196fps) | 2.320ms (181fps) | 1.817s (177fps) | | | |
226-
| Heuristic | Simple | $n \log n$ | | | | | |
227-
| Auto | Simple | $n \log n$ | | | | | |
228-
-->
229-
230216
<img src="assets/fps_vs_render.svg" alt="FPS Boxplot" width="800"/>
231217

232218
- Time for the triangulation on a Intel i7-12700K (single threaded). Run the benchmarks using `cargo bench --features benchmarks --profile release`.
233219
- FPS when rendering 100 large, transparent instances with the bevy 0.14.2 pbr shader on a Nvidia GeForce RTX 4060 Ti in Full HD. See `cargo run -p fps_bench --profile release` and `julia --project=./playground/fps_bench/FPSBench ./playground/fps_bench/FPSBench/src/main.jl`. For the non-Delaunay algorithms, the rendering time deteriorates for the larger circles since the edge length is not minimized causing significant overdraw.
234-
- The `Delaunay` algorithm is currently significantly slowed down due to a inefficient algorithm for the interior detection. This will be fixed in the future.
235220

236221
## Supported Bevy Versions
237222

0 commit comments

Comments
 (0)