Skip to main content

[JAVA2D] Path Smoothing

1 reply [Last post]
Anonymous

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I have a PathIterator consisting of one MOVETO and lots of very short
LINETO segments. I would like to smoothen out the path by for example
replacing lots of short lines with a fitting curve.

I first thought that FlatteningPathIterator was intended for this job.
But the results I get from it leave my original path unaltered. Am I
doing something wrong or it the class intended for something different?

Thanks very much!

Cheers,
Arik
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)

iD8DBQFA8aiF//PXyz2NiW8RAv7LAKCw9rIFHS0ZSyYKNQQZXl2fBgtMgACfSiAH
ftvu430vggamX52w/cyKBIs=
=WHJN
-----END PGP SIGNATURE-----

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Jim Graham

The FlatteningPathIterator does the opposite of what you are looking
for.
It takes curved paths and approximates them with lots of straight lines.
If your path already consists of only straight lines then it has no more
work to do.

Unfortunately there is no facility in the core Java geometry classes to
do
what you are looking for. Perhaps someone on the list has heard of a
3rd
party package that does this...

...jim

--On 07/11/04 10:52:21 PM +0200 Arik Raffael Funke wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> I have a PathIterator consisting of one MOVETO and lots of very short
> LINETO segments. I would like to smoothen out the path by for example
> replacing lots of short lines with a fitting curve.
>
> I first thought that FlatteningPathIterator was intended for this job.
> But the results I get from it leave my original path unaltered. Am I
> doing something wrong or it the class intended for something
> different?
>
> Thanks very much!
>
> Cheers,
> Arik
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (MingW32)
>
> iD8DBQFA8aiF//PXyz2NiW8RAv7LAKCw9rIFHS0ZSyYKNQQZXl2fBgtMgACfSiAH
> ftvu430vggamX52w/cyKBIs=
> =WHJN
> -----END PGP SIGNATURE-----
>
> =====================================================================
> ====== To unsubscribe, send email to listserv@java.sun.com and
> include in the body of the message "signoff JAVA2D-INTEREST". For
> general help, send email to listserv@java.sun.com and include in the
> body of the message "help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".