gleSpiral(3GLE)

✨ gleSpiral β€” it's in the GLE manual, bestie ✨

okay so real talk, this page lives in section 3GLE of the GLE manual, and it's about gleSpiral, which is the function you call when you want to yeet a contour around and around in a lil helix. group-chat summary: contour goes in, spiral comes out. iconic. πŸ’«


πŸ’– NAME πŸ’–

gleSpiral β€” sweep an arbitrary contour along a helical path.

like… literally just take a shape and swirl it. no cap.


🌸 SYNTAX 🌸

void gleSpiral (int ncp,
                gleDouble contour[][2],
                gleDouble cont_normal[][2],
                gleDouble up[3],
                gleDouble startRadius,     /* spiral starts in x-y plane */
                gleDouble drdTheta,        /* change in radius per revolution */
                gleDouble startZ,          /* starting z value */
                gleDouble dzdTheta,        /* change in Z per revolution */
                gleDouble startXform[2][3], /* starting contour affine xform */
                gleDouble dXformdTheta[2][3], /* tangent change xform per revoln */
                gleDouble startTheta,      /* start angle in x-y plane */
                gleDouble sweepTheta);     /* degrees to spiral around */

twelve arguments. twelve. she's high maintenance but she SERVES πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • ncp β€” number of contour points. how many lil dots make up your shape, bestie.
  • contour β€” 2D contour. the shape itself.
  • cont_normal β€” 2D contour normals. the shape's lil perpendiculars. she's got opinions about direction ✨
  • up β€” up vector for contour.
  • startRadius β€” spiral starts in x-y plane. this is where the swirl begins, radius-wise.
  • drdTheta β€” change in radius per revolution.
  • startZ β€” starting z value.
  • dzdTheta β€” change in Z per revolution.
  • startXform β€” starting contour affine transformation.
  • dXformdTheta β€” tangent change xform per revolution.
  • startTheta β€” start angle in x-y plane.
  • sweepTheta β€” degrees to spiral around.

πŸ¦‹ DESCRIPTION πŸ¦‹

Sweep an arbitrary contour along a helical path. that's the whole vibe. πŸŒ€

The axis of the helix lies along the modeling coordinate z-axis. so she spirals up the z-axis, no detours, no side quests.

An affine transform can be applied as the contour is swept. For most ordinary usage, the affines should be given as NULL. like fr, if you're just doing normal stuff, pass NULL and keep it moving. don't make it weird. πŸ™ˆ

The "startXform[][]" is an affine matrix applied to the contour to deform the contour. Thus, "startXform" of the form

     |  cos     sin    0   |
     |  -sin    cos    0   |

will rotate the contour (in the plane of the contour), while

     |  1    0    tx   |
     |  0    1    ty   |

will translate the contour, and

     |  sx    0    0   |
     |  0    sy    0   |

scales along the two axes of the contour. In particular, note that

     |  1    0    0   |
     |  0    1    0   |

is the identity matrix. yes bestie, the "do nothing" matrix. the chill one. the one that just vibes. 😌

The "dXformdTheta[][]" is a differential affine matrix that is integrated while the contour is extruded. Note that this affine matrix lives in the tangent space, and so it should have the form of a generator. ⚠️ important, don't skip this part.

Thus, dx/dt's of the form

     |  0     r    0   |
     |  -r    0    0   |

rotate the the contour as it is extruded (r == 0 implies no rotation, r == 2*PI implies that the contour is rotated once, etc.), while

     |  0    0    tx   |
     |  0    0    ty   |

translates the contour, and

     |  sx    0    0   |
     |  0    sy    0   |

scales it. In particular, note that

     |  0    0    0   |
     |  0    0    0   |

is the identity matrix β€” i.e. the derivatives are zero, and therefore the integral is a constant. all zeros, all calm, nothing moves. the "leave me alone" of matrices πŸ’€


🌈 SEE ALSO 🌈

  • gleLathe

(the sibling function. different swirl technique, same chaotic energy. iykyk)


πŸ‘‘ AUTHOR πŸ‘‘

Linas Vepstas (linas@linas.org)


okay that's the whole page, bestie. go forth and spiral. 🫢

kisses from the GLE manual, version 3.0, page gleSpiral(3GLE). slay, drink water, pass NULL for the affines unless you're being fancy πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’