Angled cylinders - advice on auto cylinders

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Angled cylinders - advice on auto cylinders

    Thank you all for the help.

    I have one last issue I need help with. How do you calculate the i, j, k for an angled auto cylinder? I've been just probing it manually and going from there, but I'd like to just create an auto cylinder. I made up a sketch. Let's just say the angle is 45 degrees. Thank you.
    Attached Files

  • #2
    If you construct a line FROM PNT1 TO PNT2, the vector <i,j,k> of that line is calculated as follows:

    i= (PNT2.X-PNT1.X)/SQRT((PNT2.X-PNT1.X)^2+(PNT2.Y-PNT1.Y)^2+(PNT2.Z-PNT1.Z)^2)
    j= (PNT2.Y-PNT1.Y)/SQRT((PNT2.X-PNT1.X)^2+(PNT2.Y-PNT1.Y)^2+(PNT2.Z-PNT1.Z)^2)
    k= (PNT2.Z-PNT1.Z)/SQRT((PNT2.X-PNT1.X)^2+(PNT2.Y-PNT1.Y)^2+(PNT2.Z-PNT1.Z)^2)

    what this means is:

    i= (change in X over the length of the line) divided by the length of the line
    j= (change in Y over the length of the line) divided by the length of the line
    k= (change in Z over the length of the line) divided by the length of the line

    It can also be calculated directly from angles, but the math gets a little more complicated. If you know the exact theoretical locations of 2 points along the axis of the cylinder, you can use the above equations to calculate the vector of the cylinder.

    If PNT1 is located at (0,0,0) and PNT2 is located at (3,-4,12), and you construct a line FROM PNT1 TO PNT2, then the length of that line is SQRT((PNT2.X-PNT1.X)^2+(PNT2.Y-PNT1.Y)^2+(PNT2.Z-PNT1.Z)^2) = 13

    The vector is:

    i= change in X divided by length of the line, so (3-0)/13 = .2307
    j= ((-4)-0)/13 = -.3077
    k= (12-0)/13 = .9231
    so the vector would be <.2307,-.3077,.9231>

    HTH!

    Comment


    • Josh Seiden
      Josh Seiden commented
      Editing a comment
      Thanks, Mike.

  • #3
    Good explanation MR.

    0.7071,0.7071,0 is right. You can also

    Code:
    ALIGNMENT/TRANS_OFFSET,XAXIS,-0.25
    ALIGNMENT/TRANS_OFFSET,YAXIS,-2.25
    ALIGNMENT/ROTATE_OFFSET,135,ABOUT,ZPLUS
    Then your vector would be XYZIJK will be 0,0,0,0,1,0

    Comment


    • Josh Seiden
      Josh Seiden commented
      Editing a comment
      Thanks for the help.

  • #4
    The I ( x),J ( y),K ( z) values are the cosine of the angle so in your case 45 for the I(x) and J (y) axis = 0.707106 and zero for the K (z).

    Comment


    • Josh Seiden
      Josh Seiden commented
      Editing a comment
      Thank you. This makes sense. What if I didn't know the angle. Would you be able to tell me the angle from my drawing?

    • UKCMM
      UKCMM commented
      Editing a comment
      From the information on your sketch no it would be a pure guess/assumption

  • #5
    UKCMM thanks. This is good information.

    Comment


    • #6
      For programming angled cylinders I normally offset to the coords defining the location and rotate per the print the measure the cylinders at 0,0,1 or whatever vector they are on. Saves me a lot of time and keeps me from drinking.
      Xcel & MicroVal Pfx & Global 37mr4 thru 2012mr1sp3
      Contura Calypso 5.4

      Lord, keep Your arm around my shoulder and Your hand over my mouth. Amen.

      Comment

      Related Topics

      Collapse

      Working...
      X