Re: improve a spline

Liste des GroupesRevenir à cl tcl 
Sujet : Re: improve a spline
De : user153 (at) *nospam* newsgrouper.org.invalid (Arjen)
Groupes : comp.lang.tcl
Date : 13. Jun 2025, 09:28:03
Autres entêtes
Message-ID : <1749803283-153@newsgrouper.org>
References : 1 2 3
User-Agent : Newsgrouper/0.7.2

saito <saitology9@gmail.com> posted:

On 6/12/2025 7:08 PM, Emiliano wrote:
 
If by "smooth" you mean antialias, then no, Tk canvas doesn't do antialias.
As I undertand it, the tkpath package does, but I can't confirm since never
used it.
 
 
Thanks for taking a look. This is a piece of very old code from someone
else and I need to decide whether to improve it or trash it.
 
I guess there is no escaping the jagged lines. That is OK. How about
just making it a simple curve?  As it is currently, there are two points
where it curves making it look like an S. Any ideas to reduce it to
simple / relaxed sine curve?

This is the character of the Bezier smoothing. If you want a curve with
only a single "bent", you might consider to derive a midpoint from the
two endpoints and draw a smoothed line (-smooth 1) through THREE points.

A possible method:
- Take the vector from point A to point B
- Determine the normal n to that vector (note: choice of direction!)
- Use a fraction of the distance between A and B to calculate the new point:

  new point = (A + B)/2 + fraction * distance(A,B) * normal vector

You have a number of choices here :).

Date Sujet#  Auteur
12 Jun 25 * improve a spline7saito
13 Jun 25 `* Re: improve a spline6Emiliano
13 Jun 25  `* Re: improve a spline5saito
13 Jun 25   +* Re: improve a spline2Arjen
13 Jun 25   i`- Re: improve a spline1saito
13 Jun 25   `* Re: improve a spline2Emiliano
13 Jun 25    `- Re: improve a spline1saito

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal