235 points · by ingve · 3y ago · 207 comments
The human eye is not capable of seeing the difference, and, as the OP mentioned, most people can't accurately eyeball a perfect circle anyway.
This post shows the math behind that, and then shows that it could be made even better with a few different choices.
https://spencermortensen.com/articles/bezier-circle/
P.S. of course, a display intended for the human eye has much looser tolerances than a gear or wheel.
For example, you can make a shaft that fits in a hole like a spring because it can slide freely but air can't get out and you can shave a few microns off and it will sink into the hole at a controlled rate. This is all easily achievable in a home machine shop on a manual lathe. With Wire EDM, you can achieve even tighter tolerances and it would be perfectly possible to generate a part that could fit but could not spin because of the PDF error.
Al you need to fix this is use rational Beziers - same thing but with weighted control points.
STEP files will remain the standard for CAD.
What is this unit?
1. PDF is to become a standard CAD interchange format.
2. Using PDF where 0.03% matters is insane.
3. If CAD requires 0.03% tolerance, then using PDF as a standard CAD interchange format is insane.
I would imagine you generally want arbitrary precision for CAD.
Hopefully anyway.
Pdf is for print and human eyeballs. It's brilliant for those 2 things and not much else.
If you want to produce a highly regular circle in Inkscape, draw a polygon with many nodes (say, 24), convert it to path, then make all nodes smooth and symmetric.
This is true for curve fitting of arbitrary curves, not just circles, though arbitrary curve fitting is a bit tricky (it requires solving quartic equations). I personally think you can take this as evidence that cubic Béziers are "good enough" for all practical tasks requiring curve representation, though for specific applications there might be other representations that work better.
When you print to PDF, the circle will have to be approximated, which is what the article is talking about.
The raster image won't be a circle, it'll be a circle projected onto a square or rectangular grid. But, just like with the Bezier curves, nobody will notice. I remember the first week of Geometry, they told us that the drawings of squares and circles and whatnot printed in the textbook are not intended to be accurate, so don't bother measuring them to get the answer. The circle represents a circle, it is not a circle.
Wait til I tell you about this painting of a French pipe I saw one time.
I considered, and to this day consider, inaccurate figures in textbooks to be sloppy job by lazy people. Sure, measuring the solution off a drawing is (in math classes) missing the point of the exercise, but at the same time, humans process knowledge holistically, so inaccurate drawings will interfere with gaining an intuitive understanding of a problem space.
I mean, if you were using software to chart some data you want to "get a feel for", would you be fine with software introducing arbitrary errors just because "Ceci n'est pas une pipe" or whatever?
Sometimes it's not about being accurate, sometimes it's about the figures in the textbook representing unrepresentable, impossible situations on whatever geometry you're operating on. say euclidean geometry. Casual things like triangles where the sum of internal angles doesn't match π. Triangles where the sum of length of the two smaller sides is larger that the larger side.
Being able to reason about what are supposed to be the constraints of a otherwise impossible system is valuable in itself.
Jean-Paul Sartre was sitting in a cafe when a waitress approached him: "Can I get you something to drink, Monsieur Sartre?" Sartre replied, "Yes, I'd like a cup of coffee with sugar, but no cream". The waitress left, but returned a few minutes later and said, "I'm sorry, Monsieur Sartre, we are all out of cream -- how about with no milk?"
There was a Greek bloke who had a thing about perfection and geometry. Eclad or something similar (OK: Euclid).
At what point does the perfect approach reality or vice versa?
The pipe in question might not be French - the painting was painted by a French person but you cannot imply the country of the pipe itself on that basis without additional evidence!
I don't think many laser cutters use raster scanning, though. That's going to leave some really nasty artifacts. You really want to cut continuous lines like, well, lines.
Respectfully, I don't think you're limited by the PDF format if you're talking about a laser cutter. And... Circular motion doesn't spring forth naturally from gantry CNC laser cutters -- they're rectilinear in design. It's circles not existing all the way down.
Using it as a CAD format with inherent fundamental shapes missing seems kind of funny, though.
Plus, if that level of accuracy is required simply adding more nodes improves accuracy exponentially.
Not least, the “standard” approximation really should be updated in software, as modern 4-node approximations are down to 0.005%, almost an order of magnitude better.
If you got a machine that's accurate to 1200 dpi presumably you want 1200 dpi and not 600.
According to another comment, it actually improves at O(n^6).
I sincerely hope that the upcoming Windows third-party print driver deprecation kills this.
(Also, what’s wrong with them? Even ignoring cost, I would rather have a Chinese printer that had a publicly known control interface and supported Lightburn than a “nice” American laser printer that was only operable with bad proprietary software.)
When you're cutting things on a laser, there's myriad sources of error. Odds are the optical path isn't completely square, so there's some cross coupling between axes. There's drive belts. The laser is often pulsed. There's taper.
Now the postscript to servo control program(g-code?) interpreter might use the same bezier curve approximation, but it might not. I think if it were a formal complaint they would have to positively assert that their machined circles are following an inferior profile rather than just assume they are.
g-code sort of sucks as a language. It is very primitive. I always thought it would be cool to have a postscript dialect that supported more than two axis to use as a low level language on computer driven machine tools.
[1] https://www.penpapernomographic.com/pdf/smith-chart.pdf
[2] https://github.com/pgf-tikz/pgf/issues/817
[3] https://camo.githubusercontent.com/0cc44db2e367356629d897c10...
Further: There are no circular (2D) molecules; nature prefers hexagons and other polygons for that. Even the proton isn't perfectly spherical. Whether the electron and other subatomic particles are perfectly spherical cannot, as yet, be determined. (The electron seemingly has a diameter far below the Planck Length.)
There are no very large circles or spheres, either. All astronomical bodies are somewhat flattened.
So I dare say perfect circles and spheres do not really exist, save as idealized mathematical objects.
According to what? We have nothing that can measure anything close to that. The standard model doesn't predict any radius on the electron, just defining it as point-like.
> Whether the electron and other subatomic particles are perfectly spherical cannot, as yet, be determined.
How can we ever determine something to be perfectly spherical? Any measurement comes with finite precision, and maybe the thing is actually not a sphere if we measured with more precision?
All measurements we have done on the electric dipole moment of the electron suggests that it could be zero. (The standard model predicts it to be non-zero, but very very very small.) This suggests that the charge distribution of the electron is spherical (or very very very close to).
That is: every real, non-theoretical Point must have a size, a resolution; and every non-theoretical straight Line is surely not a true straight line if we zoom far enough down into sub-atomics.
Light cones/the 4d-radii of causality are* perfectly spherical.
What about them?
EDIT: apologies for the tone; came off very snide on second read.
As clarification, once the data goes in to a pdf it is a pain to get out again for further processing. Not impossible, but the format is clearly designed to put shapes on paper. anything more and you have to fight for it.
What would you put at the top?
.PS is pretty fancy, although, just because it is probably saying “this is basically a PDF but from the olden days.”
(I assume when you wrote "most reassuring" you were instead interpreting it as a comic about the file types' ability to accurately hold the information a user wants them to hold, because "reassuring" as pertains to the comic's actual meaning would be completely irrelevant to this topic of whether or not PDF makes a good interchange format.)
REPEAT 360 [FD 1 RT 1]
But alas, circles did not exist! It is easy to realise that the above code does not attempt to draw a circle. These instructions specify a triacosiahexeacontagon instead.Screenshot: https://susam.net/blog/fd-100.html#circles
Anyone have a reference for this?
From reading this, the error with circles appears to be <1%.
Also, obligatory mention whenever horizontal-vertical illusion comes up: https://www.nippon.com/en/japan-topics/c12403/
G codes in fact have command for arcs.
G02 establishes a mode for clockwise circular arcs. G03 establishes a mode for counter-clockwise circular arcs.
So... you know... note to self... when designing a laser cutter, allow the user to upload G-Code.
That said, apart from a handful of misconfigurations, I've never had a problem getting any of them to cut out nice circles.
Time Cube's ineffable Truth.
'Cubeless Word' is not Truth.
Word justifies all human evil.
Time Cube is a test for Truth.
Circle measure is slop bucket.> "This is why you're taking less field work? Because you're reading 'On Circles, Volume 12'?"
> "I wrote it."
> "Unsurprising."
> "I have to rewrite it. All twelve volumes [...] our physics framework was completely wrong!"
> "Even about, like, circles?"
> Ikora turns to look Chalco in the eye. "Especially about circles."
[0] https://www.ishtar-collective.net/entries/vesper-of-radius
But did you know that one of the cases PDF is being considered (and, based on Internet rumors, is already being used) is as an interchange format for CAD drawings? Now it suddenly starts mattering.
Not really? It's considered as an interchange format, not as the interchange format. If you have CAD/CAM work for parts that need precision machining measured in tenths or less, you're not using machines that accept PDF to begin with.Not something most people notice unless they are looking for it.
I remember the Q3A Beziers were advertised as if the game rendered actual Beziers (which would in principle be possible in software but not on hardware… of the day, anyway), rather than just doing dynamic LoD approximation with your bog-standard triangles!
facepalm. A raster image can't express a circle either - it's also just an approximation.
Same thing with a printout, for that matter. Maybe you could claim some kind of radial plotter is a true circle, but even there we're talking about pigment being absorbed along individual paper fibers.
In reality, all the mathematical shapes are just abstractions to be approximated.
One approximates the circle to the limit of the chosen resultion, the other simply has an error. A small error, but an error nontheless.
You're not wrong, but it's like someone showing proof that a person can't fly unassisted and then responding with "well dogs can't meow".
They're saying that your arc for your circle will be incorrect before it's ever put into a concrete implementation. In other words, there's a base level inaccuracy and then your rasterization brings a whole new, different inaccuracy into play.
So yes, my "wacky analogy" is exactly apropos here.
Does any one have a link to a perfect circle, I'd love to see if it has the proposed effect on me.
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?
Is a 360° arc not a circle?
%!PS
/newpath
100 100 50 0 360 arc
stroke
showpage 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. In 1952 I spoke of the civilization of make-believe, the one we must shake off, myself, the the first of all! I spoke of columns of gray men on the march toward sterility and self-destruction.
The same year I used the term "transautomation" to show the way beyond the rationalism of technocrats toward a new creation in harmony with the laws of nature.
In 1953 I realized that the straight line leads to the downfall of mankind.
But the straight line has become an absolute tyranny.
The straight line is something cowardly drawn with a rule, without thought or feeling; it is a line which does not exist in nature.
And that the line is the rotten foundation of our doomed civilization.
Even if there are certain places where it is recognized that this line is rapidly leading to perdition, its course continues to be plotted.
The straight line is the only sterile line, the only line which does not suit man as the image of God.
The straight line is the forbidden fruit.
The straight line is the curse of our civilization.
Any design undertaken with the straight line will be stillborn. Today we are witnessing the triumph of rationalist knowhow and yet, at the same time, we find ourselves confronted with emptiness. An aesthetic void, desert of uniformity, criminal sterility, loss of creative power.
Even creativity is prefabricated.
We have become impotent. We are no longer able to create. That is our real illiteracy.
- Friedensreich Hundertwasser, "Mouldiness Manifesto: Against rationalism in architecture"Just like how cows don’t look like cows on film![0]
Holy forking shirtballs - NO!
The article rightly make a nice concise case against it.
I'd add from my experience: perhaps PDF people think this would be a cool way to make more money, but only because they have not done any CAD/CAM/CNC work. Since I do CAD/CAM/CNC as a regular part of my work, and have spent time with PDF back to it's early days, that is a hard NOPE.
But definitely a good nominee for the Bad Ideas Hall Of Fame, at least honorable mention.
sheesh.
https://factmyth.com/factoids/there-are-no-straight-lines-or...
On that note, circles are rare on machine tools as well, if it is not a lathe(or rotary table) it will have to approximate a circle via a set of linear movements. Nothing wrong with this, modern machine tools can generate very good circles, often better than the rotary table, due to the additional error introduced by having another axis.
"To travel a circle is to journey over the same ground time and time again. To travel a circle wisely is to journey over the same ground as it is for the first time. In this way, the ordinary becomes extraordinary, and the circle, a path to where you wish to be. And when you notice at last that the path has circled back into itself, you realize that where you wish to be is where you have already been ... and always were."
> The arc is represented internally by one or more cubic Bézier curves (see curveto) approximating the required shape. This is done with sufficient accuracy to produce a faithful rendition of the required arc. However, a program that reads the constructed path using pathforall will encounter curveto segments where arcs were specified originally.
But that's a rendering implementation detail, no? Isn't the precision and accuracy of any digital or physical manifestation of a circle limited by implementation details and physics?
And, in fact, even if they did exist physically, the very fact that the concept or predicate of Circularity exists in the intellect (and this concept must be Circularity as such or else we could not speak of circular things) and applies to many things despite their diversity, also suggests something about the intellect, namely, that it is not physical, as the physical is always concrete, instantiated, singular, this-and-not-that, not ideal.
But I am not certain that is your criticism, or that this applies here? Platonism posits a third realm of ideas, one which Aristotle denies and attacks (and which Plato acknowledged), instead locating universals in things and in the intellect that grasps them. However, you can restore a kind of realm of ideas by interpreting it as (the mind of) God. So, universals exist in all three cases, though the manner in which they exist varies (e.g., in things as concrete instantiations, vs. in the human intellect as concepts abstracted from the concrete).
But I don't think that is right. He argued that matter existed in a relation of participation in the forms, that making such things like shadows or approximations of ideas. Aristotle deployed the third man argument to attack this notion. Plato conceded his view was problematic.
A spinning movement has to be a perfect circle, no?
Don't be so irrational.
An oscillating display can do curves, but only in a wave/ linear sequential fashion.
[0] https://www.bricsys.com/en-us/blog/the-bezier-curve-how-car-...
(Original page seems to have moved; it is now here: https://www.web.imperialclub.info/Repair/Lit/Master/003/inde... )
All we have is approximations right?
Lathes do circles all the time. But it would be difficult to rotate either the head or the bed around an arbitrary axis in order to print a proper circle.
Of course any physical machine is only making an approximation of a circle (even a lathe doesn't turn perfectly round, there is no such thing), but at least for CNC and 3d printing you can specify a perfect circle. In PDF you can't.
(Yes, it is also true that a typical 3d print comes from an STL file, which can only specify triangles, so STL files also can only specify approximations of circles. But it is still true that most 3d printers run G-code, not PDF.)