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.
- 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)
The type for representing all types of curves.
The basic constructor for lines : a line is a degree 1 Bezier curve
A shortcut to define degree 3 Bezier curves from points. If the control
a,b,c,d, the function should be called with
bezier3 xa ya xb yb xc yc xd yd
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.
is a list of all possible points of intersection
inter c0 c1
c1 : if
(u,v,w,x) is returned by
c0 may intersect with
c1 between parameter values
v, which corresponds to parameter values between
c1. The implementation guarantees that all actual solutions are found,
but possibly false solutions may also be returned.
Gives the point corresponding to the given value of the parameter
Pseudo-distance from a point to a curve. Is the result is smaller than 1, the point is inside the curve. If it is greater than 1, the point is outside. Else we don't know (as usual with interval arithmetic).