Results 1 to 10 of 74
Thread: Need some geometry help
Hybrid View
-
11-30-2014, 06:31 AM #1
Need some geometry help
Please take a look at this diagram:
torus1.jpg
It is a diagram of a torus (doughnut, tyre, bangle etc). It can also be shown as in this diagram:
torus3.jpg
which can be rendered as this:
torus4.jpg
Going back to the first diagram,
Ro is the distance from the centre of the the large object (the Origin of these axes) to the point midway between the inner and outer edges of the ring
R1 is the radius of the cross section between the inner and outer rings.
theta is an angle measured anti-clockwise from the X-axis to Ro.
phi is an angle made by the radius measured from origin the X/Z axis of the cross section ( consider the case of theta = 0) to place that cross section.
If theta is know, is it possible to determine phi through geometry?
If it is, please post the steps of your calculation.
Old Man Emu
-
12-01-2014, 12:26 PM #2
This sounds oddly like a homework question your asking for help with.
-
12-02-2014, 06:04 AM #3
That coding just makes cubes at various locations around the Z axis. I want to make whizzo things like this:
and at the moment i's stumped by not having the answer to this question:
how do I get OpenScad to automatically use all the values for theta and phi in their respective ranges (0 to 2 pi)?
How about doing it this way?
iteration over a range specifying an increment: // Note: The middle parameter in the range designation
// ('0.2' in this case) is the 'increment-by' value
// Warning: Depending on the 'increment-by' value, the
// real end value may be smaller than the given one.
for ( i = [0 : 0.2 : 5] )
{
rotate( i * 360 / 6, [1, 0, 0])
translate([0, 10, 0])
sphere(r = 1)
OME
Last edited by old man emu; 12-02-2014 at 08:13 PM.
-
12-01-2014, 01:18 PM #4
- Join Date
- Jun 2014
- Location
- Burnley, UK
- Posts
- 1,662
Please redefine:
phi is an angle made by the radius measured from origin the X/Z axis of the cross section ( consider the case of theta = 0) to place that cross section.
I am struggling to understand what you need.
OK, I think I may have worked out what you are after.
Are you given the X Y Z coordinates of the point where R1 cuts the surface of the toroid? If so then yes it is possible to work out theta.Last edited by Mjolinor; 12-01-2014 at 01:29 PM.
-
12-01-2014, 02:57 PM #5
- Join Date
- Oct 2014
- Posts
- 314
Using theta and Ro you can determine the 2 dimensional position of the center of the cross section using the following and solving for x and y
Sin theta = y/Ro
Cos theta = x/Ro
The same math would determine the 2 dimensional position at the end of Ri on the cross section
Sin phi = y/Ri
Cos phi = x/Ri (this would also be the Z position in the 3d representation)
Finding the 3d x and y positions is a bit more complex and to be completely honest, it's late enough in the day that I don't want to think that hard.
Edit, re-read your post. So theta is given and the x/z/y coordinates where Ri hit the surface are given?
-
12-01-2014, 05:24 PM #6
- Join Date
- Jun 2014
- Location
- Burnley, UK
- Posts
- 1,662
phi = atan(x*cos(theta)/(z-r0)))
I think
probably
ish
Last edited by Mjolinor; 12-01-2014 at 06:09 PM.
-
12-02-2014, 08:16 PM #7
My question is:
Can this formula
http://paulbourke.net/geometry/torus/supertoroid3.gif
be written in a way that OpenScad can produce an object from it?
If so,
how do I get OpenScad to automatically use all the values for theta and phi in their respective ranges (0 to 2 pi)?
Old Man Emu
-
12-04-2014, 06:45 PM #8
Just a wild comment, but to eliminate the "Any time n1 or n2 is an even number, you are squaring the sin() and cos() functions. This causes any negative number they produce into a positive number. There is no way to generate points in the negative quadrants if you have n1^2 or n2^2 positive." problem what would happen if you made the computation use the ABS value?
I must refer you back to the original source: http://paulbourke.net/geometry/torus/
It shows the results of n1 and n2 being a positive number. n1 controls the shape of the body. If n1 = 2, then the shape is squared up. n2 controls the shape of the cross section.
OME
-
12-04-2014, 07:00 PM #9
Last edited by Roxy; 12-04-2014 at 10:15 PM.
-
12-05-2014, 04:31 PM #10
Reply from Dr Bourke
Here is the reply I got from Dr Bourke.
> I'm a hobbyist 3D printer and incompetent 3D object creator. At the moment I
> am trying to get my head around the Open Source program OpenScan.
I had never heard of that so had a play. Cute.
> we have ground to a halt
I don't see how to do it also. What ones needs to be able to do is
create both the profile as a polygon and then be able to control the
path through which it is revolved. I could not find out how to do the
first and the second certainly seems like it isn't supported.
It is easy to do with a C program, see attached along with
corresponding slt file. The top of the C program has the parameters
double r0=1.0,r1=0.25;
double n1=1.0,n2=0.2;
Here are the files he sent.
supertorus.c
supertorus.stl.zip
Have fun!!
OME
Please explain to me how to...
Yesterday, 02:43 PM in 3D Printer Parts, Filament & Materials