module Waterfall.Sweep
( sweep
) where
import Waterfall.Internal.Solid (Solid (..))
import Waterfall.Internal.Path (Path (..))
import Waterfall.TwoD.Internal.Shape (Shape (..))
import qualified OpenCascade.BRepOffsetAPI.MakePipe as MakePipe
import qualified OpenCascade.BRepBuilderAPI.MakeShape as MakeShape
import OpenCascade.Inheritance (upcast)
sweep :: Path -> Shape -> Solid
sweep :: Path -> Shape -> Solid
sweep (Path Acquire (Ptr Wire)
runThePath) (Shape Acquire (Ptr Shape)
runTheShape) = Acquire (Ptr Shape) -> Solid
Solid (Acquire (Ptr Shape) -> Solid) -> Acquire (Ptr Shape) -> Solid
forall a b. (a -> b) -> a -> b
$ do
Ptr Wire
path <- Acquire (Ptr Wire)
runThePath
Ptr Shape
shape <- Acquire (Ptr Shape)
runTheShape
Ptr MakePipe
builder <- Ptr Wire -> Ptr Shape -> Acquire (Ptr MakePipe)
MakePipe.fromWireAndShape Ptr Wire
path Ptr Shape
shape
Ptr MakeShape -> Acquire (Ptr Shape)
MakeShape.shape (Ptr MakePipe -> Ptr MakeShape
forall a b. SubTypeOf a b => Ptr b -> Ptr a
upcast Ptr MakePipe
builder)