From 17df43c5d77a7f375fa45241a88b815cc7ca9bb3 Mon Sep 17 00:00:00 2001 From: sheaf Date: Wed, 24 Apr 2024 01:47:01 +0200 Subject: [PATCH] Commentary in tearDropBrushFn --- brush-strokes/src/lib/Calligraphy/Brushes.hs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/brush-strokes/src/lib/Calligraphy/Brushes.hs b/brush-strokes/src/lib/Calligraphy/Brushes.hs index 4880b8c..a1d0b53 100644 --- a/brush-strokes/src/lib/Calligraphy/Brushes.hs +++ b/brush-strokes/src/lib/Calligraphy/Brushes.hs @@ -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