{- ORMOLU_DISABLE -}
-- Implicit CAD. Copyright (C) 2011, Christopher Olah (chris@colah.ca)
-- Copyright (C) 2016 Julia Longtin (julial@turinglace.com)
-- Released under the GNU AGPLV3+, see LICENSE

module Graphics.Implicit.Export.Symbolic.Rebound3 (rebound3) where

import Prelude ((-), (+))
import Graphics.Implicit.Definitions(BoxedObj3, ℝ3)
import Linear ((^/))

-- | Slightly stretch the bounding box of an object, in order to
--   ensure that during mesh generation, there are no problems because
--   values are right at the edge.
rebound3 :: BoxedObj3 -> BoxedObj3
rebound3 :: BoxedObj3 -> BoxedObj3
rebound3 (Obj3
obj, (ℝ3
a,ℝ3
b)) =
    let
        d :: ℝ3
        d :: ℝ3
d = (ℝ3
b ℝ3 -> ℝ3 -> ℝ3
forall a. Num a => a -> a -> a
- ℝ3
a) ℝ3 -> ℝ -> ℝ3
forall (f :: * -> *) a.
(Functor f, Fractional a) =>
f a -> a -> f a
^/ 10
    in
        (Obj3
obj, (ℝ3
a ℝ3 -> ℝ3 -> ℝ3
forall a. Num a => a -> a -> a
- ℝ3
d, ℝ3
b ℝ3 -> ℝ3 -> ℝ3
forall a. Num a => a -> a -> a
+ ℝ3
d))