21#include <glibmm/i18n.h>
24namespace LivePathEffect {
47 width(_(
"Pen width:"), _(
"Maximal stroke width"),
"width", &wr, this, 25),
48 roundness(_(
"Pen roundness:"), _(
"Min/Max width ratio"),
"roundness", &wr, this, .2),
49 angle(_(
"Angle:"), _(
"direction of thickest strokes (opposite = thinnest)"),
"angle", &wr, this, 45),
53 growfor(_(
"Grow for:"), _(
"Make the stroke thinner near it's start"),
"growfor", &wr, this, 100),
54 fadefor(_(
"Fade for:"), _(
"Make the stroke thinner near it's end"),
"fadefor", &wr, this, 100),
55 round_ends(_(
"Round ends"), _(
"Strokes end with a round end"),
"round_ends", &wr, this, false),
56 capping(_(
"Capping:"), _(
"left capping"),
"capping", &wr, this,
"M 100,5 C 50,5 0,0 0,0 0,0 50,-5 100,-5")
121 double angle_rad =
angle*M_PI/180.;
132 switch(stroke_method) {
136 double c =
cos(angle_rad), s =
sin(angle_rad);
143 nn = nn * (slant * rot );
152 w = n_xy[
X]*
sin(angle_rad) - n_xy[
Y]*
cos(angle_rad);
161 w = n_xy[
X]*
cos(angle_rad)+ n_xy[
Y]*
sin(angle_rad);
189 if ( m.
segs.front().at0() == m.
segs.back().at1()){
201 double totlength = s.
segs.back().at1();
207 factor_in.
cuts[1]=grow_length;
208 if (grow_length < totlength){
210 factor_in.
cuts[2]=totlength;
217 if (fade_length < totlength){
219 factor_out.
cuts[1] = totlength-fade_length;
221 factor_out.
cuts[2] = totlength;
244 hbump.
cuts[1]=fmin(grow_length,totlength*grow_length/(grow_length+fade_length));
245 hbump.
cuts[2]=totlength;
248 left += - hbump *
rot90(n);
249 right += - hbump *
rot90(n);
259 hbump.
cuts[1]=fmax(totlength-fade_length, totlength*grow_length/(grow_length+fade_length));
260 hbump.
cuts[2]=totlength;
263 left += - hbump *
rot90(n);
264 right += - hbump *
rot90(n);
Conversion between Bezier control points and SBasis curves.
3x3 matrix representing an affine transformation.
Adaptor that creates 2D functions from 1D ones.
Range of real numbers that is never empty.
Function that interpolates linearly between two values.
Range of real numbers that can be empty.
Function defined as discrete pieces.
output_type lastValue() const
std::vector< double > cuts
output_type firstValue() const
void concat(const Piecewise< T > &other)
void setDomain(Interval dom)
Polynomial in symmetric power basis.
void registerParameter(Parameter *param)
EnumParam< DynastrokeCappingType > start_cap
LPEDynastroke(LivePathEffectObject *lpeobject)
EnumParam< DynastrokeCappingType > end_cap
EnumParam< DynastrokeMethod > method
~LPEDynastroke() override
Geom::Piecewise< Geom::D2< Geom::SBasis > > doEffect_pwd2(Geom::Piecewise< Geom::D2< Geom::SBasis > > const &pwd2_in) override
void param_set_range(double min, double max)
Simplified management of enumerations of svg items with UI labels.
LPE <dynastroke> implementation, see lpe-dynastroke.cpp.
Various utility functions.
SBasisN< n > cos(LinearN< n > bo, int k)
D2< Piecewise< SBasis > > make_cuts_independent(Piecewise< D2< SBasis > > const &a)
OptInterval bounds_exact(Bezier const &b)
Bezier reverse(const Bezier &a)
Piecewise< SBasis > curvature(D2< SBasis > const &M, double tol=.01)
SBasisN< n > sqrt(SBasisN< n > const &a, int k)
D2< T > compose(D2< T > const &a, T const &b)
Bezier derivative(Bezier const &a)
T dot(D2< T > const &a, D2< T > const &b)
Piecewise< SBasis > arcLengthSb(D2< SBasis > const &M, double tol=.01)
Piecewise< D2< SBasis > > force_continuity(Piecewise< D2< SBasis > > const &f, double tol=0, bool closed=false)
SBasisN< n > sin(LinearN< n > bo, int k)
D2< T > rot90(D2< T > const &a)
Piecewise< D2< SBasis > > unitVector(D2< SBasis > const &vect, double tol=.01, unsigned order=3)
static const Util::EnumDataConverter< DynastrokeMethod > DSMethodConverter(DynastrokeMethodData, DSM_END)
static const Util::EnumDataConverter< DynastrokeCappingType > DSCTConverter(DynastrokeCappingTypeData, DSCT_END)
static const Util::EnumData< DynastrokeCappingType > DynastrokeCappingTypeData[DSCT_END]
static const Util::EnumData< DynastrokeMethod > DynastrokeMethodData[DSM_END]
Helper class to stream background task notifications as a series of messages.
static Glib::ustring join(std::vector< Glib::ustring > const &accels, char const separator)
some std functions to work with (pw)s-basis
Simplified management of enumerations of svg items with UI labels.