/// <summary> /// Generates panels with provided parameters. /// Result will be saved inside this service object. /// </summary> public void Generate(float length, float width, float tilt, float rowSpacing, float columnSpacing) { _panels = new List <Panel>(); _rowSpacing = rowSpacing; _columnSpacing = columnSpacing; var minPoint = _buildZone.MinPoint(); var maxPoint = _buildZone.MaxPoint(); for (var x = minPoint.X; x < maxPoint.X; x = x + 1) { for (var y = minPoint.Y; y < maxPoint.Y; y = y + 1) { var panel = new Panel() { TopRightCorner = new FloatPoint(x, y), Length = length, Width = width, Tilt = tilt }; if (IsValid(panel)) { _panels.Add(panel); y += panel.GetTiltedHeight(); } } } }