DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Centre of Approx Sphere - best approximation?

Started by samdavo, June 06, 2014, 07:16:23 PM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

samdavo

So suppose you have found a drawing of a part of an approximately spherical shell, - and quite incidentally it happens to remind you of the Sydney Opera House :) - and you want to find the best approximation for the centre of said sphere.

PS.  I'll put this on "Looking for Help", although to be honest, I am confident I would get there in the end, and I am more interested in any lateral-thinking tricks that people might use.   

I tried red and green and cyan(blue) circles and planes and lines through centres of said circles - but am confident there's a better way.
cheers

samdavo

#1
I suppose you could assume that the curved lines on the elements of the shell are lines of
a) latitude (which are of limited use) and
b) longitude (which are all circles having centres at the centre of the sphere).

I was really trying to use the points ABCD (EF) somehow -

i.e. Put in a more general way,  how do you find the centre of a sphere which passes through 4 points?  (ABCD).

PS There's a second question I guess = how best to average 3 estimates to get the best centre , i.e. three estimates that result from ABCD, ABCE  and ABCF.   or maybe just the best estimate based on all 6 points at once?

prl

Quote from: samdavo on June 06, 2014, 07:16:23 PM
. . . and I am more interested in any lateral-thinking tricks that people might use.   

I'll need to study the DesigCAD spheres but I was thinking somehow that surface normals of the the facets should all be converging on the sphere center somewhere.  I think we could create some DC fun if we created the SOH spheres in 3d, first showing their fully overlapping sphere geometries then slicing them to get the "yellow book".  Maybe a few renders along the way or a made-for-DesignCAD movie. Then we create a DC "yellow book" 2d drawing from our own 3d work.  Then we . . . .  Darn Sam, you know it isn't winter here anymore.


samdavo

#3
ahh m8, sorry - why don't we make it easy and just do the centre of the circles formed by the lines of longitude :)

As for doing two such estimates - you could just use the midpoint of the line between them.

Better would be three estimates, and somehow averaging them - I am reminded of old-fashioned "Nautical Navigation" Star-sight methods, where you get three curves on your map/chart (known as a "tophat"  or "witch's hat")  based on the three directions of the stars used for the exercise.   And you choose the centre of that triangle to get your best estimate.

I thought I would be able to get a small solid based on subtracting spheres centred on ABCD(EF) ,  - and choose the CG of said "remaining solid"  - but have given up :)

I also thought that the sphere passing through A B and C (another method)  would be centred on a line normal to that plane, and through the centroid of the triangle.   You could draw that normal to that plane.    And likewise draw the normal to the plane of ADC,  BDC and  etcetc.   However, none (or not all) of these meet as far as I can tell (!?)  So I couldn't work out how to average their intersection points.

Seriously, I can guess "close enough" (eg lines of longitude) so don't feel obliged.

Of course if there is an easy way that springs to (anyone's) mind, I'm all ears. 
cheers
sam

Bob P

You make the (incorrect) assumption that the sides of the curved segment are cuts from a plane that intersects the center of the sphere.

Instead, use 2 3-point circles drawn from different points on the surface to generate perpendiculars toward the center of the sphere.  They "should" intersect at the sphere center.  This will probably not work, since DC's "sphere" is an approximation of planes whose points don't necessarily fall on the true sphere.  *I tried it, and my prediction is correct.  the perps of the great circles don't intersect.  Close, but no cigar...

prl

Quote from: Bob P on June 07, 2014, 02:23:51 AM
*I tried it, and my prediction is correct.  the perps of the great circles don't intersect.  Close, but no cigar...

If we drop back to the DC vectorized versions of a circle in 2d with N numbers of segments, where do all the perps point?  I'll follow that up too.  Just wondering.  BobP is ahead of us in terms of using true geometry placed atop a segmented or faceted approximation.

samdavo

#6
Quote from: Bob P on June 07, 2014, 02:23:51 AM
You make the (incorrect) assumption that the sides of the curved segment are cuts from a plane that intersects the center of the sphere.

Instead, use 2 3-point circles drawn from different points on the surface to generate perpendiculars toward the center of the sphere.  They "should" intersect at the sphere center.  This will probably not work, since DC's "sphere" is an approximation of planes whose points don't necessarily fall on the true sphere.  *I tried it, and my prediction is correct.  the perps of the great circles don't intersect.  Close, but no cigar...

Thanks Bob - (PS INcidentally, I don't assume that those circles are centred on the the centre of the sphere - unless you choose lines of longitude , which you can choose if you wish ... but we move on ...)

Yep that's what I did in the first jpeg (I used the three edges of the "sail" draw circles of various radii, draw lines normal to them at their centres , and those lines should pass through the sphere's centre ) -  but the lines didn't intersect, and that's when I decide it was an "Approx Sphere".   You make the point that that wouldn;t be unusual for DCAD (because planes are finite size).  But this "sphere" has come to us via Sketchup, - and rather than being more accuracte, I think the errors are even worse than we are used to lol.

But if you do that with the lines of longitude I am sure you would be close enough - for what I was doing anyway :).

Quote from: samdavo on June 07, 2014, 02:08:45 AM
I also thought that the sphere passing through A B and C (another method)  would be centred on a line normal to that plane, and through the centroid of the triangle.   You could draw that normal to that plane.    And likewise draw the normal to the plane of ADC,  BDC and  etcetc.   However, none (or not all) of these meet as far as I can tell (!?)  So I couldn't work out how to average their intersection points.
sam
prl,
I enclose an attempt at drawing two such normals-to-trangles (the orange and the green lines).  And sure enough they don't intersect.

I have a feeling you have a macro that tells you the closest point(s) that two lines get to each other (?)

PS I suppose you (I) could draw a plane perpendicular to one line, make it the working plane, (so that you are looking down that line) - and observe the closest point that the other line gets to it. (2 cents) - but that's pretty clumsy compared to most of your macros.

prl

Quote from: samdavo on June 07, 2014, 02:59:13 AM
But this "sphere" has come to us via Sketchup, - and rather than being more accuracte,

Given the SU file was/is version 5 and compact, it would not surprise me if the true "original" wasn't an AutoCAD drawing to start with.

Then "Steve", Google Earth etc., textures were added.

samdavo

#8
Exactly - ( I noticed some layers called "Google Earth Terrain" and "Google Earth Snapshot" - whatever that all means lol)
PS If anyone is interested, we are discussing the dcd attached to reply #15 on this thread :-
http://forum.designcad.com/index.php?topic=5582.msg38626#new

PS When I check,  those lines are not lines of longitude either :)  Because 3-point circles based on them all have different centres (2 cents).  Strange, because the other lines appear to be parallel to each other, hence lines of latitude surely.  One starts to wonder are those sails even "approx spherical" (?)  Maybe "Surface Connect" (or some ACAD equivalent) ?

Only thing left is trialling spheres of various radii with centres equidistant from ABC, and trying to include DEF as well.

samdavo

#9
Quote from: samdavo on June 07, 2014, 02:59:13 AM
I also thought that the sphere passing through A B and C (another method)  would be centred on a line normal to that plane, and through the centroid of the triangle. (??).   You could draw that normal to that plane.    And likewise draw the normal to the plane of ADC,  BDC and  etcetc.   However, none (or not all) of these meet as far as I can tell (!?)  So I couldn't work out how to average their intersection points.
sam

doh - of course they wouldn't intersect, unless both triangles were equilateral triangles.   Not sure what I was smoking that day.  What WOULD intersect however if you draw a circle through ABC (rather than a triangle), and the normal to that circle)  - similar to Bob P's post - just that you have to pick only 4 points to define the sphere. 

And hence a sphere through 4 points is just a case of drawing and finding the intersection of two such lines through the centres of two circles, one through ABC, the other through ADC.    When you do it carefully, DCAD finds the intersection (at least it did just then when I double checked).

Problem here was we could have 6 points (or more) - with no guarantee that they were on the same sphere, and then there would have to be an approximation of the best centre.

i.e. When lines don't quite intersect, one is left with the problem of approximating the intersection.  With two lines, that would logically be the closest point in 3D space  (i.e. the midpoint of where a static electricity spark would jump between the two wires).

(I'm sure there's a macro around here somewhere that finds that closest point for two lines that don't quite meet -  just can't seem to find it at the moment - but not that difficult using work planes I guess  (?) )
cheers