describe method

String describe({
  1. int limit = 8,
})

A short report for a log or an agent: a summary line and the largest limit pairs.

Implementation

String describe({int limit = 8}) {
  String? untestedLine;
  if (untested.isNotEmpty) {
    final names = [
      for (final node in untested.take(limit)) "'${debugNodePath(node)}'",
      if (untested.length > limit) '${untested.length - limit} more',
    ].join(', ');
    untestedLine =
        '${untested.length} blended or custom-cutout '
        'node${untested.length == 1 ? '' : 's'} went untested ($names).';
  }
  if (conflicts.isEmpty) {
    return [
      'No depth conflicts in a ${width}x$height probe.',
      ?untestedLine,
    ].join('\n');
  }
  final lines = [
    '${conflicts.length} depth conflict${conflicts.length == 1 ? '' : 's'} '
        'over ${(conflictFraction * 100).toStringAsFixed(2)}% of a '
        '${width}x$height probe. Surfaces that overlap in one plane fight '
        'at any distance; separate them, make repeated pieces abut, or give '
        'the one that belongs on top a higher Material.depthLayer.',
    for (final conflict in conflicts.take(limit)) '  ${conflict.describe()}',
    if (conflicts.length > limit) '  and ${conflicts.length - limit} more',
    ?untestedLine,
  ];
  return lines.join('\n');
}