public function fill($windingRule = "nonzero") 
    {
        $polygonId = $this->edges->getNextPolygonId();
        $fillColor = ColorUtils::parse($this->fillStyle);
        
        foreach ($this->paths as $points) {
            $pointsCount = count($points);
            if ($pointsCount <= 2) {
                // Nothing to fill
                continue;
            }

            for ($i = 2; $i < $pointsCount; $i += 2) {
                $this->edges->add(new Edge(
                    $polygonId,
                    $points[$i - 2],
                    $points[$i - 1],
                    $points[$i],
                    $points[$i + 1],
                    $fillColor,
                    $windingRule));
            }
            
            // Close path
            if ($points[0] != $points[$pointsCount - 2] ||
                $points[1] != $points[$pointsCount - 1]
            ) {
                $this->edges->add(new Edge(
                    $polygonId,
                    $points[$pointsCount - 2],
                    $points[$pointsCount - 1],
                    $points[0],
                    $points[1],
                    $fillColor,
                    $windingRule));
            }
        }
    }