// SPDX-License-Identifier: MIT
// Derived from Rough.js 4.0.4, Copyright (c) 2019 Preet Shihn.

package rough

import 

type dotFiller struct {
	helper renderHelper
}

func ( *dotFiller) ( []Point,  *ResolvedOptions) OpSet {
	 := *
	.CurveStepCount = 4
	.HachureAngle = 0
	.Roughness = 1
	 := polygonHachureLines(, &)
	return .dotsOnLines(, &)
}

func ( *dotFiller) ( []Line,  *ResolvedOptions) OpSet {
	 := make([]Op, 0)
	 := .HachureGap
	if  < 0 {
		 = .StrokeWidth * 4
	}
	 = math.Max(, 0.1)
	 := .FillWeight
	if  < 0 {
		 = .StrokeWidth / 2
	}
	for ,  := range  {
		 := lineLength()
		 :=  / 
		 := math.Ceil() - 1
		 := math.Atan(([1][1] - [0][1]) / ([1][0] - [0][0]))
		for  := 0.0;  < ; ++ {
			 :=  * ( + 1)
			 :=  * math.Sin()
			 :=  * math.Cos()
			 := Point{[0][0] - , [0][1] + }
			 := .helper.randOffsetWithRange([0]-/4, [0]+/4, )
			 := .helper.randOffsetWithRange([1]-/4, [1]+/4, )
			 := .helper.ellipse(, , , , )
			 = append(, .Ops...)
		}
	}
	return OpSet{Type: OpSetFillSketch, Ops: }
}