Mathematical solution for circles on larger scale

Hello .
The problem i would like to talk about , you can see on the picture .
The circle has a circumference about 1km . Radius = 160000 mm exactly and is drawn by polygon of 1000 sides.
However the hexagon doesn’t fit ,which is problem of dividing between 10 and 6 . When you create the circle by polygon
of 720 sides for example , the problem disappear .
I would like to know ,or ask people who wrote the language of sketch up , what method of calculation is used in
both cases , and also i would like to offer a mathematical solution to make it accurate even if the circle is set for 1000 sides . Of course this must first take a simple test. Is there anyone who would like to try to apply my equation into sketch up language? Also if this my equation would work , it would solve many more problems as i have read few others topics and in other way ,sketch up would be the first soft ever who would have this solved.

Thank you .
regards Tomas

ps:sry for english, not my native language.

I don’t see the problem, so correct me if I’m wrong.
You see the segmented representation of two different circles (1000 sides and 760 sides or whateven number of sides). What they have in common is the circumscribed circle with its known radius. Their segment endpoints therefore are all positioned on this circle. Their segments cross.
In ‘Entity Info’ you also see the true circumference in length, not sum of all segments.

1 Like

Thats the problem , “true circumference”
it is not true circumference ,but probably circumference calculated by number Pi . If you understand deeply problematic of
calculation of number Pi . There are few logic things . Circle has a finite circumference , by Pi you can’t ever reach absolute accuracy - its always smaller . As you can see on that picture as well , its clear that the circle should be a tiny bit larger to match the corner of the hexagon . Another thing and problem with number Pi is that ,if the circle has a finite circumference ,the length you missing to the end becomes as a constant , therefore no matter if you use trillions of decimals of number Pi , you can’t get any closer to the circle over certain decimal. All want is a test .

I still don’t get it.
A circle has an exact circumference. Can we write it down with all its decimals? No. But as with many things in daily life we aggree to accept a value with some decimals to get it accurate enough.
What is SketchUp doing wrong? Please attach images that clearly explain the point you are trying to make? I can’t tell from the one in your first post.

I think I see the problem, and a couple of solutions. A simpler test case:

  1. Make a circle, 50 sides, inscribed radius 10m, created at the origin, and drag along the red axis.
  2. Make a hexagon, from the origin, only very carefully make sure you don’t finish at an end point of one of the circle segments, or even midpoints. Type 10m Enter to have it make the same inscribed radius.
  3. Zoom in to where the hexagon endpoints are. You’ll see that it goes beyond the edge of the circle.

So, the very easy solutions are that you either also drag along the red axis, or, instead of typing the value of the inscribe radius, you use an endpoint in the circle as inference. You end up with the same inscribed radius, but it does fit in exactly the same space as the circle.

look my friend , i try to tell it a bit different way .
I didn’t come here to argue about number Pi. I came here with my free and good will to solve the problem you see on that picture . The question is , are you willing to maybe make some progress ,or you want to stay on the same level ?
I am not telling that the sketch up is doing something wrong . I love sketch up , thats why im here.
You didn’t respond to my topic. Is here anyone who would like to try to apply my math into sketch up to try to solve the problem on that picture? Thats the question ,if you are not willing to do that,whats the point of keep answering . Instead of calculating that circle by number Pi , try this result please
this result for that circumference 1005333.333333333333333333 , then make the hexagon with length 160000 and check closely those corners ,and let me know the result. Thank you.

Circle, Arc, and Curve entities are represented by contiguous line segments in SketchUp.
Controlling segmentation and resulting endpoint orientation is an important aspect of creating a clean model.

Example:
All endpoints of a 1m r. 5-seg Polygon will align with endpoints of a 1m r. 10-seg Circle.
However, all endpoints of a 1m r. 5-seg Polygon can never align with endpoints of a 1m r. 12-seg Circle
Yet in either case, the radius as displayed via Entity Info is correct.

Obviously, the sum of all segment lengths can never equal the true circumference or arc length.
Notice Entity Info does not display Circle circumference or Arc length.

1 Like

by calculating circumference by number Pi ,you will always get inaccurate and smaller result . Therefore if you divide smaller result you will get smaller segments . I have different solution how to count the circumference with absolute accuracy ,so the segments would be perfect…

Did you try my inference solution? By using that you’re effectively asking SketchUp tom solve the arithmetic problem for you.

As Geo said the point is to reach clean model at any circumstances . as i said before " by calculating circumference by number Pi ,you will always get inaccurate and smaller result . Therefore if you divide smaller result you will get smaller segments" … this is not visible on smaller scale , because we are close enough by number Pi , but as you get on large scale then it is . I do not try to insult sketch up creators . This problem have every program which is using Pi .
But if my math would work sketch up would be the first one on this planet who could have it . I don’t want anything, i mean money - just the result an prove for me , so is not worthy to try it?
Colin , thank you for answer , but my point is getting much deeper . We use Pi over 2000 years.

Colin, your solution to what?
If you know waht this is all about, then please explain what @tomas is after? SketchUp seems to be correct whether at small scale or at large scale.
One needs to know what ‘Entity Info’ displayes. Otherwise there will be confusion about accuracy of circumferences.

If I understand it right, Tomas is saying that by using Pi in calculating circles you are bound to have an error, because Pi has an infinite number of decimal places. By using a number that is almost Pi, you can get results that look the same, but where numbers can divide into each other more readily.

There is a big flaw in the idea, in that computers don’t calculate that accurately anyway, and a fixed number of decimal places will still run into problems.

That aside, the goal is to by able to make a circle of a given radius, and a hexagon of the same radius, and have it that the hexagon doesn’t go beyond the edge of the circle. My suggestion to use inference solves that, and ends up very much like SketchUp was using the almost-Pi value that Tomas is proposing.

If that’s the goal then no matter what, if the radii are equal then the number of segments are equal or the circle has Integer x segments of the polygon. There’s no other way.
In general (for different nr. of segments of circle and polygon): place the second clicked point on a midpoint of a circle segment (shortest distance to the center) and all other points will be within the segmented circle But radii will be different. Any other clicked point on the segmented circle will result in crossing segments. (see special cases above: integer x nr. of polygon segments)

I wrote a toolset ages ago…
It can find tangents and other geometry points, intersections etc by adding guide-lines/points.
It has a Plugins sub-menu item, ‘Tangent-Tools…’.
It provides 5 functions - ‘true tangents’, ‘common tangents’, ‘true intersections’, ‘tangential arcs’ and ‘fillet arc’.

See this:

2 Likes

I don’t know what method is used, but in the first case (1000 edges), for example, I would iterate through the integer values of 0, 1, 2, etc. all the way up to 999. For every integer value (call it ‘n’), I would calculate each angle by: A = n * 2 * PI / 1000 and then use each intermediate result to calculate the x and y values (using either trig or vectors). This approach eliminates any inaccuracies caused by cumulative error.

You’ve already answered the question but miss-stated the problem. Both the 1000 side polygon and the 6 sided polygon are exactly circumscribed by the 160000mm radius circle, but the 6 sided hexagon doesn’t fit exactly within the 1000 sided polygon (and never will) because of the “problem of dividing between 10 and 6” evenly.

Yes, exactly. Because the 1000 / 6 = 166.66666666… becomes 720 / 6 = 120 which means that every vertex of the hexagon exactly coincides with every 120th vertex of the 720 sided polygon. Both are still exactly circumscribed by a mathematically defined (i.e., infinite sided) circle with a 160000mm radius. The issue of Pi being a transcendental number don’t enter into it.

This has already been explained several different ways by Wo3Dan, Colin, Geo, and TIG (I honestly don’t think that you are listening to their explanations).

One more approach … create a 1000 sided polygon with a 160000mm radius by dragging the cursor along the x-axis. Then create a hexagon the same way. Now zoom in and compare the length of the first segment of the 1000 side polygon to the length of the last segment. If they are the same, then there is no calculation error regardless of how the polygon was created. Also note that the hexagon exactly coincides with the first polygon:

One more thing, if you click on each of the polygons, you get the true radius and true circumference of the circumscribed 160000mm radius circles:

BTW, my calculator says that the circumference is (approximately) 1005309.6491487338363080458826494mm. If I wanted to know the true length of the arc between two adjacent vertices, I divide this number by 1000 and get: 1005.3096491487338363080458826494 which is (approximately) 0.00661514873383630804588264944092mm longer than the chord formed by the same vertices.

I would be more than happy to try this for you. Can you please elaborate?

1 Like

I created a 1000 sided polygon using a circle with a 1005333.333333333333333333mm circumference:

Needless to say, I used Pi to calculate the radius to be 160003.76945505211089298442372552mm and then used this value to construct the polygon (remember, the geometry displayed is not a circle).

Are you trying to circumscribe a hexagon with another polygon? You do realize that this is a totally different problem than what you’ve described?

1 Like

Okay, I did as you asked. Will you humor me and do something for me now?

Create a 1000 segment circle with a radius of 160000.701838mm and then create a hexagon using 160000mm and let me know the results. Thanks.

Seems to me no one has made the simple point that in SketchUp a circle and a polygon are essentially the same thing.
They are both really polygons, but the circle is also an special ‘arc-curve’ and so it extrudes smoothly in a PushPull and FollowMe…
You usually give a circle a lot of sides so it appear relatively smooth.
Both circles and polygons are both made of segments ‘welded’ into the perimeter geometry.
The outermost ‘nodes’ of those are on the circumference at the radius distance from the center.


Do these steps.
Assuming the polygon is to be a hexagon, i.e. with 6 sides…
Make a circle with 12s ‘sides’ - use a relatively small number that is a multiple of the sides of the intended polygon - here 3, 6, 12 - because any more makes the subsequent snapping actions more finicky.
Make a group of it - to stop it interacting with other geometry - at least until you’d like it to…
Make a polygon centered on the circle by inference, that has 6 sides, snap its circumference/radius to one of the visible ‘nodes’ on the circle’s circumference - i.e. where the faceted perimeter is at the radius and circumference position.
The polygon and the circle should now overlay, and have the same radius.
Now edit the circle’s group and select the circle [i.e. just its edges] and use Entity Info to change its segment count as you wish, e.g. usually this’ll be to something higher, BUT remember always to use a multiple of 6, otherwise the ‘nodes’ in the circle and the hexagon will go out of step.
Explode the circle’s group if you want it to interact/merge with the polygon.
You can do this with any polygon, e.g. with 7 sides made the circle with 14, and with 5 sides use 10 or 15…

1 Like