mirror of
https://gitlab.com/sheaf/metabrush.git
synced 2024-11-27 09:24:08 +00:00
remove traces & minor cleanups
This commit is contained in:
parent
326487942e
commit
f10fbd9810
|
@ -87,6 +87,7 @@ data D3𝔸1 v =
|
|||
, _D31_dxdxdx :: !( T v )
|
||||
}
|
||||
deriving stock ( Show, Eq, Functor, Foldable, Traversable, Generic, Generic1 )
|
||||
deriving anyclass NFData
|
||||
deriving Applicative
|
||||
via Generically1 D3𝔸1
|
||||
|
||||
|
@ -107,6 +108,7 @@ data D2𝔸2 v =
|
|||
, _D22_dxdx, _D22_dxdy, _D22_dydy :: !( T v )
|
||||
}
|
||||
deriving stock ( Show, Eq, Functor, Foldable, Traversable, Generic, Generic1 )
|
||||
deriving anyclass NFData
|
||||
deriving Applicative
|
||||
via Generically1 D2𝔸2
|
||||
|
||||
|
|
|
@ -82,8 +82,6 @@ import Math.Roots
|
|||
import Math.Linear
|
||||
( Mat22(..), ℝ(..), T(..) )
|
||||
|
||||
import Debug.Utils
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
-- | Parameters to the curve fitting algorithm.
|
||||
|
@ -147,8 +145,8 @@ fitSpline ( FitParameters {..} ) curveFn = go 0
|
|||
( bez, Max ( Arg max_sq_error t_split_0 ) )
|
||||
| subdiv >= maxSubdiv
|
||||
|| max_sq_error <= dist_tol ^ ( 2 :: Int )
|
||||
-> trace ( unlines [ "fitSpline: piece is OK", "t_min = " ++ show t_min, "start = " ++ show p, "start tgt = " ++ show tp, "t_max = " ++ show t_max, "end = " ++ show r, "end tgt = " ++ show tr ] )
|
||||
$ ( openCubicBezierCurveSpline () bez, ( FitTangent p tp :<| Seq.fromList ( map FitPoint qs ) ) :|> FitTangent r tr )
|
||||
-> -- trace ( unlines [ "fitSpline: piece is OK", "t_min = " ++ show t_min, "start = " ++ show p, "start tgt = " ++ show tp, "t_max = " ++ show t_max, "end = " ++ show r, "end tgt = " ++ show tr ] ) $
|
||||
( openCubicBezierCurveSpline () bez, ( FitTangent p tp :<| Seq.fromList ( map FitPoint qs ) ) :|> FitTangent r tr )
|
||||
| let
|
||||
t_split :: ℝ 1
|
||||
t_split = ℝ1 $ min ( 1 - dt ) $ max dt t_split_0
|
||||
|
|
|
@ -403,9 +403,7 @@ computeStrokeOutline fitParams ptParams toBrushParams brushFn spline@( Spline {
|
|||
mbOutline <- lift ( readSTRef cachedStrokeRef )
|
||||
case mbOutline of
|
||||
-- Cached fit data is available: use it.
|
||||
Just outline -> do
|
||||
tell outline
|
||||
pure ()
|
||||
Just outline -> tell outline
|
||||
-- No cached fit: compute the fit anew.
|
||||
Nothing -> do
|
||||
let
|
||||
|
|
Loading…
Reference in a new issue