Meshes.jl icon indicating copy to clipboard operation
Meshes.jl copied to clipboard

Measure of CylinderSurface assumes right-cylinder

Open mikeingold opened this issue 5 months ago • 0 comments

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.

mikeingold avatar Feb 20 '24 22:02 mikeingold