- data Curve a
- zipCurve :: (x -> y -> z) -> Curve x -> Curve y -> Curve z
- iterateCurve :: Integer -> Curve x -> [x]
- transposeCurve :: Curve (Curve a) -> Curve (Curve a)
- curve :: (RSdouble -> a) -> Curve a
- data Surface a
- surface :: (RSdouble -> RSdouble -> a) -> Surface a
- wrapSurface :: Curve (Curve a) -> Surface a
- unwrapSurface :: Surface a -> Curve (Curve a)
- transposeSurface :: Surface a -> Surface a
- zipSurface :: (x -> y -> z) -> Surface x -> Surface y -> Surface z
- iterateSurface :: (Integer, Integer) -> Surface a -> [[a]]
- halfIterateSurface :: Integer -> Surface a -> [Curve a]
- flipTransposeSurface :: Surface a -> Surface a
- translateCurve :: RSdouble -> Curve a -> Curve a
- scaleCurve :: RSdouble -> Curve a -> Curve a
- clampCurve :: (RSdouble, RSdouble) -> Curve a -> Curve a
- loopCurve :: (RSdouble, RSdouble) -> Curve a -> Curve a
- controlCurve :: (RSdouble, RSdouble) -> (RSdouble, RSdouble) -> Curve a -> Curve a
- transformCurve2 :: (forall u. Curve u -> Curve u) -> (forall v. Curve v -> Curve v) -> Curve (Curve a) -> Curve (Curve a)
- uv_identity :: Surface (RSdouble, RSdouble)
- translateSurface :: (RSdouble, RSdouble) -> Surface a -> Surface a
- scaleSurface :: (RSdouble, RSdouble) -> Surface a -> Surface a
- transformSurface :: (Curve (Curve a) -> Curve (Curve a)) -> Surface a -> Surface a
- transformSurface2 :: (forall u. Curve u -> Curve u) -> (forall v. Curve v -> Curve v) -> Surface a -> Surface a
- surfaceDerivative :: (AbstractSubtract p v, AbstractScale v) => Surface p -> Surface (v, v)
- curveDerivative :: (AbstractSubtract p v, AbstractScale v) => Curve p -> Curve v
- orientationLoops :: Surface p -> Surface (Curve p)
- newellCurve :: Curve Point3D -> Maybe Vector3D
- surfaceNormals3D :: Surface Point3D -> Surface SurfaceVertex3D
- type SamplingAlgorithm a = Curve a -> [IntervalSample a]
- data IntervalSample a
- intervalRange :: IntervalSample a -> (RSdouble, RSdouble)
- intervalSize :: IntervalSample a -> RSdouble
- intervalSample :: Curve a -> RSdouble -> RSdouble -> IntervalSample a
- intervalSingleIntegral :: AbstractScale a => IntervalSample a -> a
- linearSamples :: Integer -> SamplingAlgorithm a
- adaptiveMagnitudeSamples :: AbstractMagnitude a => Integer -> SamplingAlgorithm a
- integrateCurve :: (AbstractAdd p v, AbstractScale v, AbstractZero p) => SamplingAlgorithm v -> Curve v -> p -> p

# Documentation

A `Curve`

is a parametric function from a one-dimensional space into a space of an arbitrary datatype. The key feature of a `Curve`

is that it is aware of it's own
sampling interval. Using this information and appropriate arithmetic and scalar multiplication functions provided by RSAGL.AbstractVector, a `Curve`

can be differentiated or integrated.

Functor Curve | |

Applicative Curve | |

NFData (Curve a) | |

AffineTransformable a => AffineTransformable (Curve a) |

zipCurve :: (x -> y -> z) -> Curve x -> Curve y -> Curve zSource

Combine two curves using an arbitrary function.

iterateCurve :: Integer -> Curve x -> [x]Source

Sample a curve at regular intervals in the range 0..1 inclusive.

transposeCurve :: Curve (Curve a) -> Curve (Curve a)Source

Transpose the inner and outer components of a curve.

wrapSurface :: Curve (Curve a) -> Surface aSource

unwrapSurface :: Surface a -> Curve (Curve a)Source

transposeSurface :: Surface a -> Surface aSource

Transpose the axes of a `Surface`

.

zipSurface :: (x -> y -> z) -> Surface x -> Surface y -> Surface zSource

Combine two surfaces using an arbitrary function.

iterateSurface :: (Integer, Integer) -> Surface a -> [[a]]Source

Sample a surface at regularly spaced lattice points in the range 0..1 inclusive.

halfIterateSurface :: Integer -> Surface a -> [Curve a]Source

flipTransposeSurface :: Surface a -> Surface aSource

Transpose a surface while flipping the inner curve, so that that orientable surfaces retain their original orientation.

translateCurve :: RSdouble -> Curve a -> Curve aSource

Translate a curve along the axis of the input parameter.

scaleCurve :: RSdouble -> Curve a -> Curve aSource

clampCurve :: (RSdouble, RSdouble) -> Curve a -> Curve aSource

Clamp lower and upper bounds of a curve along the axis of the input parameter.

loopCurve :: (RSdouble, RSdouble) -> Curve a -> Curve aSource

Loop a curve onto itself at the specified bounds.

controlCurve :: (RSdouble, RSdouble) -> (RSdouble, RSdouble) -> Curve a -> Curve aSource

Transform a curve by manipulating control points.

transformCurve2 :: (forall u. Curve u -> Curve u) -> (forall v. Curve v -> Curve v) -> Curve (Curve a) -> Curve (Curve a)Source

Lift two curve transformations onto each axis of a second order curve.

translateSurface :: (RSdouble, RSdouble) -> Surface a -> Surface aSource

Translate a surface over each of its input parameter axes, as translateCurve.

scaleSurface :: (RSdouble, RSdouble) -> Surface a -> Surface aSource

Scale a surface along each of its input parameter axes, as scaleCurve.

transformSurface :: (Curve (Curve a) -> Curve (Curve a)) -> Surface a -> Surface aSource

Lift a transformation on a second order `Curve`

onto a Surface.

transformSurface2 :: (forall u. Curve u -> Curve u) -> (forall v. Curve v -> Curve v) -> Surface a -> Surface aSource

Lift two curve transformations onto each axis of a Surface.

surfaceDerivative :: (AbstractSubtract p v, AbstractScale v) => Surface p -> Surface (v, v)Source

Take the piecewise derivative of a `Surface`

along the inner and outer curves.

curveDerivative :: (AbstractSubtract p v, AbstractScale v) => Curve p -> Curve vSource

Take the derivative of a `Curve`

.

orientationLoops :: Surface p -> Surface (Curve p)Source

Determine the orientation of a `Surface`

by passing very small circles centered on each sampled point as the parametric input.

A gotchya with this operation is that as much as 3/4ths of the orientation loop may lie outside of the 0..1 range that is normally
sampled. Depending on how the surface is constructed, this may produce unexpected results. The solution is to clamp the
the problematic parametric inputs at 0 and 1 using `clampSurface`

.

As a rule, do clamp longitudinal axes that come to a singularity at each end. Do not clamp latitudinal axes that are connected at each end.

surfaceNormals3D :: Surface Point3D -> Surface SurfaceVertex3DSource

Try to determine the normal vectors of a surface using multiple techniques.

type SamplingAlgorithm a = Curve a -> [IntervalSample a]Source

data IntervalSample a Source

An interval of a curve, including the curve, lower and upper bounds of the interval, and an instantaneous sample value for that interval.

intervalRange :: IntervalSample a -> (RSdouble, RSdouble)Source

Lower and upper bounds of an `IntervalSample`

.

intervalSize :: IntervalSample a -> RSdoubleSource

Size of the range of an `IntervalSample`

.

intervalSample :: Curve a -> RSdouble -> RSdouble -> IntervalSample aSource

intervalSingleIntegral :: AbstractScale a => IntervalSample a -> aSource

Integral of the sample value over the range of the `IntervalSample`

.

linearSamples :: Integer -> SamplingAlgorithm aSource

Sampling algorithm that takes a fixed count of samples.

adaptiveMagnitudeSamples :: AbstractMagnitude a => Integer -> SamplingAlgorithm aSource

Sampling algorithm that takes increasing numbers of samples over intervals where the magnitude of the sample is large.

integrateCurve :: (AbstractAdd p v, AbstractScale v, AbstractZero p) => SamplingAlgorithm v -> Curve v -> p -> pSource

Definite integral of a curve.