gaps.jsAlgorithm for computing a useful set of measure lines between rectanglesTry the interactive demoLicensed under MIT License