このページはまだ翻訳されていません。原文の内容が表示されています。
polygon
要素関数要素関数要素関数はset
ルールやshow
ルールでカスタマイズできます。
set
ルールやshow
ルールでカスタマイズできます。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),
)

引数引数引数は関数への入力値です。関数名の後に括弧で囲んで指定します。
fill
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.
デフォルト値: none
fill-rule
設定可能引数設定可能引数設定可能引数は、set
ルールを用いて設定でき、それ以降で使用するデフォルト値を変更できます。
set
ルールを用いて設定でき、それ以降で使用するデフォルト値を変更できます。The drawing rule used to fill the polygon.
See the curve documentation for an example.
使用可能な文字列値:
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.
デフォルト値: "non-zero"
stroke
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.
デフォルト値: auto
vertices
必須引数必須引数必須引数は、関数を呼び出す際に必ず指定しなければなりません。位置引数位置引数位置引数は順序通りに指定することで、引数名を省略して設定できます。可変長引数可変長引数可変長引数は複数回指定することができます。
The vertices of the polygon. Each point is specified as an array of two relative lengths.
定義定義これらの関数や型には、関連する定義を持たせることができます。定義にアクセスするには、対象の関数や型の名前を指定した後に、ピリオド区切りで定義名を記述します。
regular
A regular polygon, defined by its size and number of vertices.
例を表示
#polygon.regular(
fill: blue.lighten(80%),
stroke: blue,
size: 30pt,
vertices: 3,
)

fill
How to fill the polygon. See the general polygon's documentation for more details.
stroke
How to stroke the polygon. See the general polygon's documentation for more details.