diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:24:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:24:48 +0000 |
commit | cca66b9ec4e494c1d919bff0f71a820d8afab1fa (patch) | |
tree | 146f39ded1c938019e1ed42d30923c2ac9e86789 /src/3rdparty/2geom/doc/manual2/s-basis | |
parent | Initial commit. (diff) | |
download | inkscape-upstream.tar.xz inkscape-upstream.zip |
Adding upstream version 1.2.2.upstream/1.2.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/3rdparty/2geom/doc/manual2/s-basis')
-rw-r--r-- | src/3rdparty/2geom/doc/manual2/s-basis | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/src/3rdparty/2geom/doc/manual2/s-basis b/src/3rdparty/2geom/doc/manual2/s-basis new file mode 100644 index 0000000..5f2ddfb --- /dev/null +++ b/src/3rdparty/2geom/doc/manual2/s-basis @@ -0,0 +1,91 @@ +h1. S-Power-Basis-Forms + +2Geom provides a very powerful algebra for modifying paths. Although +paths are kept in an extended SVG native form where possible, many +operations require a more mathematical form. Our prefferred form is +a sequence of s-power basis polynomials, henceforth referred to as +s-basis. We may convert to this form, perform the required operations +and convert back, approximating to a requested tolerance as required. + +The precise details of the s-basis form are beyond the scope of this +manual - the interested reader should consult \cite{SanchezReyes1997,SanchezReyes2000,SanchezReyes2001,SanchezReyes2003,SanchezReyes2004}. +An elementary, functional description is given in Appendix C. + +(TODO: work out textile citations, math inclusion) + +Geometrically important properties: +* exact representation of bezier segments +* low condition number on bezier conversion. +* strong convergence guarantees +* $C^0$ continuity guarantee + +The following operations are directly implementable and are very efficient: +* fast conversion from all svg elements +* basic arithmetic - @+@, @-@, $\times$, $\div$ +* algebraic derivative and integral +* elementary trigonometric functions: $\sqrt{\cdot}$, $\sin(\cdot)$, $\cos(\cdot)$, $\exp(\cdot)$ +* efficient degree elevation and reduction +* function inversion +* exact solutions for many non trivial operations +* root finding +* composition + +All of these operations are fast. For example, multiplication of two +beziers by converting to s-basis form, multiplying and converting back +takes roughly the same time as performing the bezier multiplication +directly, and furthermore, subdivision and degree reduction are +straightforward in this form. + +h2. Implementation + +h3. *Linear* + +The *Linear* class represents a linear function, mostly for use as a +building block for *SBasis*. *Linear* fully implements *AddableConcept*, +*OffsetableConcept*, and *ScalableConcept* yielding the following operators: + +<pre><code> + AddableConcept: x + y, x - y, x += y, x -= y + OffsetableConcept: x + d, x - d, x += d, x -= d + ScalableConcept: x * d, x / d, x *= d, x /= d, -x +</code></pre> + +(where @x@ and @y@ are *Linear*, d is *Coord*, and all return *Linear*) + +As *Linear* is a basic function type, it also implements the *FragmentConcept*. + +The main *Linear* constructor accepts two *Coord* values, one for the Linear's +value at 0, and one for its value at 1. These may then later be accessed and +modified with the indexing operator, @[]@, with a value of 0 or 1. + +h3. *SBasis* + +The *SBasis* class provides the most basic function form, +$f(t) \rightarrow y$. *SBasis* are made up of multiple *Linear* elements, +which store to/from values for each polynomial coefficient. + +*SBasis*, like *Linear*, above, fully implements *AddableConcept*, +*OffsetableConcept*, and *ScalableConcept*. + +As *SBasis* is a basic function type, it implements the *FragmentConcept*. + +Usually you do not have to directly construct SBasis, as they are obtained +one way or another, and many of the operations are defined, however, *SBasis* +may be constructed as an implicit *Linear* cast, as a copy, or as a blank. +The class is actually an extension of @std::vector<Linear>@. This provides +the primary method of raw *SBasis* construction -- @push_back(Linear)@, which +adds another coefficient to the *SBasis*. + +*SBasis* also provides the indexing accessor/mutator, and due to its vector +nature, iteration. + +(TODO: wouldn't the indexing be provided by vector any way?) + +h3. *SBasis2D* + +SBasis2D provides a multivariate form - functions of the form +$f(u,v) \rightarrow z$. These can be used for arbitrary distortion +functions (take a path $p(t) \rightarrow (u,v)$ and a pair of surfaces +$f(u,v),g(u,v)$ and compose: $q(t) = (f(p(t)), g(p(t)))$. + +(TODO: flesh out this section) |