FabricSimulation constructor

FabricSimulation({
  1. required double width,
  2. required double height,
  3. required int cols,
  4. required int rows,
  5. double tearRatio = 3.2,
  6. double pinBreakRatio = 2.0,
})

Implementation

FabricSimulation({
  required this.width,
  required this.height,
  required this.cols,
  required this.rows,
  this.tearRatio = 3.2,
  this.pinBreakRatio = 2.0,
})  : assert(cols >= 3 && rows >= 3),
      assert(cols * rows <= 65535) {
  _generateGrid();
}