Commentary in tearDropBrushFn

This commit is contained in:
sheaf 2024-04-24 01:47:01 +02:00
parent 32ce7c38bb
commit 17df43c5d7

View file

@ -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