Close



Page 1 of 6 123 ... LastLast
Results 1 to 10 of 74

Hybrid View

  1. #1
    Staff Engineer old man emu's Avatar
    Join Date
    Oct 2013
    Location
    Narellan, New South Wales, Australia
    Posts
    912

    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

  2. #2
    Technician joealarson's Avatar
    Join Date
    Oct 2013
    Location
    Spanish Fork, UT
    Posts
    62
    Follow joealarson On Twitter Add joealarson on Facebook Add joealarson on Google+ Add joealarson on Shapeways Add joealarson on Thingiverse
    This sounds oddly like a homework question your asking for help with.

  3. #3
    Staff Engineer old man emu's Avatar
    Join Date
    Oct 2013
    Location
    Narellan, New South Wales, Australia
    Posts
    912
    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.

  4. #4
    Senior Engineer
    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.
    Some commas missing?

    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.

  5. #5
    Engineer-in-Training
    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?

  6. #6
    Senior Engineer
    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.

  7. #7
    Staff Engineer old man emu's Avatar
    Join Date
    Oct 2013
    Location
    Narellan, New South Wales, Australia
    Posts
    912
    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

  8. #8
    Staff Engineer old man emu's Avatar
    Join Date
    Oct 2013
    Location
    Narellan, New South Wales, Australia
    Posts
    912
    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

  9. #9
    Super Moderator Roxy's Avatar
    Join Date
    Apr 2014
    Location
    Lone Star State
    Posts
    2,182
    Quote Originally Posted by old man emu View Post

    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.
    Yeah, in other words... He faked it. He only generated one quadrant and replicated that in the places the equations did not produce valid results. I can mirror the first quadrant where the equations work to make the other quadrants.
    Last edited by Roxy; 12-04-2014 at 10:15 PM.

  10. #10
    Staff Engineer old man emu's Avatar
    Join Date
    Oct 2013
    Location
    Narellan, New South Wales, Australia
    Posts
    912

    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

Page 1 of 6 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •