PolygonComp(3U)
π PolygonComp β the manual, but make it slay π
okay bestie, pull up a chair, we're reading the InterViews Reference Manual page for PolygonComp(3U) and honestly? it's giving iconic polygon energy. this is <Unidraw/Components/polygon.h> territory, so hydrate and let's go πΈ
β¨ NAME β¨
PolygonComp, PolygonView, PSPolygon β the polygon component subject, its view, and its PostScript external representation. three besties, one polygon, no cap π¦
β¨ SYNOPSIS β¨
#include <Unidraw/Components/polygon.h>
that's it. that's the include. one line, zero drama, absolutely ate π
β¨ DESCRIPTION β¨
so PolygonComp is a VerticesComp that defines a polygon β yes, literally, it's the polygon-defining one, main character behavior fr fr. it uses an SF_Polygon graphic to store its graphical attributes. meanwhile PolygonView is a VerticesView whose whole job is displaying the polygon. and PSPolygon is a PSVertices that externalizes the subject's information in PostScript form. a whole little trio of girlies working together π
π POLYGONCOMP PUBLIC OPERATIONS π
PolygonComp(SF_Polygon* = nil)β the constructor, and it takes an optional stroked-filled polygon graphic that defines the attributes of the polygon. pass nothing (nil) if you want, she's flexible like that β¨SF_Polygon* GetPolygon()β returns the Polygon graphic that defines the polygon's attributes. also lowkey a more specific form of theGetGraphicoperation, iykyk π«
π POLYGONVIEW PUBLIC OPERATIONS π
PolygonView(PolygonComp* = nil)β creates aPolygonView, optionally supplying the subject. optional subject, mandatory slay π«Άvirtual Manipulator* CreateManipulator(Viewer*, Event&, Transformer*, Tool*)β yeah bestie, that's the whole signature:
virtual Manipulator* CreateManipulator(
Viewer*, Event&, Transformer*, Tool*
)
virtual void InterpretManipulator(Manipulator*)β okay so here's where it gets good.PolygonViewredefines its response to manipulation with aGraphicCompTool. the user clicks the left mouse button to specify each vertex, and clicks with the middle mouse button to specify the final vertex π±οΈ vertex positioning will be constrained by gravity, if any β yes, gravity, we love a physics moment.
PolygonView also defines a response to the ReshapeTool, letting the user click on one of its vertices to reposition it. and here's the spicy part: the subject is actually replaced (via ReplaceCmd) with a new PolygonComp subject reflecting the repositioned vertex. repositioning will be influenced by gravity too. so basically gravity is running this whole operation and we're just living in it π
PolygonComp* GetPolygonComp()β returns the subject. simple, clean, iconic π
β PSPOLYGON PUBLIC OPERATIONS β
PSPolygon(PolygonComp* = nil)β constructs a PostScript external representation of the given subject, if any. subject optional, PostScript mandatory π
π PSPOLYGON PROTECTED OPERATIONS π
virtual const char* Name()βPSPolygonidentifies itself as"Poly"in the PostScript output. short name, big personality π
π SEE ALSO π
Event(3I), GraphicComp(3U), GraphicCompTool(3U), GraphicView(3U), Grid(3U), PatternCmd(3U), PostScriptView(3U), ReshapeTool(3U), Rubband(3I), Transformer(3I), VerticesComp(3U), Viewer(3U), align(3U), edit(3U), polygons(3U)
go read those too, bestie, they're all part of the friend group π§
reminder: this whole page is from Unidraw, dated 23 January 1991, and the page itself is PolygonComp(3U). yes, 1991. vintage. retro. still slaying. periodt πβ¨
k bye, go draw some polygons ππ
π¦ where this page comes from
- debian bookworm: ivtools-dev 2.0.11d.a1-1+b4
- debian trixie: ivtools-dev 2.0.11d.a1-3+b4
- ubuntu jammy: ivtools-dev 2.0.11d.a1-1build1
- ubuntu noble: ivtools-dev 2.0.11d.a1-3build1
- ubuntu questing: ivtools-dev 2.0.11d.a1-3build7
- ubuntu resolute: ivtools-dev 2.0.11d.a1-3build9
- ubuntu stonking: ivtools-dev 2.1.1+git.2025.07.26.a1-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms