Circles do not exist
nibblestew.blogspot.com
nibblestew.blogspot.com
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.
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.
I cannot imagine a CAD system that can't symbolically represent what is actually desired. The model and its spec should be one and the same.
Approximations also open the door to different precision versions. Not helpful when different parts from different sources need to be consistent.
Models that approximate/vary from the ideal spec, created intentionally to match manufacturing limitations, are ok.
For laser cutting, I prefer to use SVG, as it's easier to generate. I had not really thought about precision, but SVG can represent circles directly.
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.
Then it is settled, we'll use .TTF as our CAD interchange format.
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.
You are going to have a really hard time finding an industrial application where a 6.2e-8 error matters.
In fact, check this out: the Epilog Fusion M2 40 laser machine that the author chooses to picture as the problem instance can engrave a circle of at most 28-inch diameter, and has a resolution of 1200 dpi. Therefore two (gasp!) Bézier curves per quarter circle offers far more precision (4.0e-6) than this machine's error (1/1200/28 = 3.0e-5).
Edit: or take the world's roundest object: a sphere made out of a single crystal of silicon-28 atoms, with a roundness delta of less than 50 nanometres over a 93.6 mm diameter (https://www.heason.com/news-media/technical-blog-archive/wor...) This is an error of 5.3e-7. Four puny Bézier curves per quarter circle (6.2e-8) are more perfect than this sphere.
And while it's possible to approximate with higher bezier curves, PDFs are auto generated with software libraries and it's going to be non-trivial to dive into the guts of a library of a library of a library and tweak the logic for generating circles for this one specific type of application.
If you want a circle that's better than a 0.03% tolerance, odds are you're not making it by tracing a circular path in g-code, but instead using something like a lathe.
> And while it's possible to approximate with higher bezier curves, PDFs are auto generated with software libraries and it's going to be non-trivial to dive into the guts of a library of a library of a library and tweak the logic for generating circles for this one specific type of application.
A lot of work on CO2 lasers you do with something like Coreldraw or Inkscape. You absolutely can pick the number of vertices with some slight work.
Lasers are a bit weird in that most of their work is for signmaking. Most end-user use cases are closer to a printer than that of a typical CNC machine. Indeed, it can be annoying to take something from CAD to lasers that want PDF, because you can end up with things like the resultant PDF not joining lines together properly into one shape and the laser "stopping" on each vertex. You end up pretty carefully picking tools and processes for this flow. Ideally you figure out how to give the laser a dxf...
I can tell from this statement that you do not have a home machine shop with a manual lathe. Home machine shops most certainly do ~not~ typically (or easily) achieve micron accuracy.
For "circular" work that you do use a laser cutter for, 0.03% tolerances are below the variance you get from the cutter itself. Expecting higher precision from the cutter that is somehow "messed up" by the deviation from the standard Bezier approximation of a circle, when the machine you're using can't give you that precision is using that proverbial hammer.
Of course, if that's really all you have access to (first of all: what are you even doing? look into buying a second hand lathe, or have everyone pitch in so your hobby space can buy one, they'll set you back less than a thousand bucks) the laser cutting is step one, you're not done after cutting, and you know you're not done after cutting because you know laser cutters are not high-precision machining tools like lathes or mills. You cut slightly oversized, and then you clean up the part and machine it down to final dimensions until your micrometer says you're within tolerance.
What is this unit?
https://en.m.wikipedia.org/wiki/Thousandth_of_an_inch
A 1/10th of a thou is 1/10000th of an inch, or 2.54 micrometers. It's insanely small.
Why, America... At that point, if it's inventing new units to decimalise USC units, why not just use micrometres?
kibi : ki : 2^10
mebi : Mi : 2^20
gibi : Gi : 2^30
tebi : Ti : 2^40
...
Conveniently, these numbers are fairly close to 10^3, 10^6, 10^9, and 10^12 respectively (but with increasing error: 2^40 is almost 10% larger than 10^12, whereas 2^10 is only 2.4% larger than 10^3).This leads to a lot of conflation, mess, and misreporting by vendors and OS authors. Windows is an egregious example. A 1 TB (terabyte, 10^12) disk is reported in Windows as 931.7 GB. It ought to be 931.7 GiB, which is what Linux does. macOS uses the correct number but SI prefixes, so 1 TB is reported as 1 TB.
https://eepower.com/resistor-guide/resistor-standards-and-co...
So the metric system and decimalization of the inch are roughly contemporaneous and “just use this othe, also brand new system” isn’t an obvious choice at that point.
I think the real question is... Why is such a unit still being used? I was under the impression that any serious ultra-precise CAD and machining was done in milli, micro, and nanometres. I thought pretty much any serious science or engineering had been metricated...
But then again I shouldn't be surprised; Americans measure the volume of lakes in 'acre-feet'...
Don't try to logic how Americans measure things.
Hopefully anyway.
Pdf is for print and human eyeballs. It's brilliant for those 2 things and not much else.
You can have both in parallel, and have the editing software regenerate the rendered form from the source data form when anything changes. It’s not completely uncommon to use PDFs as a data carrier that way.
Of course the drawing could then be out of step with the data, but so what.
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.
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!
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?"
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.
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.
If all the lines were off, then yes, kinda. Ish.
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...
EDIT: apologies for the tone; came off very snide on second read.
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.
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.
What about them?
Light cones/the 4d-radii of causality are* perfectly spherical.
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).
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.)
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.
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.
For a given circle and DPI, one can figure out the minimum number of Bezier curves necessary to represent the circle such that rendering those Bezier curves out to pixels will get you the exact same result as having rendered the circle in pixels directly.
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.
> the Bézier inaccuracy has nothing to do with rasterization
Obviously, because rasterization refers to pixels and has nothing to do with Bezier curves. On the other hand, that inaccuracy has everything to do with Bezierization.
> there's a base level inaccuracy and then your rasterization brings a whole new, different inaccuracy into play.
Yes, stacking two inexact transformations will result in more inaccuracy than a single one.
Since you seem to be attached to your analogy - it's more like a person making the argument that humans can't fly unassisted, while showing a picture of a pig as an example of flying, and I'm pointing out that pigs can't fly either.
Does any one have a link to a perfect circle, I'd love to see if it has the proposed effect on me.
(Maybe a cheap, single-use plastic cup would be smooth enough and stiff enough and round enough, given the production process.)
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.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.
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?
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.
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).
A spinning movement has to be a perfect circle, no?
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.
Don't be so irrational.
An oscillating display can do curves, but only in a wave/ linear sequential fashion.
Yes, this is theoretically possible. I imagine it wasn't done due to processing limitations during the time vector displays were common; but my limited knowledge in the realm doesn't give me certainty.
[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.
Thanks for your efforts.
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.)
It followed PostScript which was a programming language that was intended to be directly undertood and runnable by Postscript enabled printers.
Postscript could easily do the job here, it had "arc" drawing primitives that described circles (both full and partial).
The 'failure' of Postscript was that as a programming languge a bad .ps job could crash a printer and a 1,500 page .ps document had to be internally fully rendered just to print out page 73 only (potentially code on any 'page' could loop back or forward and generate image elements on any page).
As a not-quite PostScript simplified 'other' the PDF formal languaage spec only allows the drawing of lines and 'curves' and curves are explicitly 3rd order bezier splines.
See: Path Operators (Page 95)
Portable Document Format Reference Manual (230 pages)
https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandard...
You don’t have to look for long on YouTube to find videos showing lathe tolerances of ten mil or lower.
And things like bearing races, where imperfections are a common failure mode, are turned for polishing if nothing else.