Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

All constants are variables.


devel / comp.lang.postscript / Classifying bezier curves

SubjectAuthor
* Classifying bezier curvesluser droog
`* Re: Classifying bezier curvesjdaw1
 +* Re: Classifying bezier curvesjdaw1
 |`- Re: Classifying bezier curvesluser droog
 `- Re: Classifying bezier curvesluser droog

1
Classifying bezier curves

<1e0a3deb-933b-49e5-b222-d9acf341e35bn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=193&group=comp.lang.postscript#193

  copy link   Newsgroups: comp.lang.postscript
X-Received: by 2002:a05:6214:d8b:b0:4b3:ed11:eb59 with SMTP id e11-20020a0562140d8b00b004b3ed11eb59mr7621834qve.80.1666196876234;
Wed, 19 Oct 2022 09:27:56 -0700 (PDT)
X-Received: by 2002:a05:6214:1cc1:b0:4af:91b4:c62f with SMTP id
g1-20020a0562141cc100b004af91b4c62fmr7257090qvd.33.1666196876048; Wed, 19 Oct
2022 09:27:56 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.postscript
Date: Wed, 19 Oct 2022 09:27:55 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=24.107.184.18; posting-account=G1KGwgkAAAAyw4z0LxHH0fja6wAbo7Cz
NNTP-Posting-Host: 24.107.184.18
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1e0a3deb-933b-49e5-b222-d9acf341e35bn@googlegroups.com>
Subject: Classifying bezier curves
From: luser.droog@gmail.com (luser droog)
Injection-Date: Wed, 19 Oct 2022 16:27:56 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4319
 by: luser droog - Wed, 19 Oct 2022 16:27 UTC

Pursuant to Julian's parallel curve threads and my "snipping the ears"
thread, I dug into a few articles and found one with code that I could
mostly implement in PostScript.

Using this, one could define separate heuristics for each class of
curve and maybe convert loops into cusps. Thus identifying and
snipping all the ears.

But it calls for 3 functions (H0, H1, H2) which I don't know how to
implement. It's supposed to determine the position of the Origin
in the "hodograph associated with the implicit Bezier curve".
So presumably, I have to ... I don't know what .... do some crazy
stuff with resultant matrices and Sylvester matrices? Then take
the derivatives of the implicit equation wrt u and v, I suppose.
But I don't know how to do step 2.

$ cat bez.ps
% https://www.researchgate.net/profile/Abdelouahad-Bayar/publication/317351174_A_Practical_Way_to_Characterize_Non-degenerate_Cubic_BEZIER_Curves/links/5b43ee210f7e9bb59b1b0c0f/A-Practical-Way-to-Characterize-Non-degenerate-Cubic-BEZIER-Curves.pdf?origin=publication_detail

/bzGeoChz {
1 dict begin {y3 x3 y2 x2 y1 x1 y0 x0}{exch def}forall
/gx x3 x0 sub def
/gy y3 y0 sub def
/flt
3 x1 x0 sub mul 3 y1 y0 sub mul
3 x2 x1 sub mul 3 y2 y1 sub mul
3 x3 x2 sub mul 3 y3 y2 sub mul
0 0 linearFlag
3 x1 x0 sub mul 3 y1 y0 sub mul
3 x2 x1 sub mul 3 y2 y1 sub mul
3 x3 x2 sub mul 3 y3 y2 sub mul
gx gy linearFlag
xor
def
flt 0 eq {
/flt 7
x0 y0 x1 y1 x2 y2 x3 y3 0 0 quadLocationFlag
add def
} if
flt 1 eq { 1 }{
flt 6 eq { 2 }{
flt 10 eq { 3 }{
flt 2 eq
flt 4 eq or { 4 }{
flt 3 eq
flt 5 eq or { 5 }{
flt 9 eq { 6 }{
flt 7 eq { 7 }{
8
}ifelse }ifelse }ifelse }ifelse }ifelse }ifelse }ifelse
end
} def

/quadLocationFlag {
1 dict begin {y x y3 x3 y2 x2 y1 x2 y0 x0}{exch def}forall
/flag
x0 y0 x1 y1 x2 y2 x y H0
dup 0 gt { pop 2 }{
0 lt { 1 }{ 0 } ifelse
} ifelse
def
x0 y0 x1 y1 x2 y2 x y H1 0 lt
x0 y0 x1 y1 x2 y2 x y H2 0 lt or {
/flag flag 2 add def
} if
flag
end
} def

/linearFlag {
1 dict begin {y x hy2 hx2 hy1 hx1 hy0 hx0}{exch def}forall
/flag 0 def
/gx hx0 hx1 hx2 add add 3 div def
/gy hy0 hy1 hy2 add add 3 div def
hx1 hx0 sub gy hy0 sub mul
hy1 hy0 sub gx hx0 sub mul sub
0 gt {
hx1 hx0 sub y hy0 sub mul
hy1 hy0 sub x hx0 sub mul sub
0 ge {
/flag flag 4 add def
} if
hx2 hx1 sub y hy1 sub mul
hy2 hy1 sub x hx1 sub mul sub
0 ge {
/flag flag 2 add def
} if
hx0 hx2 sub y hy2 sub mul
hy0 hy2 sub x hx2 sub mul sub
0 ge {
/flag flag 1 add def
} if
}{
hx1 hx0 sub y hy0 sub mul
hy1 hy0 sub x hx0 sub mul sub
0 gt {
/flag flag 4 add def
} if
hx2 hx1 sub y hy1 sub mul
hy2 hy1 sub x hx1 sub mul sub
0 gt {
/flag flag 2 add def
} if
hx0 hx2 sub y hy2 sub mul
hy0 hy2 sub x hx2 sub mul sub
0 gt {
/flag flag 1 add def
} if
} ifelse
end
} def

/H0 {
} def

/H1 {
} def

/H2 {
} def

Re: Classifying bezier curves

<20b8e6b8-b44c-440c-9f39-25b6c9c45821n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=210&group=comp.lang.postscript#210

  copy link   Newsgroups: comp.lang.postscript
X-Received: by 2002:a05:620a:1a87:b0:765:2eef:e3b9 with SMTP id bl7-20020a05620a1a8700b007652eefe3b9mr34783qkb.2.1688508184101;
Tue, 04 Jul 2023 15:03:04 -0700 (PDT)
X-Received: by 2002:a17:902:c246:b0:1ae:5d12:743a with SMTP id
6-20020a170902c24600b001ae5d12743amr11487336plg.4.1688508183590; Tue, 04 Jul
2023 15:03:03 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.postscript
Date: Tue, 4 Jul 2023 15:03:02 -0700 (PDT)
In-Reply-To: <1e0a3deb-933b-49e5-b222-d9acf341e35bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=185.176.160.84; posting-account=Cp97SgoAAAC0t1Gya5PaPqyoafMoOtAn
NNTP-Posting-Host: 185.176.160.84
References: <1e0a3deb-933b-49e5-b222-d9acf341e35bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <20b8e6b8-b44c-440c-9f39-25b6c9c45821n@googlegroups.com>
Subject: Re: Classifying bezier curves
From: jdawiseman@gmail.com (jdaw1)
Injection-Date: Tue, 04 Jul 2023 22:03:04 +0000
Content-Type: text/plain; charset="UTF-8"
 by: jdaw1 - Tue, 4 Jul 2023 22:03 UTC

> Using this, one could define separate heuristics for each class of
> curve

What are the classes of curve?

Re: Classifying bezier curves

<b456980d-31b6-491e-81d7-fad59ea35e8cn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=211&group=comp.lang.postscript#211

  copy link   Newsgroups: comp.lang.postscript
X-Received: by 2002:a05:6214:1907:b0:634:9899:fab with SMTP id er7-20020a056214190700b0063498990fabmr45909qvb.3.1688508365260;
Tue, 04 Jul 2023 15:06:05 -0700 (PDT)
X-Received: by 2002:a17:90b:287:b0:263:6a50:e86c with SMTP id
az7-20020a17090b028700b002636a50e86cmr10473624pjb.8.1688508364756; Tue, 04
Jul 2023 15:06:04 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!nntp.club.cc.cmu.edu!45.76.7.193.MISMATCH!3.us.feeder.erje.net!feeder.erje.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.postscript
Date: Tue, 4 Jul 2023 15:06:04 -0700 (PDT)
In-Reply-To: <20b8e6b8-b44c-440c-9f39-25b6c9c45821n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=185.176.160.84; posting-account=Cp97SgoAAAC0t1Gya5PaPqyoafMoOtAn
NNTP-Posting-Host: 185.176.160.84
References: <1e0a3deb-933b-49e5-b222-d9acf341e35bn@googlegroups.com> <20b8e6b8-b44c-440c-9f39-25b6c9c45821n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b456980d-31b6-491e-81d7-fad59ea35e8cn@googlegroups.com>
Subject: Re: Classifying bezier curves
From: jdawiseman@gmail.com (jdaw1)
Injection-Date: Tue, 04 Jul 2023 22:06:05 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 13
 by: jdaw1 - Tue, 4 Jul 2023 22:06 UTC

Relevant links:

http://groups.google.com/g/comp.lang.postscript/c/OTpiW7feg_c/m/7S733-mkey4J

http://groups.google.com/g/comp.lang.postscript/c/bFWXCkT2R-A

http://groups.google.com/g/comp.lang.postscript/c/UJKMKfAoqDY/m/Ba9OAtLdCAAJ
(indeed, I’d welcome an explanation of the term “Snipping the ears”.)

https://github.com/jdaw1/placemat/issues/18

Re: Classifying bezier curves

<70fca750-f15a-47c2-a029-7ae7156876d1n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=213&group=comp.lang.postscript#213

  copy link   Newsgroups: comp.lang.postscript
X-Received: by 2002:a05:622a:1a94:b0:3ff:797a:b8e6 with SMTP id s20-20020a05622a1a9400b003ff797ab8e6mr6790qtc.10.1688659000488;
Thu, 06 Jul 2023 08:56:40 -0700 (PDT)
X-Received: by 2002:a05:6a00:9a9:b0:682:69ee:5037 with SMTP id
u41-20020a056a0009a900b0068269ee5037mr2982851pfg.0.1688659000169; Thu, 06 Jul
2023 08:56:40 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.postscript
Date: Thu, 6 Jul 2023 08:56:39 -0700 (PDT)
In-Reply-To: <20b8e6b8-b44c-440c-9f39-25b6c9c45821n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=24.107.183.247; posting-account=G1KGwgkAAAAyw4z0LxHH0fja6wAbo7Cz
NNTP-Posting-Host: 24.107.183.247
References: <1e0a3deb-933b-49e5-b222-d9acf341e35bn@googlegroups.com> <20b8e6b8-b44c-440c-9f39-25b6c9c45821n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <70fca750-f15a-47c2-a029-7ae7156876d1n@googlegroups.com>
Subject: Re: Classifying bezier curves
From: luser.droog@gmail.com (luser droog)
Injection-Date: Thu, 06 Jul 2023 15:56:40 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: luser droog - Thu, 6 Jul 2023 15:56 UTC

On Tuesday, July 4, 2023 at 5:03:04 PM UTC-5, jdaw1 wrote:
> > Using this, one could define separate heuristics for each class of
> > curve
> What are the classes of curve?

I wasn't able to fully understand it. All the literature I found cites back to a
paper by D.S. Kim from the 80s that I didn't want to pay Springer's crazy
price for.

The classes themselves are in figure 2 of the paper by Bayar. He shows
6 stereotypical forms of curve and any given bezier curve is supposed
to be (or boil down to) one of these. And he gives some Pascal code
for everything except H0(), H1(), and H2() for which he refers you to Kim.

I tried asking ChatGPT for help implementing H0, H1, and H2. But none
of the formulas it gave me really made any sense, and they didn't produce
the desired results. But if you can track down the Deok Soo Kim paper
and then do your Mathematica magic on it, I bet we'd get there.

Re: Classifying bezier curves

<44049580-ca53-4235-99cb-5f6da16609a5n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=214&group=comp.lang.postscript#214

  copy link   Newsgroups: comp.lang.postscript
X-Received: by 2002:ad4:5a47:0:b0:635:e3ae:e096 with SMTP id ej7-20020ad45a47000000b00635e3aee096mr5590qvb.12.1688660730522;
Thu, 06 Jul 2023 09:25:30 -0700 (PDT)
X-Received: by 2002:a17:902:be14:b0:1b8:30d8:bc48 with SMTP id
r20-20020a170902be1400b001b830d8bc48mr1971552pls.9.1688660729961; Thu, 06 Jul
2023 09:25:29 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.postscript
Date: Thu, 6 Jul 2023 09:25:29 -0700 (PDT)
In-Reply-To: <b456980d-31b6-491e-81d7-fad59ea35e8cn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=24.107.183.247; posting-account=G1KGwgkAAAAyw4z0LxHH0fja6wAbo7Cz
NNTP-Posting-Host: 24.107.183.247
References: <1e0a3deb-933b-49e5-b222-d9acf341e35bn@googlegroups.com>
<20b8e6b8-b44c-440c-9f39-25b6c9c45821n@googlegroups.com> <b456980d-31b6-491e-81d7-fad59ea35e8cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <44049580-ca53-4235-99cb-5f6da16609a5n@googlegroups.com>
Subject: Re: Classifying bezier curves
From: luser.droog@gmail.com (luser droog)
Injection-Date: Thu, 06 Jul 2023 16:25:30 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1811
 by: luser droog - Thu, 6 Jul 2023 16:25 UTC

On Tuesday, July 4, 2023 at 5:06:05 PM UTC-5, jdaw1 wrote:
> (indeed, I’d welcome an explanation of the term “Snipping the ears”.)
>
> https://github.com/jdaw1/placemat/issues/18

That was my nickname for the artifact happening when the corners
were too tight. My algorithm produces a little "trapeze" or "dog ear"
instead of smoothing over the problem spots. It showed up in the
little corners of the (9) charpath when offset and got worse and worse
with repeated offsetting.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor