gleSetJoinStyle(3GLE)

✨ gleSetJoinStyle β€” bestie, let's talk join styles ✨

okay so this is the 3GLE manual, and today's main character is gleSetJoinStyle, plus its lowkey iconic sidekick gleGetJoinStyle. They're literally a matched set: one sets, one gets, and both are about the GLE join style flags. πŸ’…


🌸 NAME 🌸

gleSetJoinStyle, gleGetJoinStyle β€” query and set the GLE join style flags. That's it, that's the vibe. πŸŽ€


✨ SYNTAX ✨

void gleSetJoinStyle (int style);
int gleGetJoinStyle (void);

look at them. so clean. so concise. πŸ¦‹


🧚 ARGUMENTS 🧚

  • style β€” a bitwise OR of flags. that's the whole assignment bestie, just OR a bunch of flags together and hand it over.

πŸ’– DESCRIPTION πŸ’–

So this pair queries and sets the GLE join style flags. The style word is β€” and I cannot stress this enough β€” a bitwise OR of the flags listed below. Not a sum, not a list, not a vibe. A bitwise OR. 🫢

The initial join style (the one you get before you touch anything) is:

TUBE_JN_ANGLE | TUBE_JN_CAP | TUBE_NORM_FACET

no cap, that's the factory setting.

πŸ”₯ Extrusion Join Styles πŸ”₯

  • TUBE_JN_RAW β€” draws polycylinders, polycones, extrusions, etc. with no special treatment of the extrusion ends. feral. unbothered. raw, as advertised. πŸ’€
  • TUBE_JN_ANGLE β€” draws polycylinders, polycones, extrusions, etc. by extending the different segments until they butt into each other in an angular style. angular! sharp! geometric! πŸ‘‘
  • TUBE_JN_CUT β€” draws polycylinders, polycones, extrusions, etc. by joining the different segments together and slicing off the joint at half the angle between the segments. A cap is drawn. Heads up: the slicing plane runs through the origin of the contour coordinate system. So if you want to change how much gets sliced, offset the contour relative to the origin. 🎯
⚠️ and when two segments meet at a shallow angle, the cut join style can potentially shave off a whole lot of the contour, leading to "surprising" results... and by "surprising" we mean 😭. you have been warned, bestie.
  • TUBE_JN_ROUND β€” joints get rounded. Strictly speaking, the part of the joint above the origin gets rounded. The part below the origin comes together in an angular join. so it's giving half-round, half-angular. still cute. πŸ“
  • TUBE_JN_MASK β€” mask bits! use this to mask off the bit field that defines the join style. it's the little eraser for that section of the flag word. ✨

πŸŽ€ End Caps πŸŽ€

  • TUBE_JN_CAP β€” if this is set, a cap will be drawn at each end of the extrusion. both ends. equal treatment. slay. πŸ‘‘

🌈 Automatic Normal Vector Generation 🌈

  • TUBE_NORM_FACET β€” a normal vector is generated per facet. Useful when you want an extrusion to have that "faceted" look β€” like when you extrude a square and each of the four sides of the square looks flat. very crisp, very deliberate. πŸ¦‹
  • TUBE_NORM_EDGE β€” normal vectors are generated so they lie along edges. Useful for making angular things look rounded under lighting. example: extrude a hexagon with this flag and it'll look (more like) a smooth, perfectly round cylinder instead of a six-sided shape. glow-up achieved. ✨
  • TUBE_NORM_PATH_EDGE β€” normal vectors are generated so they both lie on edges and interpolate between neighboring segments. Useful for drawing "spaghetti" β€” extrusions that follow a spline path. 🍝 Because the spline path has to be "tessellated" into small straight segments, each segment will look straight unless this flag is set. so set it if you want smooth noodles.
  • TUBE_NORM_MASK β€” a mask, useful for masking out the "norm" bits. bye norm bits. πŸ’…

πŸ’œ Closed or Open Contours πŸ’œ

  • TUBE_CONTOUR_CLOSED β€” if this bit is set, the contour is treated as a "closed" contour, where the last point connects back up to the first. It's useful to set this flag when drawing closed shapes β€” extruded cylinders, star-shapes, I-Beams, etc. BUT β€” when you're drawing open extrusions (e.g. corrugated sheet metal), you DON'T want to set this flag. respectfully. please. πŸ™ˆ

πŸ’€ BUGS πŸ’€

Multiple threads using GLE share a single global join style. yes, one join style for everyone, like one group chat. 😭

though ngl, this should be easily fixable, because GLE does use a centralized graphics context. so it's giving "fixable, just not fixed." iykyk.


🫢 SEE ALSO 🫢

gleExtrusion, gleTextureMode β€” go read those too, bestie, they're in the same friend group.


πŸ‘‘ AUTHOR πŸ‘‘

Linas Vepstas (linas@linas.org) β€” the legend himself. 🌟


and that's the whole page!! this was the GLE manual, version 3.0, and yes it's literally titled gleSetJoinStyle(3GLE) at the top like a little name tag. πŸ’– go forth and OR your flags correctly, bestie β€” no cap, you've got this. πŸŽ€βœ¨πŸ¦‹