Skip to content
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

Simplified mesh intersection logic #221

Merged
merged 48 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
598dda9
WIP simplified mesh interseciton logic
Jul 8, 2024
39f026d
Make mesh intersection code more robust
Jul 9, 2024
1781d71
Fixed logic errors and addet tests
Jul 11, 2024
7a1d967
add test data
Jul 11, 2024
c6e3adf
Hide wavefront functionality behind a feature flag
Jul 12, 2024
008517e
Merge remote-tracking branch 'origin/master' into improve_mesh_inters…
Jul 12, 2024
9a7b87a
Fix compilation errors
Jul 12, 2024
130d5f2
Fix CI
Jul 12, 2024
20502c5
Fix CI issues
Jul 12, 2024
b061752
Delete unused code
Jul 12, 2024
592455d
Simplift feature flag
Jul 12, 2024
4c7e50b
Fix PR comments
Jul 15, 2024
00577c5
Fix clippy issue
Jul 15, 2024
fdd2919
Remove accidental pastes
Jul 15, 2024
8416d1f
Fix compilation in no-std
Jul 15, 2024
fe57b27
Fix clippy
Jul 15, 2024
b001cc5
Fix Clippy
Jul 15, 2024
97c2b6c
Fix clippy
Jul 15, 2024
998dfcc
Address new PR comments
Jul 15, 2024
f8d272d
Make clippy happy
Jul 15, 2024
ff83f9d
Replace glob import with explicit items
Jul 15, 2024
a79b65a
Replace unwrap with error checking
Jul 15, 2024
5a1a187
Fix bug when finding smallest triangle angle
Jul 15, 2024
b155fbf
Fix spelling
Jul 15, 2024
e93a2cd
Update src/transformation/mesh_intersection/mesh_intersection.rs
Makogan Jul 16, 2024
9a227fb
Update src/shape/triangle.rs
Makogan Jul 16, 2024
0a18f4c
Update src/shape/triangle.rs
Makogan Jul 16, 2024
5b24476
Update src/transformation/mesh_intersection/mesh_intersection.rs
Makogan Jul 16, 2024
5d06a91
Update src/transformation/mesh_intersection/mesh_intersection.rs
Makogan Jul 16, 2024
d870f38
Update src/transformation/mesh_intersection/mesh_intersection.rs
Makogan Jul 16, 2024
cad8511
Update src/transformation/mesh_intersection/mesh_intersection.rs
Makogan Jul 16, 2024
5b20345
Update src/transformation/mesh_intersection/mesh_intersection.rs
Makogan Jul 16, 2024
2dd4e03
Update src/transformation/mesh_intersection/mesh_intersection.rs
Makogan Jul 16, 2024
a1e7f79
Update src/transformation/mesh_intersection/mesh_intersection.rs
Makogan Jul 16, 2024
0a19454
Update src/transformation/mesh_intersection/mesh_intersection.rs
Makogan Jul 16, 2024
46b1c75
Update src/transformation/mesh_intersection/mesh_intersection.rs
Makogan Jul 16, 2024
08038a0
Update src/transformation/mesh_intersection/mesh_intersection.rs
Makogan Jul 16, 2024
c514027
Update src/transformation/mesh_intersection/mesh_intersection.rs
Makogan Jul 16, 2024
773b949
Update comment
Jul 16, 2024
7501a0b
Merge branch 'improve_mesh_intersection_code' of https://github.com/M…
Jul 16, 2024
8193b70
Fix formatting
Jul 16, 2024
56856d0
chore: move test assets to assets/tests
sebcrozet Jul 17, 2024
e888e0d
chore: move angle_closest_to_90 as a method of Triangle
sebcrozet Jul 17, 2024
bb9447d
fix: re-add sanitization of spade point coordinates
sebcrozet Jul 17, 2024
fce4c30
chore: minor coding style fixes
sebcrozet Jul 17, 2024
1f5217a
chore: update changelog
sebcrozet Jul 17, 2024
0fc0e89
Merge remote-tracking branch 'origin/master' into improve_mesh_inters…
sebcrozet Jul 17, 2024
24b8b93
chore: more changelog update
sebcrozet Jul 17, 2024
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@

## Unreleased

### Added

- Add `Triangle::robust_scaled_normal` and `Triangle::robust_normal` as a more robust way to compute the triangles
normal for thin triangles that generally cause numerical instabilities.
- Add `Triangle::angle_closest_to_90` to find the triangle’s vertex with an angle closest to 90 degree.
- Add the `wavefront` feature that enables `TriMesh::to_obj_file` for exporting a mesh as an obj file.

### Modified

- `TypedShape::Custom(u32)` is now `TypedShape::Custom(&dyn Shape)`.
- Significantly improved the general stability of mesh/mesh intersection calculation.

## v0.16.1

Expand Down
195 changes: 195 additions & 0 deletions assets/tests/bar.obj
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
# Author: Camilo Talero
# License: CC0
v 0.467654 13.305400 -6.892637
v -0.550473 -3.651697 6.193181
v 0.451122 13.300038 -6.900873
v -0.567006 -3.657059 6.184945
v 0.436815 13.292733 -6.911451
v -0.581312 -3.664363 6.174367
v 0.425285 13.283769 -6.923967
v -0.592842 -3.673329 6.161853
v 0.416975 13.273486 -6.937937
v -0.601152 -3.683610 6.147883
v 0.412204 13.262284 -6.952824
v -0.605924 -3.694813 6.132995
v 0.411154 13.250590 -6.968058
v -0.606973 -3.706506 6.117761
v 0.413868 13.238854 -6.983053
v -0.604259 -3.718241 6.102765
v 0.420240 13.227530 -6.997232
v -0.597888 -3.729566 6.088586
v 0.430025 13.217050 -7.010054
v -0.588102 -3.740046 6.075767
v 0.442847 13.207818 -7.021019
v -0.575280 -3.749279 6.064799
v 0.458215 13.200187 -7.029711
v -0.559913 -3.756910 6.056108
v 0.475536 13.194451 -7.035795
v -0.542591 -3.762644 6.050025
v 0.494146 13.190835 -7.039036
v -0.523982 -3.766263 6.046782
v 0.513329 13.189469 -7.039310
v -0.504798 -3.767626 6.046510
v 0.532348 13.190415 -7.036608
v -0.485779 -3.766682 6.049212
v 0.550472 13.193629 -7.031031
v -0.467655 -3.763467 6.054788
v 0.567005 13.198991 -7.022795
v -0.451122 -3.758105 6.063024
v 0.581311 13.206296 -7.012217
v -0.436816 -3.750801 6.073602
v 0.592841 13.215261 -6.999702
v -0.425286 -3.741835 6.086116
v 0.601151 13.225543 -6.985735
v -0.416976 -3.731554 6.100085
v 0.605923 13.236745 -6.970846
v -0.412204 -3.720351 6.114974
v 0.606972 13.248439 -6.955610
v -0.411155 -3.708658 6.130208
v 0.604259 13.260175 -6.940615
v -0.413868 -3.696923 6.145204
v 0.597887 13.271499 -6.926435
v -0.420240 -3.685598 6.159383
v 0.588102 13.281980 -6.913616
v -0.430025 -3.675117 6.172202
v 0.575279 13.291211 -6.902651
v -0.442848 -3.665884 6.183169
v 0.559912 13.298842 -6.893957
v -0.458215 -3.658254 6.191861
v 0.542591 13.304578 -6.887875
v -0.475536 -3.652520 6.197946
v 0.523981 13.308194 -6.884634
v -0.494146 -3.648901 6.201186
v 0.504798 13.309560 -6.884359
v -0.513329 -3.647538 6.201461
v 0.485779 13.308614 -6.887062
v -0.532348 -3.648482 6.198758
# 64 vertices, 0 vertices normals

f 3 2 1
f 6 3 5
f 8 5 7
f 10 7 9
f 11 10 9
f 13 12 11
f 15 14 13
f 17 16 15
f 19 18 17
f 21 20 19
f 24 21 23
f 26 23 25
f 28 25 27
f 29 28 27
f 31 30 29
f 33 32 31
f 35 34 33
f 37 36 35
f 40 37 39
f 42 39 41
f 44 41 43
f 45 44 43
f 48 45 47
f 50 47 49
f 52 49 51
f 54 51 53
f 56 53 55
f 57 56 55
f 60 57 59
f 62 59 61
f 14 22 6
f 64 61 63
f 2 63 1
f 63 55 31
f 4 2 3
f 4 3 6
f 6 5 8
f 8 7 10
f 12 10 11
f 14 12 13
f 16 14 15
f 18 16 17
f 20 18 19
f 22 20 21
f 22 21 24
f 24 23 26
f 26 25 28
f 30 28 29
f 32 30 31
f 34 32 33
f 36 34 35
f 38 36 37
f 38 37 40
f 40 39 42
f 42 41 44
f 46 44 45
f 46 45 48
f 48 47 50
f 50 49 52
f 52 51 54
f 54 53 56
f 58 56 57
f 58 57 60
f 60 59 62
f 4 6 62
f 2 4 62
f 64 2 62
f 60 62 58
f 56 58 62
f 54 56 62
f 52 54 50
f 48 50 46
f 44 46 38
f 42 44 38
f 40 42 38
f 36 38 30
f 34 36 30
f 32 34 30
f 28 30 26
f 24 26 22
f 20 22 14
f 18 20 14
f 16 18 14
f 12 14 6
f 10 12 6
f 8 10 6
f 50 54 38
f 46 50 38
f 26 30 22
f 62 6 38
f 54 62 38
f 30 38 6
f 22 30 6
f 62 61 64
f 64 63 2
f 1 63 3
f 5 3 63
f 7 5 63
f 9 7 15
f 11 9 15
f 13 11 15
f 17 15 19
f 21 19 15
f 23 21 15
f 25 23 27
f 29 27 31
f 33 31 35
f 37 35 31
f 39 37 31
f 41 39 43
f 45 43 47
f 49 47 51
f 53 51 47
f 55 53 47
f 57 55 59
f 61 59 63
f 27 23 15
f 31 27 15
f 43 39 31
f 47 43 31
f 59 55 63
f 7 63 31
f 15 7 31
f 55 47 31
# 124 faces, 0 coords texture

# End of File
Loading