polygon
Element đ Polygon Function â Typst DocumentationTypstGitHubDiscordMastodonBlueskyLinkedInTypstQuestion markQuestion markQuestion markQuestion markQuestion markQuestion markQuestion markQuestion mark - typst.app
Element functions can be customized with set
and show
rules.
A closed polygon.
The polygon is defined by its corner points and is closed automatically.
Example
# polygon (
fill: blue. lighten ( 80% ) ,
stroke: blue,
( 20% , 0pt ) ,
( 60% , 0pt ) ,
( 80% , 2cm ) ,
( 0% , 2cm ) ,
)
Parameters đ Polygon Function â Typst DocumentationTypstGitHubDiscordMastodonBlueskyLinkedInTypstQuestion markQuestion markQuestion markQuestion markQuestion markQuestion markQuestion markQuestion mark - typst.app
Parameters are the inputs to a function. They are specified in
parentheses after the function name.
fill
Settable đ Polygon Function â Typst DocumentationTypstGitHubDiscordMastodonBlueskyLinkedInTypstQuestion markQuestion markQuestion markQuestion markQuestion markQuestion markQuestion markQuestion mark - typst.app
Settable parameters can be customized for all following uses of the
function with a set
rule.
How to fill the polygon.
When setting a fill, the default stroke disappears. To create a
rectangle with both fill and stroke, you have to configure both.
Default: none
fill-rule
Settable đ Polygon Function â Typst DocumentationTypstGitHubDiscordMastodonBlueskyLinkedInTypstQuestion markQuestion markQuestion markQuestion markQuestion markQuestion markQuestion markQuestion mark - typst.app
Settable parameters can be customized for all following uses of the
function with a set
rule.
The drawing rule used to fill the polygon.
See the curve documentation for an example.
Variant Details "non-zero"
Specifies that "inside" is computed by a non-zero sum of signed edge crossings.
"even-odd"
Specifies that "inside" is computed by an odd number of edge crossings.
Default: "non-zero"
stroke
Settable đ Polygon Function â Typst DocumentationTypstGitHubDiscordMastodonBlueskyLinkedInTypstQuestion markQuestion markQuestion markQuestion markQuestion markQuestion markQuestion markQuestion mark - typst.app
Settable parameters can be customized for all following uses of the
function with a set
rule.
How to stroke the polygon. This can be:
Can be set to none
to disable the stroke or to auto
for a
stroke of 1pt
black if and if only if no fill is given.
Default: auto
vertices
Required Positional đ Polygon Function â Typst DocumentationTypstGitHubDiscordMastodonBlueskyLinkedInTypstQuestion markQuestion markQuestion markQuestion markQuestion markQuestion markQuestion markQuestion mark - typst.app
Positional parameters are specified in order, without names.
Variadic đ Polygon Function â Typst DocumentationTypstGitHubDiscordMastodonBlueskyLinkedInTypstQuestion markQuestion markQuestion markQuestion markQuestion markQuestion markQuestion markQuestion mark - typst.app
Variadic parameters can be specified multiple times.
The vertices of the polygon. Each point is specified as an array of two
relative lengths .
Definitions đ Polygon Function â Typst DocumentationTypstGitHubDiscordMastodonBlueskyLinkedInTypstQuestion markQuestion markQuestion markQuestion markQuestion markQuestion markQuestion markQuestion mark - typst.app
Functions and types and can have associated definitions. These are accessed by
specifying the function or type, followed by a period, and then the definition's
name.
regular
A regular polygon, defined by its size and number of vertices.
# polygon . regular (
fill: blue. lighten ( 80% ) ,
stroke: blue,
size: 30pt ,
vertices: 3 ,
)
How to fill the polygon. See the general
polygon's documentation for more details.
How to stroke the polygon. See the general
polygon's documentation for more details.
The diameter of the circumcircle
of the regular polygon.
Default: 1em
vertices
The number of vertices in the polygon.
Default: 3