getAveragePointLocal method

Vector3 getAveragePointLocal([
  1. Vector3? target
])

Get an average of all the vertices position

Implementation

Vector3 getAveragePointLocal([Vector3? target]) {
  target ??= Vector3.zero();
  final verts = vertices;
  for (int i = 0; i < verts.length; i++) {
    target.add2(verts[i], target);
  }
  target.scale2(1 / verts.length, target);
  return target;
}