RSS/Atom feed Twitter
Site is read-only, email is disabled

'Precision' Meaning

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

'Precision' Meaning FierySwordswoman 30 Oct 23:52
  'Precision' Meaning Ofnuts 31 Oct 00:53
FierySwordswoman
2016-10-30 23:52:27 UTC (over 8 years ago)

'Precision' Meaning

When creating a script for GIMP, using something like stroke.get_point_at_dist(...)
it requires 2 floats: distance and 'precision for estimation'. What does 'precision for estimation' mean?

Ofnuts
2016-10-31 00:53:14 UTC (over 8 years ago)

'Precision' Meaning

On 31/10/16 00:52, FierySwordswoman wrote:

When creating a script for GIMP, using something like stroke.get_point_at_dist(...)
it requires 2 floats: distance and 'precision for estimation'. What does 'precision for estimation' mean?

The point coordinates are obtained by an iterative algorithm that must be stopping when further iteration do not change the coordinates by some precision amount.

Typically I use .1 for the simple cases, and .1/N when I want a bit more accuracy, N being the number of anchors in the stroke.

Keep in mind that if you use the value of pdb.gimp_vectors_stroke_get_length(...) in pdb.gimp_vectors_stroke_get_point_at_dist(...) you may well get an invalid result (valid=False). I often use a facade method that returns the coordinates of the last anchor in this case.