docs: @Pure
  	public double getLength() {
  		if (this.length < 0) {
  			double segmentLength = 0;
  			for (final PointGroup group : groups()) {
  				Point2d previousPts = null;
  				for (final Point2d pts : group.points()) {
  					if (previousPts != null) {
  						segmentLength += previousPts.getDistance(pts);
  					}
  					previousPts = pts;
  				}
  			}
  			this.length = segmentLength;
  		}
  		return this.length;
  	}