world.distance() will not calculate distances correctly if e.g. planes are defined with negative lengths.
Since this does not make that much sense anyhow we should introduce checks at the time of structure definition.
Alternatively we could work over the distance calculation functions, but that probably will be more work.