mirror of
https://gitlab.com/sheaf/metabrush.git
synced 2024-11-05 14:53:37 +00:00
Commentary in tearDropBrushFn
This commit is contained in:
parent
32ce7c38bb
commit
17df43c5d7
|
@ -207,14 +207,12 @@ tearDropBrushFn _ mkI =
|
|||
h = runD ( var @_ @k ( Fin 2 ) ) params
|
||||
mkPt :: Double -> Double -> D k ( I i rec ) ( I i ( ℝ 2 ) )
|
||||
mkPt x y
|
||||
-- 1. translate the teardrop so that the center of mass is at the origin
|
||||
-- 1. translate the teardrop so that the centre of mass is at the origin
|
||||
-- 2. scale the teardrop so that it has the requested width/height
|
||||
-- 3. rotate
|
||||
= let !x' = w `scaledBy` (x / tearWidth)
|
||||
!y' = ( h `scaledBy` ( ( y - tearCenter ) / tearHeight) )
|
||||
in
|
||||
x' *^ e_x
|
||||
^+^ y' *^ e_y
|
||||
-- 3. rotate (done separately)
|
||||
= let !x' = w `scaledBy` ( x / tearWidth )
|
||||
!y' = h `scaledBy` ( ( y - tearCenter ) / tearHeight )
|
||||
in x' *^ e_x ^+^ y' *^ e_y
|
||||
|
||||
in sequenceA $
|
||||
Spline { splineStart = mkPt 0 0
|
||||
|
|
Loading…
Reference in a new issue