MaLiang
MaLiang copied to clipboard
Smaller brush is darker than larger brush
Some significant issue with opacity calculation, blending mode or overlapping? It should be exactly the same color.
related #82
https://www.wolframalpha.com/input/?i=area+of+symmetric+lens
probably this should help with calculating overlaps
let n = Int(brush!.pointSize / brush!.pointStep)
let overlapMultiplier = Array(1...n).map { (el: Int) -> CGFloat in
let d = brush!.pointStep * CGFloat(el) / brush!.pointSize // normalised distance between point centers
let gendia = sqrt(4.0 - d*d )
return CGFloat.pi - d/2.0 * gendia - 2.0 * atan(d/gendia)
}.reduce(0, +)
@Harley-xk I used this code and it seems to provide more consistent result.
Nevermind, my bad, it's pretty much the same.