{-|
Paths in 3D space.
-}
module Waterfall.Path
( Path
, module Waterfall.Path.Common
, fromPath2D
-- $ reexports
, line3D
, lineTo3D
, lineRelative3D
, arcVia3D
, arcViaTo3D
, arcViaRelative3D
, bezier3D
, bezierTo3D
, bezierRelative3D
, pathFrom3D
, pathFromTo3D
) where

import Waterfall.Internal.Path (Path(..))


import Waterfall.Path.Common
import Waterfall.TwoD.Internal.Path2D (Path2D (..))
import Linear (V3)

-- | convert a `Path2D` into a `Path` on the \( xy \) plane (with \( z = 0 \) )
fromPath2D :: Path2D -> Path
fromPath2D :: Path2D -> Path
fromPath2D (Path2D Ptr Wire
raw) = Ptr Wire -> Path
Path Ptr Wire
raw

-- $reexports
--
-- reexports from Waterfall.Path.Common, but monomorphised

-- | `line`, with the type fixed to `Path`
line3D :: V3 Double -> V3 Double -> Path
line3D :: V3 Double -> V3 Double -> Path
line3D = V3 Double -> V3 Double -> Path
forall point path. AnyPath point path => point -> point -> path
line 

-- | `lineTo`, with the type fixed to `Path`
lineTo3D :: V3 Double -> V3 Double -> (V3 Double, Path)
lineTo3D :: V3 Double -> V3 Double -> (V3 Double, Path)
lineTo3D = V3 Double -> V3 Double -> (V3 Double, Path)
forall point path.
AnyPath point path =>
point -> point -> (point, path)
lineTo

-- | `lineRelative`, with the type fixed to `Path`
lineRelative3D :: V3 Double -> V3 Double -> (V3 Double, Path)
lineRelative3D :: V3 Double -> V3 Double -> (V3 Double, Path)
lineRelative3D = V3 Double -> V3 Double -> (V3 Double, Path)
forall point path.
(AnyPath point path, Num point) =>
point -> point -> (point, path)
lineRelative

-- | `arcVia`, with the type fixed to `Path`
arcVia3D :: V3 Double -> V3 Double -> V3 Double -> Path
arcVia3D :: V3 Double -> V3 Double -> V3 Double -> Path
arcVia3D = V3 Double -> V3 Double -> V3 Double -> Path
forall point path.
AnyPath point path =>
point -> point -> point -> path
arcVia

-- | `arcViaTo`, with the type fixed to `Path`
arcViaTo3D :: V3 Double -> V3 Double -> V3 Double -> (V3 Double, Path)
arcViaTo3D :: V3 Double -> V3 Double -> V3 Double -> (V3 Double, Path)
arcViaTo3D = V3 Double -> V3 Double -> V3 Double -> (V3 Double, Path)
forall point path.
AnyPath point path =>
point -> point -> point -> (point, path)
arcViaTo

-- | `arcViaRelative`, with the type fixed to `Path`
arcViaRelative3D :: V3 Double -> V3 Double -> V3 Double -> (V3 Double, Path)
arcViaRelative3D :: V3 Double -> V3 Double -> V3 Double -> (V3 Double, Path)
arcViaRelative3D = V3 Double -> V3 Double -> V3 Double -> (V3 Double, Path)
forall point path.
(AnyPath point path, Num point) =>
point -> point -> point -> (point, path)
arcViaRelative

-- | `bezier`, with the type fixed to `Path`
bezier3D :: V3 Double -> V3 Double -> V3 Double -> V3 Double ->  Path
bezier3D :: V3 Double -> V3 Double -> V3 Double -> V3 Double -> Path
bezier3D = V3 Double -> V3 Double -> V3 Double -> V3 Double -> Path
forall point path.
AnyPath point path =>
point -> point -> point -> point -> path
bezier

-- | `bezierTo`, with the type fixed to `Path`
bezierTo3D :: V3 Double -> V3 Double -> V3 Double -> V3 Double ->  (V3 Double, Path)
bezierTo3D :: V3 Double
-> V3 Double -> V3 Double -> V3 Double -> (V3 Double, Path)
bezierTo3D = V3 Double
-> V3 Double -> V3 Double -> V3 Double -> (V3 Double, Path)
forall point path.
AnyPath point path =>
point -> point -> point -> point -> (point, path)
bezierTo

-- | `bezierRelative`, with the type fixed to `Path`
bezierRelative3D :: V3 Double -> V3 Double -> V3 Double -> V3 Double ->  (V3 Double, Path)
bezierRelative3D :: V3 Double
-> V3 Double -> V3 Double -> V3 Double -> (V3 Double, Path)
bezierRelative3D = V3 Double
-> V3 Double -> V3 Double -> V3 Double -> (V3 Double, Path)
forall point path.
(AnyPath point path, Num point) =>
point -> point -> point -> point -> (point, path)
bezierRelative

-- | `pathFrom`, with the type fixed to `Path`
pathFrom3D :: V3 Double -> [V3 Double -> (V3 Double, Path)] -> Path
pathFrom3D :: V3 Double -> [V3 Double -> (V3 Double, Path)] -> Path
pathFrom3D = V3 Double -> [V3 Double -> (V3 Double, Path)] -> Path
forall path point.
Monoid path =>
point -> [point -> (point, path)] -> path
pathFrom

-- | `pathFromTo`, with the type fixed to `Path`
pathFromTo3D :: [V3 Double -> (V3 Double, Path)] -> V3 Double -> (V3 Double, Path)
pathFromTo3D :: [V3 Double -> (V3 Double, Path)] -> V3 Double -> (V3 Double, Path)
pathFromTo3D = [V3 Double -> (V3 Double, Path)] -> V3 Double -> (V3 Double, Path)
forall path point.
Monoid path =>
[point -> (point, path)] -> point -> (point, path)
pathFromTo