lpe-curvestitch.cpp revision a49bcd16e5160ff716a3c719fdc47b5c16adb20a
#define INKSCAPE_LPE_CURVESTITCH_CPP
/** \file
* LPE Curve Stitching implementation, used as an example for a base starting class
* when implementing new LivePathEffects.
*
*/
/*
* Authors:
* Johan Engelen
*
* Copyright (C) Johan Engelen 2007 <j.b.c.engelen@utwente.nl>
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "live_effects/lpe-curvestitch.h"
#include <libnr/n-art-bpath.h>
#include "sp-item.h"
#include "sp-path.h"
#include "live_effects/n-art-bpath-2geom.h"
#include "libnr/nr-values.h"
namespace Inkscape {
namespace LivePathEffect {
using namespace Geom;
strokepath(_("Stroke path"), _("The path that will be used as stitch."), "strokepath", &wr, this, "M0,0 L1,0"),
nrofpaths(_("Number of paths"), _("The number of paths that will be generated."), "count", &wr, this, 5),
startpoint_variation(_("Start point jitter"), _("The amount of random jitter to apply to the start points of the stitches"), "startpoint_variation", &wr, this, 0),
endpoint_variation(_("End point jitter"), _("The amount of random jitter to apply to the end points of the stitches"), "endpoint_variation", &wr, this, 0),
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),
prop_scale(_("Scale width"), _("Scaling of the width of the stroke path"), "prop_scale", &wr, this, 1),
scale_y_rel(_("Scale width relative"), _("Scale the width of the stroke path relative to its length"), "scale_y_rel", &wr, this, false)
{
}
{
}
{
bool scislac = true;
// do this for all permutations if there are more than 2 paths? realllly cool!
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++) {
if (startpoint_variation.get_value() != 0)
if (endpoint_variation.get_value() != 0)
if (scale_y_rel.get_value()) {
} else {
}
// add stuff to one big pw<d2<sbasis> > and then outside the loop convert to path?
tAclean += incrementA;
tBclean += incrementB;
}
return path_out;
} else {
return path_in;
}
}
void
{
if (!SP_IS_PATH(item)) return;
using namespace Geom;
// set the stroke path to run horizontally in the middle of the bounding box of the original path
std::vector<Geom::Path> temppath = SVGD_to_2GeomPath( SP_OBJECT_REPR(item)->attribute("inkscape:original-d"));
}
}
} //namespace LivePathEffect
} /* namespace Inkscape */
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :