ExtrudeGeometry constructor

ExtrudeGeometry(
  1. ScenePath path, {
  2. required List<Vector2> profile,
  3. int stations = 64,
  4. bool caps = true,
  5. GeometryStorage storage = GeometryStorage.fixed,
})

Sweeps profile along path.

profile is a closed polygon of at least three points, in the path's normal/binormal plane. stations is the number of cross-sections along the path. With caps the two ends are closed. Pass GeometryStorage.updatable to allow updatePath.

Implementation

factory ExtrudeGeometry(
  ScenePath path, {
  required List<Vector2> profile,
  int stations = 64,
  bool caps = true,
  GeometryStorage storage = GeometryStorage.fixed,
}) {
  final copied = <Vector2>[for (final p in profile) p.clone()];
  return ExtrudeGeometry._(
    copied,
    stations,
    caps,
    buildExtrudeArrays(path, profile: copied, stations: stations, caps: caps),
    storage,
  );
}