🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #2289

Re: Multiple flattenpaths

#2289
From: Peter Funk
Date: Tue, 05 Jun 1990 03:55
44 lines
2764 bytes
cosell@bbn.com (Bernie Cosell) writes:

bc>        strokepath
bc>        flattenpath
bc>        ...lots of irrelevant stuff
bc>        flattenpath
bc> and the second flattenpath fails ...
bc> ... I'd have thought that doing a second
bc> flattenpath would be a no-op... is there something obvious I'm missing
bc> ... 

I replied :

pf> How should the interpreter "know", that the path was previously flattened ?
pf> 	 .... 			 So the interpreter tries to create a 
pf> temporary copy of the path during the second 'flattenpath' and rans out 
pf> of memory during this attempt.

bc> Hmmm... good point.  I guess, in my naivete, I had assumed that
bc> flattenpath would _replace_ segments in teh current path, segment by
bc> segment, and so if the path were already flattened it'd just go one for
bc> one and so not be any larger.  I guess it hadn't occurred to me that a
bc> flattenpath would, in essence, DOUBLE the number of your
bc> segments-in-use, since it'd copy from the old to a new one.  

THIS leads to a very interesting question :  Which internal representation
should one use for paths when implementing a "100 % adobe compatible"
PostScript-interpreter ?  If one uses a linear linked list, a implemantation
of flattenpath, that will behave as bernie guessed first is trivial. 
   Unfortunately we --and I guess "Imagen UltraScript" also ;-) -- have
chosen another approach : We representant a path as a vector (array) of
attributed points, where a not yet flattened bezier curve will occupy
4 consecutive points, a straight line segment 2...  So we have to copy
the path during the flattenpath operation.
  I wonder, which approach adobe has implemented.  Is there someone out
there, who is willing to test bernies code causing the limitcheck error
on an original adobe ps-machine ?  May be that the result will be of 
some interest to (for ?) other ps-clone developers also... ;-)
--
Peter Funk \\ ArtCom GmbH, Schwachhauser Heerstr. 78, D-2800 Bremen 1
Work at home: Oldenburger Str.86, D-2875 Ganderkesee 1 /+49 4222 6018 (8am-6pm)
>> PLEASE Don't send BIG mails (oversea) ! I've to pay for it : $0.3/kB
   Don't use the bang path of this news article for mails (They will bounce).
   Only the address 'pf@artcom0.artcom.north.de' will work. Thank You ! <<
Technical Details
Message-ID: <2066@artcom0.artcom.north.de>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!snorkelwacker!ira.uka.de!smurf!artcom0!pf
References: <56864@bbn.BBN.COM> <2064@artcom0.artcom.north.de> <56899@bbn.BBN.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!snorkelwacker!ira.uka.de!smurf!artcom0!pf
From: pf@artcom0.artcom.north.de (Peter Funk)
Newsgroups: comp.lang.postscript
Subject: Re: Multiple flattenpaths
Message-ID: <2066@artcom0.artcom.north.de>
Date: 5 Jun 90 03:55:49 GMT
References: <56864@bbn.BBN.COM> <2064@artcom0.artcom.north.de> <56899@bbn.BBN.COM>
Distribution: comp,world
Organization: ArtCom GmbH, Atelier f. Computergrafik, Bremen(FRG)
Lines: 44