6 ms·
If you use the standard way to approximate a circle with Bezier curves, it will differ from a true circle by about 0.03%. The human eye is not capable of seein
by neilk 3y ago
If you use the standard way to approximate a circle with Bezier curves, it will differ from a true circle by about 0.03%.
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/ 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.
- jprete 3y agoI think the OP is really just frustrated with the idea that CAD will use PDF and, in that application, 0.03% deviation can be too much.
- klysm 3y agoUsing a PDF where 0.03% matters is insane no?
- anamexis 3y agoYes, that's the point. 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.
- Nevermark 3y agoAbsolutely! 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.
- wombatpm 3y agoDrawings for parts should have tolerances called out. I did mechanical inspection for a manufacturer for several summers. Every dimension had a plus/minus value listed. Holes and screw threads had go/no-go gauges
- Aardwolf 3y agoBut could the CAD use more than 4 control points to approximate the circle better?
- microtherion 3y agoBut is PDF really the standard CAD format for communicating with machines? 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.
- erhaetherth 3y agoUsing PDF as a standard (for anything) is insane. I mean it was nice before Adobe backpedaled and tried to milk it for everything and now the format is anything but portable.
- TheRealPomax 3y agoif being off by 3 units on a 10,000 unit circle actually matters, you have stricter requirements than most industry bodies. If you're fabricating parts that have tolerances measured in 1/10th of a thou, the machines you use absolutely don't ask for PDF, they ingest proper control code.
- phkahler 3y agoControl code generated from a CAD model, not a .pdf. 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.
- akira2501 3y ago> Al you need to fix this is use rational Beziers - same thing but with weighted control points. Then it is settled, we'll use .TTF as our CAD interchange format.
- jrockway 3y agoDoes STEP not have circles? Because g-code has G2 which seems like it should draw an actual circle (G2 X0 Y0 R100 or similar).
- yetihehe 3y agoSTEP has circles and arcs. It's only PDF that's missing them.
- shalmanese 3y agoIt absolutely matters. The type of fit you get between a shaft and a hole differs on the order of 5 - 10 microns [1]. A micron is 0.01% of a cm so 0.03% can consume a large portion of your tolerance budget. 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. [1] https://en.wikipedia.org/wiki/Interference_fit https://en.wikipedia.org/wiki/Interference_fit
- deleted 3y ago[deleted]
- maxerickson 3y agoSeems like the real actual data would just be embedded inside the pdf. Hopefully anyway.
- laserbeam 3y agoI don't think you can represent arbitrary data in a pdf AND have pdf viewers actually render it. If the pdf format screws precision (and I'm not surprised it does, it screws paragraphs and often only contains metadata to reconstruct lines of text), it should not be used as a data interchange format. Pdf is for print and human eyeballs. It's brilliant for those 2 things and not much else.
- layer8 3y ago> I don't think you can represent arbitrary data in a pdf AND have pdf viewers actually render it. 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.
- maxerickson 3y agoIf I was dead set on using pdf as an interchange format, I'd make the standard that the pdf content was a drawing of the data and then also embed a better representation of the data. So a well formed file can be previewed with any pdf reader, but no problems with data quality when you go to use it for something. Of course the drawing could then be out of step with the data, but so what.
- nine_k 3y agoIf a Bézier-based circles with four nodes are too rough, I suppose a circle with 16 or 24 or 128 nodes can be made smooth enough to exceed the laser cutter's margin of error. 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.
- itishappy 3y agoLike floating point errors, the representation can (in theory) be as precise as we like but that's not something most users are willing/able to adjust.
- raphlinus 3y agoThe actual formula is O(n^6) scaling, and for circles it's very easy to achieve that. So a circle divided into 16ths has 4096 times less error than one in quarters and one made of 128 nodes is a (binary) billion times better. 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.
- hwayne 3y agoOr just use the ellipse (E) in Inkscape, set the start/end to 0, and hold down ctrl. Then inkscape will generate a `<circle>` svg element.
- oniony 3y agoBut the SVG in Inkscape is not a PDF on a machine that accepts PDF CAD drawings. When you print to PDF, the circle will have to be approximated, which is what the article is talking about.
- hwayne 3y agoThe article was about postscript, but the comment I was replying to was about how to approximate a circle in Inkscape, so I suggested a better approach.
- robocat 3y ago> most people can't accurately eyeball a perfect circle anyway. https://lessonstream.com/the-story-of-mr-os-circle/ https://lessonstream.com/the-story-of-mr-os-circle/
- wnoise 3y agoThe first "better" approximation, while having a better "max distance" (0.019608% vs 0.027253%), has a _worse_ span between min and max (0.039216% vs 0.027253%), which probably matters for some applications.