Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Help stamp out Mickey-Mouse computer interfaces -- Menus are for Restaurants!


devel / comp.lang.postscript / Re: undesirable feature of pathbbox

SubjectAuthor
o Re: undesirable feature of pathbboxjdaw1

1
Re: undesirable feature of pathbbox

<e4c9007f-5d65-4cf3-8486-4c020497da02n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.postscript
X-Received: by 2002:a05:620a:408a:b0:6b6:1aa6:21ec with SMTP id f10-20020a05620a408a00b006b61aa621ecmr18373049qko.735.1660064679075;
Tue, 09 Aug 2022 10:04:39 -0700 (PDT)
X-Received: by 2002:a05:6870:218c:b0:10e:5ef9:47b8 with SMTP id
l12-20020a056870218c00b0010e5ef947b8mr13789171oae.14.1660064678794; Tue, 09
Aug 2022 10:04:38 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.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: Tue, 9 Aug 2022 10:04:38 -0700 (PDT)
In-Reply-To: <2874vt$g2d@ellipse.mps.ohio-state.edu>
Injection-Info: google-groups.googlegroups.com; posting-host=185.176.160.84; posting-account=Cp97SgoAAAC0t1Gya5PaPqyoafMoOtAn
NNTP-Posting-Host: 185.176.160.84
References: <27qibi$7ej@ellipse.mps.ohio-state.edu> <iank.748966139@tdc.dircon.co.uk>
<2874vt$g2d@ellipse.mps.ohio-state.edu>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e4c9007f-5d65-4cf3-8486-4c020497da02n@googlegroups.com>
Subject: Re: undesirable feature of pathbbox
From: jdawiseman@gmail.com (jdaw1)
Injection-Date: Tue, 09 Aug 2022 17:04:39 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2643
 by: jdaw1 - Tue, 9 Aug 2022 17:04 UTC

This reply might be too late for the original poster; nonetheless might help later readers.

PostScript’s pathbbox is not clever. It takes limits in current x-y space of curve control points and line segment ends. So the reported box can be larger than the actual box.

In https://github.com/jdaw1/placemat/blob/main/PostScript/placemat.ps is a function PathBBox, (currently lines 2884–2993, search for “/PathBBox”), which does what pathbbox ought to have done.

First pass it computes the x (and then y) bounds, considering only the ends points of straight lines, and the endpoints of curves (ignores middle controls).

Second pass is for curves only. For those curves with any interior control points outside the already-computed limits (x or y or both), it computes for those axes the cubic coefficients, differentiates once, solves for 0 subject to 0 < t < 1, and then computes the values at those turning points. If these turning points expand the bounding box, the the bounding box is expanded.

A test:

0 0 moveto   1 0  1 1  0 1 curveto

then

pathbbox returns: 0.0 0.0 1.0 1.0, being the bounding box of the control points;

PathBBox returns: 0.0 0.0 0.75 1.0, being the bounding box of the path. Observe that Max[x]=¾.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor