lpe-curvestitch.cpp revision 95301464f72ad871d3b919ca4ff5bffd20e962a4
273e421813f295d65aab512f508e8fb575d997d4gouldtj * LPE Curve Stitching implementation, used as an example for a base starting class
273e421813f295d65aab512f508e8fb575d997d4gouldtj * when implementing new LivePathEffects.
273e421813f295d65aab512f508e8fb575d997d4gouldtj * Johan Engelen
273e421813f295d65aab512f508e8fb575d997d4gouldtj* Copyright (C) Johan Engelen 2007 <j.b.c.engelen@utwente.nl>
273e421813f295d65aab512f508e8fb575d997d4gouldtj * Released under GNU GPL, read the file 'COPYING' for more information
273e421813f295d65aab512f508e8fb575d997d4gouldtjusing namespace Geom;
273e421813f295d65aab512f508e8fb575d997d4gouldtjLPECurveStitch::LPECurveStitch(LivePathEffectObject *lpeobject) :
273e421813f295d65aab512f508e8fb575d997d4gouldtj strokepath(_("Stroke path"), _("The path that will be used as stitch."), "strokepath", &wr, this, "M0,0 L1,0"),
d9711532c4ac816bb0dd355f048ce0e26f542710gouldtj nrofpaths(_("Number of paths"), _("The number of paths that will be generated."), "count", &wr, this, 5),
273e421813f295d65aab512f508e8fb575d997d4gouldtj startpoint_variation(_("Start point jitter"), _("The amount of random jitter to apply to the start points of the stitches"), "startpoint_variation", &wr, this, 0),
273e421813f295d65aab512f508e8fb575d997d4gouldtj endpoint_variation(_("End point jitter"), _("The amount of random jitter to apply to the end points of the stitches"), "endpoint_variation", &wr, this, 0),
273e421813f295d65aab512f508e8fb575d997d4gouldtj spacing_variation(_("Spacing variation"), _("Determines the random deviation from the normal start and end points along the sub-paths (whether lines cluster together or have an equal spacing between each other)."), "spacing_variation", &wr, this, 0),
273e421813f295d65aab512f508e8fb575d997d4gouldtj prop_scale(_("Scale width"), _("Scaling of the width of the stroke path"), "prop_scale", &wr, this, 1),
273e421813f295d65aab512f508e8fb575d997d4gouldtj scale_y_rel(_("Scale width relative"), _("Scale the width of the stroke path relative to its length"), "scale_y_rel", &wr, this, false)
273e421813f295d65aab512f508e8fb575d997d4gouldtj registerParameter( dynamic_cast<Parameter *>(&nrofpaths) );
273e421813f295d65aab512f508e8fb575d997d4gouldtj registerParameter( dynamic_cast<Parameter *>(&startpoint_variation) );
bool scislac = false;
Piecewise<D2<SBasis> > A = arc_length_parametrization(Piecewise<D2<SBasis> >(path_in[0].toPwSb()),2,.1);
Piecewise<D2<SBasis> > B = arc_length_parametrization(Piecewise<D2<SBasis> >(path_in[1].toPwSb()),2,.1);
for (int i = 0; i < nrofpaths; i++) {
return path_out;
return path_in;
using namespace Geom;
std::vector<Geom::Path> temppath = SVGD_to_2GeomPath( SP_OBJECT_REPR(item)->attribute("inkscape:original-d"));