Safe Haskell | None |
---|---|

Language | Haskell2010 |

- binomial :: Integral a => a -> a -> a
- size :: (Additive f, Floating a, Foldable f) => f a -> a
- spanId :: (Ord a, Num a) => a -> Span a -> a
- spanEmpty :: Eq a => Span a -> Bool
- spanLength :: Num a => Span a -> a
- inSpan :: Ord a => a -> Span a -> Bool
- grow :: (Ord a, Fractional a) => a -> Span a -> a
- fall :: (Ord a, Fractional a) => a -> Span a -> a
- coords :: (Eq a, Fractional a) => Span a -> Iso' a a
- rangeSpan :: [a] -> Span a
- mergeSpan :: Ord a => Span a -> Span a -> Span a
- knotSpans :: Num a => Int -> [a] -> [Span a]
- growSpans :: Num a => Int -> [a] -> [Span a]
- fallSpans :: Num a => Int -> [a] -> [Span a]
- dataSpan :: (Eq a, Fractional a) => Lens' (KnotData a) (Span a)
- makeData :: (Ord a, Num a) => [a] -> a -> KnotData a
- iterData :: (Ord a, Fractional a) => KnotData a -> KnotData a
- evalData :: (Ord a, Fractional a) => Int -> KnotData a -> KnotData a
- basis :: (Ord a, Fractional a) => [a] -> Int -> Int -> a -> a
- rbasis :: (Ord a, Fractional a) => [a] -> [a] -> Int -> Int -> a -> a
- eval :: (Additive f, Ord a, Fractional a) => NURBS f a -> a -> f a
- uniformKnot :: Fractional a => Int -> Int -> [a]
- cycleKnot :: Fractional a => Int -> [a]
- periodic :: Fractional a => Lens' (NURBS f a) Bool
- degree :: Fractional a => Lens' (NURBS f a) Int
- wpoints :: Fractional a => Lens (NURBS f a) (NURBS g a) [Weight f a] [Weight g a]
- points :: (Additive f, Additive g, Fractional a) => Traversal (NURBS f a) (NURBS g a) (f a) (g a)
- knotVector :: Eq a => Lens' (NURBS f a) [a]
- iknotVector :: (Eq a, Fractional a) => Lens' (NURBS f a) [a]
- knotSpan :: (Eq a, Fractional a) => Lens' (NURBS f a) (Span a)
- normalizeKnot :: (Eq a, Fractional a) => NURBS f a -> NURBS f a
- nurbs :: (Additive f, Fractional a) => Int -> [f a] -> NURBS f a
- wnurbs :: (Additive f, Fractional a) => Int -> [Weight f a] -> NURBS f a
- insertKnot :: (Additive f, Ord a, Fractional a) => a -> NURBS f a -> NURBS f a
- insertKnots :: (Additive f, Ord a, Fractional a) => [(Int, a)] -> NURBS f a -> NURBS f a
- appendPoint :: (Eq a, Fractional a) => a -> Weight f a -> NURBS f a -> NURBS f a
- prependPoint :: (Eq a, Fractional a) => a -> Weight f a -> NURBS f a -> NURBS f a
- split :: (Additive f, Ord a, Fractional a) => a -> NURBS f a -> (NURBS f a, NURBS f a)
- cut :: (Additive f, Ord a, Fractional a) => Span a -> NURBS f a -> NURBS f a
- breakLoop :: (Additive f, Ord a, Fractional a) => a -> NURBS f a -> NURBS f a
- removeKnot :: (Foldable f, Additive f, Ord a, Floating a, SimEq (NURBS f a)) => a -> NURBS f a -> Maybe (NURBS f a)
- removeKnot_ :: (Foldable f, Additive f, Ord a, Floating a, SimEq (NURBS f a)) => a -> NURBS f a -> NURBS f a
- removeKnots :: (Foldable f, Additive f, Ord a, Floating a, SimEq (NURBS f a)) => [(Int, a)] -> NURBS f a -> NURBS f a
- purgeKnot :: (Foldable f, Additive f, Ord a, Floating a, SimEq (NURBS f a)) => a -> NURBS f a -> NURBS f a
- purgeKnots :: (Foldable f, Additive f, Ord a, Floating a, SimEq (NURBS f a)) => NURBS f a -> NURBS f a
- ndist :: (Metric f, Ord a, Floating a) => f a -> f a -> a
- class SimEq a where
- simEq :: SimEq a => a -> a -> Bool
- simNeq :: SimEq a => a -> a -> Bool
- joint :: (Ord a, Num a, Floating a, Foldable f, Metric f, SimEq (Weight f a), SimEq (NURBS f a)) => NURBS f a -> NURBS f a -> Maybe (NURBS f a)
- (⊕) :: (Ord a, Num a, Floating a, Foldable f, Metric f, SimEq (Weight f a), SimEq (NURBS f a)) => NURBS f a -> NURBS f a -> Maybe (NURBS f a)
- pline :: (Additive f, Fractional a) => [f a] -> NURBS f a
- circle :: (Eq a, Floating a) => V2 a -> a -> NURBS V2 a
- module Linear.NURBS.Types

# Documentation

spanId :: (Ord a, Num a) => a -> Span a -> a Source

Piecewise constant function, returns 1 in span, 0 otherwise

spanLength :: Num a => Span a -> a Source

Span length

grow :: (Ord a, Fractional a) => a -> Span a -> a Source

Grow within span from 0 to 1

fall :: (Ord a, Fractional a) => a -> Span a -> a Source

Fall function, opposite to `grow`

coords :: (Eq a, Fractional a) => Span a -> Iso' a a Source

Map value to span coordinates, span start mapped to 0, end to 1

iterData :: (Ord a, Fractional a) => KnotData a -> KnotData a Source

Eval basis function for next degree

basis :: (Ord a, Fractional a) => [a] -> Int -> Int -> a -> a Source

Nᵢ,ₙ — n-degree basis function for i-th control point

rbasis :: (Ord a, Fractional a) => [a] -> [a] -> Int -> Int -> a -> a Source

Rᵢ,ₙ — n-degree rational basis function for i-th control point

uniformKnot :: Fractional a => Int -> Int -> [a] Source

Generate knot of degree for points

cycleKnot :: Fractional a => Int -> [a] Source

Generate cycle knot

wpoints :: Fractional a => Lens (NURBS f a) (NURBS g a) [Weight f a] [Weight g a] Source

NURBS points with weights

points :: (Additive f, Additive g, Fractional a) => Traversal (NURBS f a) (NURBS g a) (f a) (g a) Source

NURBS points without weights

knotVector :: Eq a => Lens' (NURBS f a) [a] Source

NURBS knot vector

iknotVector :: (Eq a, Fractional a) => Lens' (NURBS f a) [a] Source

normalizeKnot :: (Eq a, Fractional a) => NURBS f a -> NURBS f a Source

Scale NURBS params to ∈ [0, 1]

nurbs :: (Additive f, Fractional a) => Int -> [f a] -> NURBS f a Source

Make nurbs of degree from points

wnurbs :: (Additive f, Fractional a) => Int -> [Weight f a] -> NURBS f a Source

Make nurbs of degree from weighted points

insertKnot :: (Additive f, Ord a, Fractional a) => a -> NURBS f a -> NURBS f a Source

Insert knot qᵢ₊₁ = fᵢ⋅pᵢ + (1-fᵢ)⋅pᵢ₊₁ q₀ = p₀ (f₋₁ ≡ 0) (non periodic nurbs) qₙ₊₁ = pₙ (fₙ ≡ 1) (non periodic nurbs) fᵢ, pᵢ, pᵢ₊₁ ↦ qᵢ₊₁

insertKnots :: (Additive f, Ord a, Fractional a) => [(Int, a)] -> NURBS f a -> NURBS f a Source

Insert knots

appendPoint :: (Eq a, Fractional a) => a -> Weight f a -> NURBS f a -> NURBS f a Source

Append point

prependPoint :: (Eq a, Fractional a) => a -> Weight f a -> NURBS f a -> NURBS f a Source

Prepend point

split :: (Additive f, Ord a, Fractional a) => a -> NURBS f a -> (NURBS f a, NURBS f a) Source

Split NURBS

breakLoop :: (Additive f, Ord a, Fractional a) => a -> NURBS f a -> NURBS f a Source

Break periodic NURBS at param

removeKnot :: (Foldable f, Additive f, Ord a, Floating a, SimEq (NURBS f a)) => a -> NURBS f a -> Maybe (NURBS f a) Source

Remove knot
pᵢ₊₁ = (qᵢ₊₁ - fᵢ⋅pᵢ)*(1-fᵢ) = hᵢ⋅qᵢ₊₁ + (1-hᵢ)⋅pᵢ, where hᵢ = 1*(1-fᵢ) ∧ fᵢ ≢ 1
if fᵢ = 1 then pᵢ₊₁ = qᵢ₊₁
p₀ = q₀ (h₋₁ ≡ 1)
pₙ = qₙ₊₁ (hₙ ≡ ∞, fₙ ≡ 1)
hᵢ, qᵢ₊₁, pᵢ ↦ pᵢ₊₁

removeKnot_ :: (Foldable f, Additive f, Ord a, Floating a, SimEq (NURBS f a)) => a -> NURBS f a -> NURBS f a Source

Try remove knot

removeKnots :: (Foldable f, Additive f, Ord a, Floating a, SimEq (NURBS f a)) => [(Int, a)] -> NURBS f a -> NURBS f a Source

Remove knots

purgeKnot :: (Foldable f, Additive f, Ord a, Floating a, SimEq (NURBS f a)) => a -> NURBS f a -> NURBS f a Source

Try remove knot as much times as possible

purgeKnots :: (Foldable f, Additive f, Ord a, Floating a, SimEq (NURBS f a)) => NURBS f a -> NURBS f a Source

Try remove knots

Nothing

joint :: (Ord a, Num a, Floating a, Foldable f, Metric f, SimEq (Weight f a), SimEq (NURBS f a)) => NURBS f a -> NURBS f a -> Maybe (NURBS f a) Source

Try to joint two NURBS

(⊕) :: (Ord a, Num a, Floating a, Foldable f, Metric f, SimEq (Weight f a), SimEq (NURBS f a)) => NURBS f a -> NURBS f a -> Maybe (NURBS f a) Source

Joint

pline :: (Additive f, Fractional a) => [f a] -> NURBS f a Source

Make pline NURBS

module Linear.NURBS.Types