{-# LANGUAGE DerivingVia #-}
{-# OPTIONS_HADDOCK not-home #-}
module Waterfall.TwoD.Internal.Path2D
( Path2D (..)
) where

import Waterfall.Internal.Path.Common (RawPath (..))

-- | A Path in 2D Space 
--
-- Under the hood, this is represented by an OpenCascade `TopoDS.Wire`, constrained to the plane \(z=0\).
--
-- Please feel free to report a bug if you're able to construct a `Path2D`
-- which does not lie on this plane (without using Internal functions).
--
-- The monoid instance  Joins `Path2D`s, @ a <> b @ connects the end point of @ a @ to the start of @ b @, if these points are not coincident, a line is created between them.
newtype Path2D = Path2D { Path2D -> RawPath
rawPath :: RawPath } deriving (NonEmpty Path2D -> Path2D
Path2D -> Path2D -> Path2D
(Path2D -> Path2D -> Path2D)
-> (NonEmpty Path2D -> Path2D)
-> (forall b. Integral b => b -> Path2D -> Path2D)
-> Semigroup Path2D
forall b. Integral b => b -> Path2D -> Path2D
forall a.
(a -> a -> a)
-> (NonEmpty a -> a)
-> (forall b. Integral b => b -> a -> a)
-> Semigroup a
$c<> :: Path2D -> Path2D -> Path2D
<> :: Path2D -> Path2D -> Path2D
$csconcat :: NonEmpty Path2D -> Path2D
sconcat :: NonEmpty Path2D -> Path2D
$cstimes :: forall b. Integral b => b -> Path2D -> Path2D
stimes :: forall b. Integral b => b -> Path2D -> Path2D
Semigroup, Semigroup Path2D
Path2D
Semigroup Path2D =>
Path2D
-> (Path2D -> Path2D -> Path2D)
-> ([Path2D] -> Path2D)
-> Monoid Path2D
[Path2D] -> Path2D
Path2D -> Path2D -> Path2D
forall a.
Semigroup a =>
a -> (a -> a -> a) -> ([a] -> a) -> Monoid a
$cmempty :: Path2D
mempty :: Path2D
$cmappend :: Path2D -> Path2D -> Path2D
mappend :: Path2D -> Path2D -> Path2D
$cmconcat :: [Path2D] -> Path2D
mconcat :: [Path2D] -> Path2D
Monoid) via RawPath