[Ipe-discuss] simplify path feature?

Philipp Kindermann philipp.kindermann at uni-wuerzburg.de
Tue Apr 12 19:49:21 CEST 2016


Hi all,

I wrote a small ipelet that hopefully does what you need. For a selected
path, it lets you input a tolerance on the distance between points and
then removes vertices on the path that are too close. You can find it here:
https://github.com/PhKindermann/ipe-simplify
Note that it's my first ipelet so the code is a bit messy and there will
be bugs (e.g. it does not work for splines), but I hope that it does the
job for now.

Best,
Philipp

Am 11.04.2016 um 17:46 schrieb Nathaniel Cunningham:
> Jason, you might want the algorithm to be a bit smarter: to pay
> attention to spacing of points, for example, and adapt the number of
> points discarded accordingly; and (more importantly) to keep more
> points, or most extreme points ("corners") at locations where the
> curve direction changes rapidly.  But I agree, that even the simplest
> version you outline would be a good addition, and the rest would just
> be refinement.
>
> Surely there are already algorithms out there someplace to do this,
> that would simply need to be incorporated into an ipelet?  Not sure
> where to track such a thing down, though.
>
> -- Nathaniel
>
> On Mon, Apr 11, 2016 at 4:37 AM, Jason Miller <jasonpmil at gmail.com
> <mailto:jasonpmil at gmail.com>> wrote:
>
>     Thanks!
>
>     I would be personally happy with something even much simpler:
>     namely an ipelet which converts a path made with the pen tool to a
>     spline and keeps only 1 out of every k points where k is a user
>     input.  (Paths made with a stylus seem to have such a huge number
>     of points that one can take k quite large and still get something
>     which looks almost exactly the same as the original path.)  In
>     other words, it does not even have to be particularly smart about
>     deciding which points to keep when simplifying the path.
>
>     Best wishes,
>
>     Jason
>
>     > On Apr 11, 2016, at 11:10 AM, Otfried Cheong
>     <otfried at ipe.airpost.net <mailto:otfried at ipe.airpost.net>> wrote:
>     >
>     > Simplifying the curve when you draw with the pen is on my to-do
>     list for
>     > the next version.  I shouldn't be too hard to add an ipelet to
>     simply a
>     > curve afterwards as well - I don't think there is one publicly
>     available
>     > right now (would be a good exercise to learn to write ipelets :-)
>     >
>     > Cheers,
>     > Otfried
>     >
>     > On Mon, Apr 11, 2016, at 01:05, Nathaniel Cunningham wrote:
>     >> +1 for this ipelet request!  (Don't know of one already available)
>     >>
>     >> -- Nathaniel
>     >>
>     >> On Sun, Apr 10, 2016 at 4:13 AM, Jason Miller
>     <jasonpmil at gmail.com <mailto:jasonpmil at gmail.com>>
>     >> wrote:
>     >>
>     >>> Dear all,
>     >>>
>     >>> I was wondering if there exists an ipelet that would be able
>     to simplify a
>     >>> path that contains a huge number of points?  I have created
>     some ipe
>     >>> drawings using a stylus on my computer and the result is
>     always very large
>     >>> because ipe records such a high density of points.
>     >>>
>     >>> Thanks,
>     >>>
>     >>> Jason
>     >>> _______________________________________________
>     >>> Ipe-discuss mailing list
>     >>> Ipe-discuss at lists.science.uu.nl
>     <mailto:Ipe-discuss at lists.science.uu.nl>
>     >>> http://lists.science.uu.nl/mailman/listinfo/ipe-discuss
>     >>>
>     >> _______________________________________________
>     >> Ipe-discuss mailing list
>     >> Ipe-discuss at lists.science.uu.nl
>     <mailto:Ipe-discuss at lists.science.uu.nl>
>     >> http://lists.science.uu.nl/mailman/listinfo/ipe-discuss
>     > _______________________________________________
>     > Ipe-discuss mailing list
>     > Ipe-discuss at lists.science.uu.nl
>     <mailto:Ipe-discuss at lists.science.uu.nl>
>     > http://lists.science.uu.nl/mailman/listinfo/ipe-discuss
>
>     _______________________________________________
>     Ipe-discuss mailing list
>     Ipe-discuss at lists.science.uu.nl
>     <mailto:Ipe-discuss at lists.science.uu.nl>
>     http://lists.science.uu.nl/mailman/listinfo/ipe-discuss
>
>
>
>
> _______________________________________________
> Ipe-discuss mailing list
> Ipe-discuss at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/ipe-discuss

-- 
************************************************************************
Dr. Philipp Kindermann

FernUniversität in Hagen
Fakultät Mathematik und Informatik
Lehrgebiet Theoretische Informatik
58084 Hagen, Germany

Phone: +49 (0)2331 987 4784
Room: 0H311, IZ
************************************************************************ 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/ipe-discuss/attachments/20160412/9042550c/attachment.html 


More information about the Ipe-discuss mailing list