AnyToPL(3gv)

πŸ’– AnyToPL πŸ’–

okay bestie, gather round, because this is the geomutil girlies' moment. AnyToPL is the function that takes literally any geom and turns it into a polylist β€” aka the OFF file format, aka the glow-up format ✨. (This page lives in section 3gv of the manual, iykyk.)


✨ SYNOPSIS ✨

#include "geomutil.h"

Geom *AnyToPL(Geom *, Transform);

🌸 DESCRIPTION 🌸

So AnyToPL() takes any geom as an argument. Like, any any. And it hands you back a polylist object that is geometrically identical to the original geom β€” same shape, different font, fr fr. 🫢

The transform argument is the transform that gets applied to the entire object. And bestie, when you first call AnyToPL(), you should generally set it to TM_IDENTITY. No cap. πŸŽ€

Now here's how each lil geometric object gets handled, one by one:

  • Polylists: you get back a transformed copy of the original. Simple. Iconic. πŸ’…
  • Bezier: the object gets rediced if necessary (yes that's how the page spells it, don't come for me 😭), and then it's handled as a mesh object.
  • Quad: the object is directly transformed into a new polylist. Straight up. πŸ¦‹
  • Mesh: the object is directly transformed into a new polylist, with extra polygons added to do the wrapping if necessary. Gotta wrap it up like a lil gift. 🎁
  • Vect: the object gets converted into a polylist containing a 2-gon for every segment in the original vector object. The colors of the faces are the same as the colors of the original object β€” but honestly this generally is irrelevant since the faces are not visible. πŸ™ˆ
⚠️ Note that edge visibility must be enabled for an object which has been converted from a vect to a polylist to be visible in geomview. Like, it's there, it's just doing the invisible-girl thing. Don't panic when you can't see it, bestie. πŸ’€
  • List: AnyToPL() is called recursively and the resultant polylists are combined using PLCombine(3).
  • Inst: AnyToPL() is called recursively with a new transformation matrix. The resultant polylists are combined using PLCombine(3).

Now the part that's giving restraint πŸ’… β€” no effort is made to eliminate identical vertices. However! No extraneous repeated vertexes should be created either. So the resultant polylist should have the same number of vertexes as the original object. Efficient queen behavior, we love to see it. πŸ‘‘


πŸ”— LINKING πŸ”—

AnyToPL() is part of the geomutil library 🫢 β€” go check out geomutil(3) for the tea on how to link your program with this library.


πŸ‘€ SEE ALSO πŸ‘€


🌈 AUTHOR 🌈

Celeste Fowler The Geometry Center


and that's the whole vibe check, bestie πŸ’– this page was brought to you by the Geometry Center, dated June 15, 1992 β€” yes she's an elder icon and she still ate πŸŽ€βœ¨πŸ¦‹