Meshes.jl
Meshes.jl copied to clipboard
Measure of CylinderSurface assumes right-cylinder
The CylinderSurface
type currently imposes no requirement that the top and bottom planes be parallel.
https://github.com/JuliaGeometry/Meshes.jl/blob/82f5921d94742ee082f1fcecc5af49b10ceccae0/src/primitives/cylindersurface.jl#L27-L31
However, the current measure
method for this type seems to assume that isright(c)
is true. The following expression seems to be mathematically-equivalent to $(2\pi r ) h + 2 (\pi r^2)$, i.e. the cylinder walls plus two circular disks.
https://github.com/JuliaGeometry/Meshes.jl/blob/82f5921d94742ee082f1fcecc5af49b10ceccae0/src/measures.jl#L53-L58
As discussed on Zulip, ongoing work in MeshIntegrals.jl may be able to calculate the measure
for the general case here, but isn't currently ready for prime-time. A short-term fix might be to check isright
and generate an error condition otherwise, unless somebody can whip-up a closed-form expression for this general case, but I'm not sure how Meshes users feel about not-implemented-style errors.