4 ms·
"The only primitives they have are straight line segments, rectangles and Bézier curves. The only way to create a proper circle is to have a raster image like t
by Puts 3y ago
"The only primitives they have are straight line segments, rectangles and Bézier curves. The only way to create a proper circle is to have a raster image like the one above."
Is this really an accurate conclusion? Just because there are no primitives for a circle – postscript is still a programming language so you can also plot a proper circle with trigonometry?
- CharlesW 3y ago> Just because there are no primitives for a circle… Is a 360° arc not a circle? %!PS /newpath 100 100 50 0 360 arc stroke showpage
- Puts 3y agoYes, but as someone else commented the arc is internally based on bézier curves. How accurate thee circle would be by plotting is probably dependent on the trigonometric table built in to the postscript interpreter, but at least it would be mathematically possible to make an accurate circle where it's actually not even possible to express a perfect circle with bézier curves.
- retrocryptid 3y agoIn theory you could, when you were converting from PS to G-Code NOT emulate the arc with bezier curves, but convert them into g-code circles. This would likely cause the laser cutter to cut something that looked SLIGHTLY different than the rendered PDF. But anyone who's worked in the field long enough knows that WYSIWYG is a lie (albeit a very useful lie.)
- Puts 3y agoDon't get me wrong. I'm not questioning the usefulness of béziers. I'm questioning the authors notion that postscript inherently is incapable of expressing accurate circles just because the language don't have built in primitives for them. :)
- ks2048 3y agoIf I put that through ps2pdf and remove compression, I can see: stream q 0.1 0 0 0.1 0 0 cm /R7 gs 10 w 0 G 1500 1000 m 1500 1276.14 1276.14 1500 1000 1500 c 723.859 1500 500 1276.14 500 1000 c 500 723.859 723.859 500 1000 500 c 1276.14 500 1500 723.859 1500 1000 c S Q endstream i.e PDF has no arc command, it was converted to "c" bezier curves.
- CharlesW 3y agoThat appears to be a rendering/conversion artifact since PDF also supports 360° arcs. My question is, mathematically, is a 360° arc not a circle? (I understand that once a circle is rendered or physically manifested, it's an approximation.)
- ks2048 3y agoDo have a reference for PDF supporting circular arcs? I'm looking at the PDF reference manual and do not see it under list of path construction operators.
- CharlesW 3y ago> Do have a reference for PDF supporting circular arcs? No, I could've sworn PDFs supported arcs but I was wrong. :) So when rendering/converting PostScript to PDF, circles/360° arcs must be converted to béziers.
- Pxtl 3y agoAlso, I'd wager that you could get something closer to a circle with a naive bezier implementation than with a naive raster implementation, as long as you were willing to spend as much resources on storing curve nodes as you would on raster data. I mean, it's not like a rastered circle would make a good wheel either considering that technically every line on it is orthogonal.
- masfuerte 3y agoI was under the impression that the postscript in a pdf isn't a programming language. It is pre-executed so that only drawing primitives remain. But I could be wrong.
- kevin_thibedeau 3y agoNowadays PDF has JavaScript so sky's the limit.