This repository was archived by the owner on Nov 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
add area and volume calculations #144
Merged
SimonDanisch
merged 9 commits into
JuliaGeometry:master
from
BeastyBlacksmith:add_algorithms
Oct 17, 2019
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c28f3e9
add area calculation
BeastyBlacksmith 50a45fd
add volume calculation
BeastyBlacksmith 538a84c
Merge branch 'master' into bbs/vol_area
dfdb57b
simpler test-case
89a4fab
Merge branch 'bbs/vol_area' into add_algorithms
27a45db
remove sphere-file
8b39b5d
correct test
2d192e2
rename normal, change docstrings
BeastyBlacksmith 0743270
rename
BeastyBlacksmith File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Test, GeometryTypes | ||
|
||
@testset "algorithms.jl" begin | ||
cube = HyperRectangle(Vec3f0(-0.5), Vec3f0(1)) | ||
cube_faces = decompose(Face{3,Int}, Face{4, Int}[ | ||
(1,3,4,2), | ||
(2,4,8,6), | ||
(4,3,7,8), | ||
(1,5,7,3), | ||
(1,2,6,5), | ||
(5,6,8,7), | ||
]) | ||
cube_vertices = decompose(Point{3,Float32}, cube) |> Array | ||
@test area( cube_vertices, cube_faces ) == 6 | ||
@test volume( cube_vertices, cube_faces ) ≈ 1 | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't call this
normal
, as the actual normal is the normalized version of this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
too much of a pun, if I name it
unnormal
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
edge_cross_product
maybe? Personally I'd probably just keep it as a local function inside the other ones. Even though you'd have the same code twice then...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re: Silly names. What about
normal_times_twice_the_area
? 🤓There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe something like
orthogonal_vector
?