Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #3432

Re: Snipping the ears

Newsgroups comp.lang.postscript
Date 2019-08-06 22:05 -0700
References (1 earlier) <5661daa6-058f-4f70-97e8-af7b0568cfc9@googlegroups.com> <9b8a3d34-e793-4f5c-bbb6-3509e7a20cd8@googlegroups.com> <cdeb0b57-5da9-4255-bb71-ed4bff63b693@googlegroups.com> <87blxjdg7o.fsf@ixod.org> <1b955bab-1d49-4739-adf1-88c02606af56@googlegroups.com>
Message-ID <5d20eeef-c249-4765-b5b4-b3dcdceee704@googlegroups.com> (permalink)
Subject Re: Snipping the ears
From luser droog <luser.droog@gmail.com>

Show all headers | View raw


On Tuesday, July 30, 2019 at 1:18:40 AM UTC-5, luser droog wrote:
> On Wednesday, July 24, 2019 at 2:50:05 AM UTC-5, Mark Carroll wrote:
> > On 24 Jul 2019, luser droog wrote:
> > 
> > > When running through the path, transforming one 'lineto' or 'curveto' at
> > > a time, we need a little surrounding context to get all the interesting
> > > vectors that contribute to the result.
> > 
> > I'm afraid that with this kind of thing I always did flattenpath then
> > just had lineto's to deal with.
> > 
> 
> I tried that first of course, but it leads to these ugly artifacts at the
> discontinuities. I tried flattening and then using the outgoing vectors
> from each point. Then I tried the incoming vectors. Then I tried taking
> clusters of 3, 4 or 5 consecutive points and averaging the interstitial
> vectors. All of these led to ears.
> 
> But there may have been errors in my implementation which concealed 
> positive (or promising) results. Thinking over it, using 3 consecutive
> points should have been pretty close if it were done correctly.
> 
> But I have a new idea which really seems like it should work.
> For lineto segments average the incoming and outgoing vectors as
> described earlier. But for curveto segments, if I do a de Casteljau
> subdivision just once, then I get a middle point and two tangent 
> vectors at that point for cheap. If it doubles the number of curves,
> that's not too terrible I think.

At long last I've implemented all of these ideas without errors this time.
And it still makes ears. But I think this is good progress. 

I found some code in Don Lancaster's pages to measure the length of a curve. 
I think I can use that to determine if my new offset curve is bigger or 
smaller than the original. And that should tell me whether we're inside or 
outside of a bend. 

But a numerical/conceptual problem keeps cropping up. Whenever I try to
run through a series of line segments to get the angular change, I don't
know how to bound the output to be 0-360. My modular arithmetic skills
keep crapping out. Maybe pen and paper are the tool for that too.
This problem of getting a usable figure for angular change is exactly
what I need to solve to find out how "tight" the bend is in the curve.

If that all works, then I ought to be able to control ears by snipping
curves that are all clustered up in a corner.

Back to comp.lang.postscript | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Snipping the ears luser droog <luser.droog@gmail.com> - 2019-07-20 13:18 -0700
  Re: Snipping the ears luser droog <luser.droog@gmail.com> - 2019-07-20 16:51 -0700
    Re: Snipping the ears luser droog <luser.droog@gmail.com> - 2019-07-22 00:47 -0700
      Re: Snipping the ears luser droog <luser.droog@gmail.com> - 2019-07-24 00:38 -0700
        Re: Snipping the ears Mark Carroll <mtbc@bcs.org> - 2019-07-24 08:50 +0100
          Re: Snipping the ears luser droog <luser.droog@gmail.com> - 2019-07-29 23:18 -0700
            Re: Snipping the ears luser droog <luser.droog@gmail.com> - 2019-08-06 22:05 -0700
              Re: Snipping the ears luser droog <luser.droog@gmail.com> - 2019-08-08 00:22 -0700
                Re: Snipping the ears luser droog <luser.droog@gmail.com> - 2019-08-11 13:33 -0700
                Re: Snipping the ears luser droog <luser.droog@gmail.com> - 2019-08-13 16:03 -0700
                Re: Snipping the ears luser droog <luser.droog@gmail.com> - 2019-08-19 22:46 -0700
                Re: Snipping the ears luser droog <luser.droog@gmail.com> - 2019-08-21 23:44 -0700
  Re: Snipping the ears jdaw1 <jdawiseman@gmail.com> - 2019-10-10 15:07 -0700
    Re: Snipping the ears jdaw1 <jdawiseman@gmail.com> - 2019-10-10 15:09 -0700
    Re: Snipping the ears luser droog <luser.droog@gmail.com> - 2019-10-13 01:39 -0700
      Re: Snipping the ears luser droog <luser.droog@gmail.com> - 2019-10-13 01:51 -0700
        Re: Snipping the ears jdaw1 <jdawiseman@gmail.com> - 2020-06-04 03:15 -0700
          Re: Snipping the ears luser droog <luser.droog@gmail.com> - 2020-07-09 10:31 -0700
          Re: Snipping the ears jdaw1 <jdawiseman@gmail.com> - 2021-02-13 09:51 -0800

csiph-web