Post without Account — your post will be reviewed, and if appropriate, posted under Anonymous. You can also use this link to report any problems registering or logging in.

RT 98539 - flatness() method not working?

  • 2 Replies
  • 1896 Views
*

Offline Phil

  • Global Moderator
  • Sr. Member
  • *****
  • 412
    • View Profile
RT 98539 - flatness() method not working?
« October 21, 2016, 02:59:28 PM »
Subject:    flatness() method not working?
Date:    Tue, 02 Sep 2014 11:06:31 -0400
To:    bug-PDF-API2 [...] rt.cpan.org
From:    Phil M Perry

PDF::API2 v2.022   Perl 5.16.3  Windows 7   severity: Important

In Content.pm, the flatness() method does not appear to have any effect in test cases I've written. Can anyone confirm that it is in fact working, and provide a test case or two that clearly demonstrates it? The code itself does appear to produce the right PDF command: $flatness i , and so passes the "t" test. However, there is no visible effect on either an arc() or a curve() (Bezier cubic). Everything looks perfectly smooth. I'm looking for test cases that demonstrate this for future documentation of the product. Thank you!
#
Subject:    [rt.cpan.org #98539]
Date:    Sun, 24 Jan 2016 16:12:57 -0500
To:    bug-PDF-API2 [...] rt.cpan.org
From:    Phil M Perry

Can anyone provide some test cases illustrating various values of flatness? As I said before, all my tests produced perfectly smooth
curves, so maybe I'm using it incorrectly. Thanks.
#
Wed Feb 17 16:55:43 2016 steve [...] deefs.net - Correspondence added

Please direct support questions to stackoverflow.com.  Use the "perl" and "pdf" tags for best results.

See also PDF 1.7 section 10.6.2.
#
Wed Feb 17 16:55:44 2016 The RT System itself - Status changed from 'new' to 'open'
#
Wed Feb 17 16:55:44 2016 steve [...] deefs.net - Status changed from 'open' to 'rejected'

*

Offline Phil

  • Global Moderator
  • Sr. Member
  • *****
  • 412
    • View Profile
Re: RT 98539 - flatness() method not working?
« Reply #1: November 13, 2016, 07:34:22 PM »
The PDF code produced appears to be correct, but all curves are quite smooth, even cranking up the flatness value to 50 or 100! I would really appreciate it if someone could post test cases or examples demonstrating what various flatness values are supposed to do. Even better, use the flatness() method itself. From that, I can see if the PDF output is indeed correct, and enhance the documentation or fix the code, whichever is needed.

*

Offline Phil

  • Global Moderator
  • Sr. Member
  • *****
  • 412
    • View Profile
Re: RT 98539 - flatness() method not working?
« Reply #2: August 21, 2018, 02:14:39 PM »
I'm going to go ahead and close this one. According to the PDF spec, differences between different tolerances (flatness values) are usually not visible to the eye, and cranking up the tolerance to produce visible line segments can produce unpredictable results. Normally, you should not have to change the flatness tolerance. I have added code to silently clamp the tolerance between 0 and 100, and updated the POD.