describe method

String describe()

One line naming the pair, the overlap, and the fix.

Implementation

String describe() {
  String label(Node? node, int? instance) {
    final name = node == null ? '(unnamed)' : "'${debugNodePath(node)}'";
    return instance == null ? name : '$name #$instance';
  }

  final where =
      '(${center.x.toStringAsFixed(1)}, ${center.y.toStringAsFixed(1)}, '
      '${center.z.toStringAsFixed(1)})';
  final gap = exact
      ? 'in one plane'
      : '${(separation * 1000).toStringAsFixed(1)} mm apart';
  return '${label(nodeA, instanceA)} and ${label(nodeB, instanceB)} '
      'overlap ${area.toStringAsFixed(2)} m² $gap at $where'
      '${hint == null ? '' : '. $hint'}';
}