First, please quote your code with backticks.
It is unclear what your question is. Do you want an set of functions that calculates volumes for various objects? Multiple dispatch should be straightforward.
I don’t know what huber
and newton
are, but if they result in different volumes, then it is not particularly good design to have them in the same method, and if they don’t, I am not sure why you need them.
It is unclear why you need LogSegment
to be a macro. A function should be able to provide the same interface.