Groups | Search | Server Info | Login | Register
Groups > comp.lang.postscript > #3779
| Newsgroups | comp.lang.postscript |
|---|---|
| Date | 2022-07-21 14:31 -0700 |
| References | <a31725cf-9984-4c06-b541-bee4c215626cn@googlegroups.com> <62351448-10c4-45c7-a2b7-7d71ac7d03aan@googlegroups.com> <6fudnUECfJxtwkT_nZ2dnUU7_83NnZ2d@giganews.com> |
| Message-ID | <514d5e2b-b94a-4d46-8b4a-a6f8fa8831d6n@googlegroups.com> (permalink) |
| Subject | Re: ArcPrecise, an accurate arc |
| From | luser droog <luser.droog@gmail.com> |
On Thursday, July 21, 2022 at 9:17:26 AM UTC-5, John Reiser wrote:
> On 7/20/22 11:25, jdaw1 wrote:
> >> The build-in routines start with a line from a currentpoint, if there is one. This is annoying. Consider an annulus: there’s a line between the inner and outer circles, avoiding which requires a manual moveto. `ArcPrecise` and `ArcPreciseN` prevent this annoyance by starting, always, with a moveto, never a lineto.
> >
> > I think this is an error. What if the user wants a rounded rectangle. That isn’t possible if `ArcPrecise` starts with a `moveto`. Perhaps there could be an extra parameter, code, usually being one of {moveto}, {lineto}, {pop pop}. Advice welcomed.
> Advice: 'ArcPrecise' should have the same API as 'arc'. Why? When I see
> an image that I want to improve by using ArcPrecise instead of arc, then
> I want the *option* to interpose a global dictionary which defines 'arc'
> as 'ArcPrecise', and have better arcs be the only change to the image.
> I might not have access to the innards of the rest of the Postscript code;
> it might not be possible to use a text editor to change all calls on "arc".
I lean towards endorsing this view, but I don't hold the opinion very strongly.
Having a drop-in replacement is very useful. Having a considered and improved
behavior based on the common use cases is very useful. I'm not sure how
to weigh these benefits against each other.
For the implementation side -- apart from the policy decision -- mimicking
the existing API of `arc` can be pretty short and sweet:
% x0 y0
{ lineto } stopped { moveto } if
This leads to the question: how can you (most) easily get the starting point
out of `arc` or `ArcPrecise` (were it to follow this convention) in order to
call `moveto` first to eliminate the line segment (erhm, make its length zero)?
If you call `arc` or `ArcPrecise` with an angular difference of zero, it ought
to result in adding to the path just that initial point, right? Then you'd just
need a crazy function to rewrite the path where the very last `lineto` is
changed to a `moveto`. Too ugly for me to want to write it right now, but
feels possible to write.
The extra parameter idea is nice. Extra parameterization is the obvious
way to select variant behaviors. Whether it "looks nice" is a subjective
judgement.
Back to comp.lang.postscript | Previous | Next — Previous in thread | Next in thread | Find similar
ArcPrecise, an accurate arc jdaw1 <jdawiseman@gmail.com> - 2022-07-19 12:47 -0700
Re: ArcPrecise, an accurate arc jdaw1 <jdawiseman@gmail.com> - 2022-07-20 11:25 -0700
Re: ArcPrecise, an accurate arc David Newall <davidn@davidnewall.com> - 2022-07-21 18:29 +1000
Re: ArcPrecise, an accurate arc John Reiser <vendor@BitWagon.com> - 2022-07-21 07:17 -0700
Re: ArcPrecise, an accurate arc jdaw1 <jdawiseman@gmail.com> - 2022-07-21 12:02 -0700
Re: ArcPrecise, an accurate arc luser droog <luser.droog@gmail.com> - 2022-07-21 14:31 -0700
Re: ArcPrecise, an accurate arc jdaw1 <jdawiseman@gmail.com> - 2022-07-21 15:00 -0700
Re: ArcPrecise, an accurate arc jdaw1 <jdawiseman@gmail.com> - 2022-07-21 15:24 -0700
Re: ArcPrecise, an accurate arc jdaw1 <jdawiseman@gmail.com> - 2022-07-22 00:58 -0700
Re: ArcPrecise, an accurate arc Phil Wakely <pwakely99@googlemail.com> - 2022-07-22 01:42 -0700
Re: ArcPrecise, an accurate arc Phil Wakely <pwakely99@googlemail.com> - 2022-07-22 01:52 -0700
Re: ArcAccurate, an accurate arc jdaw1 <jdawiseman@gmail.com> - 2022-07-22 14:03 -0700
Re: ArcAccurate, an accurate arc jdaw1 <jdawiseman@gmail.com> - 2022-07-24 09:02 -0700
Re: ArcPrecise, an accurate arc jdaw1 <jdawiseman@gmail.com> - 2024-01-22 11:07 -0800
csiph-web