Open knuesel opened 3 years ago
Good point!
Do we need a generic method for N>3?
Probably not :D Sounds like a good case for only specializing on 2 & 3 .
Looks like the negative area was intentional:
Should we leave it like this (and document it)?
Oh, good catch :D Yeah, I guess the area function is mostly used inside GeometryBasics to figure out the winding order.
I made the PR for the doc change, but it is a bit inconsistent to return a signed area for 2D an a positive area for 3D... Instead, we could have area
return always a positive value, and a new oriented_area
that returns a signed value for 2D and a vector for 3D?
For example:
The relevant
area
method is here: https://github.com/JuliaGeometry/GeometryBasics.jl/blob/24d0ee53b0d2ff3eca5bc3a8c864ad53d534df76/src/triangulation.jl#L36I think there are two issues with this method:
cross
exists and returns a scalar.abs
call on the result.Regarding the first point: there's already a specific method for N=3, and we can make one for N=2. Do we need a generic method for N>3?