Safe Haskell | None |
---|---|
Language | Haskell98 |
This module contains the basic functions for manipulating Bezier curves. It is heavily based on the book by N. M. Patrikalakis and T. Maekawa, Shape Interrogation for Computer Aided Design and Manufacturing.
Synopsis
- data Curve
- line :: Double -> Double -> Double -> Double -> Curve
- bezier3 :: Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Curve
- offset :: Matrix2 Double -> Curve -> [Curve]
- inter :: Curve -> Curve -> [(Double, Double, Double, Double)]
- evalCurve :: Curve -> Interval -> (Interval, Interval)
- distance :: Interval -> Interval -> Curve -> Interval
- left :: Curve -> (Double, Double)
- bottom :: Curve -> (Double, Double)
- right :: Curve -> (Double, Double)
- top :: Curve -> (Double, Double)
Documentation
The type for representing all types of curves.
line :: Double -> Double -> Double -> Double -> Curve Source #
The basic constructor for lines : a line is a degree 1 Bezier curve
bezier3 :: Double -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Curve Source #
A shortcut to define degree 3 Bezier curves from points. If the control
points are a,b,c,d
, the function should be called with
.bezier3
xa ya xb yb xc yc xd yd
offset :: Matrix2 Double -> Curve -> [Curve] Source #
Offsets a given Bezier curve with the given pen matrix. The original pen is a circle of radius one, the matrix, if inversible, is applied to it.
inter :: Curve -> Curve -> [(Double, Double, Double, Double)] Source #
is a list of all possible points of intersection
between curves inter
c0 c1c0
and c1
: if (u,v,w,x)
is returned by inter
,
then curve c0
may intersect with c1
between parameter values u
and v
, which corresponds to parameter values between w
and x
for
c1
. The implementation guarantees that all actual solutions are found,
but possibly false solutions may also be returned.
evalCurve :: Curve -> Interval -> (Interval, Interval) Source #
Gives the point corresponding to the given value of the parameter