Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Paths in 3D space.
This module exposes functions with the same names as Waterfall.TwoD.Path2D, and if used together they should be imported qualified.
Synopsis
- data Path
- line :: V3 Double -> V3 Double -> Path
- lineTo :: V3 Double -> V3 Double -> (V3 Double, Path)
- lineRelative :: V3 Double -> V3 Double -> (V3 Double, Path)
- arcVia :: V3 Double -> V3 Double -> V3 Double -> Path
- arcViaTo :: V3 Double -> V3 Double -> V3 Double -> (V3 Double, Path)
- arcViaRelative :: V3 Double -> V3 Double -> V3 Double -> (V3 Double, Path)
- bezier :: V3 Double -> V3 Double -> V3 Double -> V3 Double -> Path
- bezierTo :: V3 Double -> V3 Double -> V3 Double -> V3 Double -> (V3 Double, Path)
- bezierRelative :: V3 Double -> V3 Double -> V3 Double -> V3 Double -> (V3 Double, Path)
- pathFrom :: V3 Double -> [V3 Double -> (V3 Double, Path)] -> Path
- pathFromTo :: [V3 Double -> (V3 Double, Path)] -> V3 Double -> (V3 Double, Path)
Documentation
A Path in 3D Space
Under the hood, this is represented by an OpenCascade Wire
.
arcVia :: V3 Double -> V3 Double -> V3 Double -> Path Source #
Section of a circle based on three arguments, the start point, a point on the arc, and the endpoint
bezier :: V3 Double -> V3 Double -> V3 Double -> V3 Double -> Path Source #
Bezier curve of order 3
The arguments are, the start of the curve, the two control points, and the end of the curve
pathFrom :: V3 Double -> [V3 Double -> (V3 Double, Path)] -> Path Source #
When combining paths, we're generally interested in pairs of paths that share a common endpoint.
Rather than having to repeat these common endpoints, pathFrom
can be used to combine a list of path components.
Where a path component is a function from a start point, to a tuple of an end point, and a path; V2 Double -> (V2 Double, Path2D)
.
A typical use of pathFrom
uses a list of functions with the suffix "To" or "Relative", e.g:
Path.pathFrom zero [ Path.bezierRelative (V3 0 0 0.5) (V3 0.5 0.5 0.5) (V3 0.5 0.5 1) , Path.bezierRelative (V3 0 0 0.5) (V3 (-0.5) (-0.5) 0.5) (V3 (-0.5) (-0.5) 1) , Path.arcViaRelative (V3 0 1 1) (V3 0 2 0) , Path.lineTo (V3 0 2 0) ]