mirror of
https://gitlab.com/sheaf/metabrush.git
synced 2024-11-27 09:24:08 +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
|
h = runD ( var @_ @k ( Fin 2 ) ) params
|
||||||
mkPt :: Double -> Double -> D k ( I i rec ) ( I i ( ℝ 2 ) )
|
mkPt :: Double -> Double -> D k ( I i rec ) ( I i ( ℝ 2 ) )
|
||||||
mkPt x y
|
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
|
-- 2. scale the teardrop so that it has the requested width/height
|
||||||
-- 3. rotate
|
-- 3. rotate (done separately)
|
||||||
= let !x' = w `scaledBy` (x / tearWidth)
|
= let !x' = w `scaledBy` ( x / tearWidth )
|
||||||
!y' = ( h `scaledBy` ( ( y - tearCenter ) / tearHeight) )
|
!y' = h `scaledBy` ( ( y - tearCenter ) / tearHeight )
|
||||||
in
|
in x' *^ e_x ^+^ y' *^ e_y
|
||||||
x' *^ e_x
|
|
||||||
^+^ y' *^ e_y
|
|
||||||
|
|
||||||
in sequenceA $
|
in sequenceA $
|
||||||
Spline { splineStart = mkPt 0 0
|
Spline { splineStart = mkPt 0 0
|
||||||
|
|
Loading…
Reference in a new issue