普通视图

发现新文章,点击刷新页面。
昨天 — 2026年2月7日首页

github发布pages的几种状态记录

作者 1024小神
2026年2月7日 18:15

大家好,我是1024小神,想进 技术群 / 私活群 / 股票群 或 交朋友都可以私信我,如果你觉得本文有用,一键三连 (点赞、评论、关注),就是对我最大的支持~

发布GitHub pages会有不同的几种状态,可以参考

409:表示已经发布过了

{
    "message": "GitHub Pages is already enabled.",
    "documentation_url": "https://docs.github.com/rest/pages/pages#create-a-apiname-pages-site",
    "status": "409"
}

errored:表示发布失败

通常是发布过后的pages静态文件更新后,会自动重新发布,比如总的更新文件是3个,但是更新了1个之后就会出触发自动更新,但是第二个紧跟着就更新了,就会再次触发更新,这个时候第一个更新状态就会变成errored

{
    "url": "https://api.github.com/repos/xxxxxx/xxxxxxx/pages",
    "status": "errored",
    "cname": null,
    "custom_404": false,
    "html_url": "https://xxxxxxx.github.io/xxxxxxx7/",
    "build_type": "legacy",
    "source": {
        "branch": "main",
        "path": "/docs"
    },
    "public": true,
    "protected_domain_state": null,
    "pending_domain_unverified_at": null,
    "https_enforced": true
}

status:null 说明正在发布pages

{
    "url": "https://api.github.com/repos/1024xiaoshen/PakePlus-Android-v2.1.6/pages",
    "status": null,
    "cname": null,
    "custom_404": false,
    "html_url": "https://1024xiaoshen.github.io/PakePlus-Android-v2.1.6/",
    "build_type": "legacy",
    "source": {
        "branch": "main",
        "path": "/docs"
    },
    "public": true,
    "protected_domain_state": null,
    "pending_domain_unverified_at": null,
    "https_enforced": true
}

built:表示已经发布好了

{
    "url": "https://api.github.com/repos/1024xiaoshen/PakePlus-Android-v2.1.6/pages",
    "status": "built",
    "cname": null,
    "custom_404": false,
    "html_url": "https://1024xiaoshen.github.io/PakePlus-Android-v2.1.6/",
    "build_type": "legacy",
    "source": {
        "branch": "main",
        "path": "/docs"
    },
    "public": true,
    "protected_domain_state": null,
    "pending_domain_unverified_at": null,
    "https_enforced": true
}

如果你有好的想法或需求,都可以私信我,我这里有很多程序员朋友喜欢用代码来创造丰富多彩的计算机世界
昨天以前首页

SVG标签中path路径参数学习

作者 1024小神
2026年2月5日 11:14

大家好,我的开源项目PakePlus可以将网页/Vue/React项目打包为桌面/手机应用并且小于5M只需几分钟,官网地址:pakeplus.com

官方文档链接:developer.mozilla.org/zh-CN/docs/…

路径命令是对要绘制的路径的说明。每一个命令由代表命令的字母和代表参数的数字组成。

SVG 定义了六种路径命令类型,一共 20 条命令:

MoveTo:M、m
LineTo:L、l、H、h、V、v
三次贝塞尔曲线:C、c、S、s
二次贝塞尔曲线:Q、q、T、t
椭圆曲线:A、a
ClosePath:Z、z
备注:命令是大小写敏感的。大写的命令指定绝对坐标,而小写命令指定相对(于当前位置的)坐标。

备注:命令是大小写敏感的。大写的命令指定绝对坐标,而小写命令指定相对(于当前位置的)坐标。

始终可以将负值作为命令的参数:

负的角度是逆时针的;
绝对坐标中,负的 x 和 y 将被解释为负坐标;
相对坐标中,负的 x 值为向左移动,负的 y 值为向上移动。

Lineto 路径命令

Lineto 指令将绘制一条直线段。这个直线段从当前位置Po; {xoyo})移到指定位置Pn; {xnyn})。然后,指定位置Pn)将变成下一个命令中的当前位置Po′)。

命令 参数 备注
L (xy)+

当前位置指定位置 x,y 之间绘制一条线段。后续子坐标序列将被解释为隐式的绝对位置的 LineTo(L)命令的参数。

<p><strong>公式:</strong>&nbsp;Po&prime;&nbsp;=&nbsp;Pn&nbsp;= {<code>x</code>,&nbsp;<code>y</code>}</p>
</td>
</tr>
<tr>
<th scope="row">l</th>
<td>(<code>dx</code>,&nbsp;<code>dy</code>)+</td>
<td>
<p><em>当前位置</em><em>指定位置</em>之间绘制一条线段,<em>指定位置</em><em>当前位置</em>沿 x 轴偏移&nbsp;<code>dx</code>&nbsp;以及沿 y 轴偏移&nbsp;<code>dy</code>&nbsp;处。后续子坐标序列将被解释为隐式的相对位置的 LineTo(<code>L</code>)命令的参数。</p>

<p><strong>公式:</strong>&nbsp;Po&prime;&nbsp;=&nbsp;Pn&nbsp;= {xo&nbsp;+&nbsp;<code>dx</code>,&nbsp;yo&nbsp;+&nbsp;<code>dy</code>}</p>
</td>
</tr>
<tr>
<th scope="row">H</th>
<td><code>x</code>+</td>
<td>
<p><em>当前位置</em><em>指定位置</em>之间绘制一条水平线段。<em>指定位置</em>&nbsp;<code>x</code>&nbsp;参数和<em>当前位置</em>&nbsp;<code>y</code>&nbsp;坐标指定。后续子序列的值将被解释为隐式的绝对位置的 LineTo(<code>H</code>)命令的参数。</p>

<p><strong>公式:</strong>&nbsp;Po&prime;&nbsp;=&nbsp;Pn&nbsp;= {<code>x</code>,&nbsp;yo}</p>
</td>
</tr>
<tr>
<th scope="row">h</th>
<td><code>dx</code>+</td>
<td>
<p><em>当前位置</em><em>指定位置</em>之间绘制一条水平线段。<em>指定位置</em><em>当前位置</em>沿 x 轴偏移&nbsp;<code>dx</code>&nbsp;&nbsp;<code>x</code>&nbsp;坐标和<em>当前位置</em>&nbsp;<code>y</code>&nbsp;坐标指定。后续子序列的值将被解释为隐式的相对位置的 LineTo(<code>h</code>)命令的参数。</p>

<p><strong>公式:</strong>&nbsp;Po&prime;&nbsp;=&nbsp;Pn&nbsp;= {xo&nbsp;+&nbsp;<code>dx</code>,&nbsp;yo}</p>
</td>
</tr>
<tr>
<th scope="row">V</th>
<td><code>y</code>+</td>
<td>
<p><em>当前位置</em><em>指定位置</em>之间绘制一条垂直线段。<em>指定位置</em>&nbsp;<code>y</code>&nbsp;参数和<em>当前位置</em>&nbsp;<code>x</code>&nbsp;坐标指定。后续子序列的值将被解释为隐式的绝对位置的 LineTo(<code>V</code>)命令的参数。</p>

<p><strong>公式:</strong>&nbsp;Po&prime;&nbsp;=&nbsp;Pn&nbsp;= {xo,&nbsp;<code>y</code>}</p>
</td>
</tr>
<tr>
<th scope="row">v</th>
<td><code>dy</code>+</td>
<td>
<p><em>当前位置</em><em>指定位置</em>之间绘制一条垂直线段。<em>指定位置</em><em>当前位置</em>沿 y 轴偏移&nbsp;<code>dy</code>&nbsp;&nbsp;<code>y</code>&nbsp;坐标和<em>当前位置</em>&nbsp;<code>x</code>&nbsp;坐标指定。后续子序列的值将被解释为隐式的相对位置的 LineTo(<code>v</code>)命令的参数。</p>

<p><strong>公式:</strong>&nbsp;Po&prime;&nbsp;=&nbsp;Pn&nbsp;= {xo,&nbsp;yo&nbsp;+&nbsp;<code>dy</code>}</p>
</td>
</tr>
</tbody>

示例

<svg viewBox="0 0 200 100" xmlns="http://www.w3.org/2000/svg">
  <!-- 使用绝对坐标的 LineTo 命令 -->
  <path
    fill="none"
    stroke="red"
    d="M 10,10
           L 90,90
           V 10
           H 50" />

  <!-- 使用相对坐标的 LineTo 命令 -->
  <path
    fill="none"
    stroke="red"
    d="M 110,10
           l 80,80
           v -80
           h -40" />
</svg>

三次贝塞尔曲线

三次贝塞尔曲线是使用四个点定义的平滑曲线:

起始点(当前位置)

(Po = {xoyo})

终点

(Pn = {xnyn})

起始控制点

(Pcs = {xcsycs})(控制在起点附近的曲线的曲率)

终点控制点

(Pce = {xceyce})(控制在终点附近的曲线的曲率)

绘制后,终点Pn)将成为下一个命令中的当前位置Po′)。

命令 参数 备注
C (x1,y1x2,y2x,y)+

当前位置终点 x,y 之间绘制一条三次贝塞尔曲线。起始控制点通过 x1,y1 指定,而终点控制点通过 x2,y2 指定。后续的三元组坐标序列将被解释为隐式的绝对位置的三次贝塞尔曲线(C)命令的参数。

<p><a data-link-icon="https://csdnimg.cn/release/blog_editor_html/release2.4.5/ckeditor/plugins/CsdnLink/icons/icon-default.png?t=PBP8" data-link-title="公式:" href="https://developer.mozilla.org/zh-CN/docs/Web/SVG/Reference/Attribute/d#%E5%85%AC%E5%BC%8F%EF%BC%9A" title="公式:">公式:</a></p>

<p>Po&prime;&nbsp;=&nbsp;Pn&nbsp;= {<code>x</code>,&nbsp;<code>y</code>} ;<br />
Pcs&nbsp;= {<code>x1</code>,&nbsp;<code>y1</code>} ;<br />
Pce&nbsp;= {<code>x2</code>,&nbsp;<code>y2</code>}</p>
</td>
</tr>
<tr>
<th scope="row">c</th>
<td>(<code>dx1</code>,<code>dy1</code>,&nbsp;<code>dx2</code>,<code>dy2</code>,&nbsp;<code>dx</code>,<code>dy</code>)+</td>
<td>
<p><em>当前位置</em><em>终点</em><em>终点</em><em>当前位置</em>沿 x 轴偏移&nbsp;<code>dx</code>&nbsp;以及沿 y 轴偏移&nbsp;<code>dy</code>&nbsp;处)之间绘制一条三次贝塞尔曲线。<em>起始控制点</em><em>当前位置</em>沿 x 轴偏移&nbsp;<code>dx1</code>&nbsp;以及沿 y 轴偏移&nbsp;<code>dy1</code>&nbsp;处;而<em>终点控制点</em><em>当前位置</em>沿 x 轴偏移&nbsp;<code>dx2</code>&nbsp;以及沿 y 轴偏移&nbsp;<code>dy2</code>&nbsp;处。后续的三元组坐标序列将被解释为隐式的相对位置的三次贝塞尔曲线(<code>c</code>)命令的参数。</p>

<p><a data-link-icon="https://csdnimg.cn/release/blog_editor_html/release2.4.5/ckeditor/plugins/CsdnLink/icons/icon-default.png?t=PBP8" data-link-title="公式:" href="https://developer.mozilla.org/zh-CN/docs/Web/SVG/Reference/Attribute/d#%E5%85%AC%E5%BC%8F%EF%BC%9A_2" title="公式:">公式:</a></p>

<p>Po&prime;&nbsp;=&nbsp;Pn&nbsp;= {xo&nbsp;+&nbsp;<code>dx</code>,&nbsp;yo&nbsp;+&nbsp;<code>dy</code>} ;<br />
Pcs&nbsp;= {xo&nbsp;+&nbsp;<code>dx1</code>,&nbsp;yo&nbsp;+&nbsp;<code>dy1</code>} ;<br />
Pce&nbsp;= {xo&nbsp;+&nbsp;<code>dx2</code>,&nbsp;yo&nbsp;+&nbsp;<code>dy2</code>}</p>
</td>
</tr>
<tr>
<th scope="row">S</th>
<td>(<code>x2</code>,<code>y2</code>,&nbsp;<code>x</code>,<code>y</code>)+</td>
<td><em>当前位置</em><em>终点</em>&nbsp;<code>x</code>,<code>y</code>&nbsp;之间绘制一条平滑的三次贝塞尔曲线。<em>终点控制点</em>通过&nbsp;<code>x2</code>,<code>y2</code>&nbsp;指定。<em>起始控制点</em>是上一条曲线命令的<em>终点控制点</em><em>当前位置</em>上的反射点;若上一条命令不是曲线命令,则其与曲线的起始点(<em>当前位置</em>)相同。后续成对的坐标序列将被解释为隐式的绝对位置的平滑三次贝塞尔曲线(<code>S</code>)命令的参数。</td>
</tr>
<tr>
<th scope="row">s</th>
<td>(<code>dx2</code>,<code>dy2</code>,&nbsp;<code>dx</code>,<code>dy</code>)+</td>
<td><em>当前位置</em><em>终点</em><em>终点</em><em>当前位置</em>沿 x 轴偏移&nbsp;<code>dx</code>&nbsp;以及沿 y 轴偏移&nbsp;<code>dy</code>&nbsp;处)之间绘制一条平滑的三次贝塞尔曲线。<em>终点控制点</em><em>当前位置</em>沿 x 轴偏移&nbsp;<code>dx2</code>&nbsp;以及沿 y 轴偏移&nbsp;<code>dy2</code>&nbsp;处。<em>起始控制点</em>是上一条曲线命令的<em>终点控制点</em><em>当前位置</em>上的反射点;若上一条命令不是曲线命令,则其与曲线的起始点(<em>当前位置</em>)相同。后续成对的坐标序列将被解释为隐式的相对位置的平滑三次贝塞尔曲线(<code>s</code>)命令的参数。</td>
</tr>
</tbody>

示例

<svg
  viewBox="0 0 200 100"
  xmlns="http://www.w3.org/2000/svg"
  xmlns:xlink="http://www.w3.org/1999/xlink">
  <!-- 使用绝对坐标的三次贝塞尔曲线 -->
  <path
    fill="none"
    stroke="red"
    d="M 10,90
           C 30,90 25,10 50,10
           S 70,90 90,90" />

  <!-- 使用相对坐标的三次贝塞尔曲线 -->
  <path
    fill="none"
    stroke="red"
    d="M 110,90
           c 20,0 15,-80 40,-80
           s 20,80 40,80" />

  <!-- 高亮显示曲线顶点和控制点 -->
  <g id="ControlPoints">
    <!-- 第一段三次贝塞尔曲线的控制点 -->
    <line x1="10" y1="90" x2="30" y2="90" stroke="lightgrey" />
    <circle cx="30" cy="90" r="1.5" />

    <line x1="50" y1="10" x2="25" y2="10" stroke="lightgrey" />
    <circle cx="25" cy="10" r="1.5" />

    <!-- 第二段平滑三次贝塞尔曲线的控制点(第一个是隐式的) -->
    <line
      x1="50"
      y1="10"
      x2="75"
      y2="10"
      stroke="lightgrey"
      stroke-dasharray="2" />
    <circle cx="75" cy="10" r="1.5" fill="lightgrey" />

    <line x1="90" y1="90" x2="70" y2="90" stroke="lightgrey" />
    <circle cx="70" cy="90" r="1.5" />

    <!-- 曲线顶点 -->
    <circle cx="10" cy="90" r="1.5" />
    <circle cx="50" cy="10" r="1.5" />
    <circle cx="90" cy="90" r="1.5" />
  </g>
  <use xlink:href="#ControlPoints" x="100" />
</svg>

二次贝塞尔曲线

二次贝塞尔曲线是使用三个点定义的平滑曲线:

起始点(当前位置)

Po = {xoyo}

终点

Pn = {xnyn}

控制点

Pc = {xcyc}(控制曲率)

绘制后,终点Pn)将成为下一个命令中的当前位置Po′)。

命令 参数 备注
Q (x1,y1x,y)+

当前位置终点 x,y 之间绘制一条二次贝塞尔曲线。控制点通过 x1,y1 指定。后续成对的坐标序列将被解释为隐式的绝对位置的二次贝塞尔曲线(Q)命令的参数。

<p><a data-link-icon="https://csdnimg.cn/release/blog_editor_html/release2.4.5/ckeditor/plugins/CsdnLink/icons/icon-default.png?t=PBP8" data-link-title="公式:" href="https://developer.mozilla.org/zh-CN/docs/Web/SVG/Reference/Attribute/d#%E5%85%AC%E5%BC%8F%EF%BC%9A_3" title="公式:">公式:</a></p>

<p>Po&prime;&nbsp;=&nbsp;Pn&nbsp;= {<code>x</code>,&nbsp;<code>y</code>} ;<br />
Pc&nbsp;= {<code>x1</code>,&nbsp;<code>y1</code>}</p>
</td>
</tr>
<tr>
<th scope="row">q</th>
<td>(<code>dx1</code>,<code>dy1</code>,&nbsp;<code>dx</code>,<code>dy</code>)+</td>
<td>
<p><em>当前位置</em><em>终点</em><em>终点</em><em>当前位置</em>沿 x 轴偏移&nbsp;<code>dx</code>&nbsp;以及沿 y 轴偏移&nbsp;<code>dy</code>&nbsp;处)之间绘制一条二次贝塞尔曲线。<em>控制点</em><em>当前位置</em>(曲线的起始点)沿 x 轴偏移&nbsp;<code>dx1</code>&nbsp;以及沿 y 轴偏移&nbsp;<code>dy1</code>&nbsp;处。后续成对的坐标序列将被解释为隐式的相对位置的二次贝塞尔曲线(<code>q</code>)命令的参数。</p>

<p><a data-link-icon="https://csdnimg.cn/release/blog_editor_html/release2.4.5/ckeditor/plugins/CsdnLink/icons/icon-default.png?t=PBP8" data-link-title="公式:" href="https://developer.mozilla.org/zh-CN/docs/Web/SVG/Reference/Attribute/d#%E5%85%AC%E5%BC%8F%EF%BC%9A_4" title="公式:">公式:</a></p>

<p>Po&prime;&nbsp;=&nbsp;Pn&nbsp;= {xo&nbsp;+&nbsp;<code>dx</code>,&nbsp;yo&nbsp;+&nbsp;<code>dy</code>} ;<br />
Pc&nbsp;= {xo&nbsp;+&nbsp;<code>dx1</code>,&nbsp;yo&nbsp;+&nbsp;<code>dy1</code>}</p>
</td>
</tr>
<tr>
<th scope="row">T</th>
<td>(<code>x</code>,<code>y</code>)+</td>
<td>
<p><em>当前位置</em><em>终点</em>&nbsp;<code>x</code>,<code>y</code>&nbsp;之间绘制一条平滑的二次贝塞尔曲线。<em>控制点</em>是上一条曲线命令的<em>控制点</em><em>当前位置</em>上的反射点;若上一条命令不是曲线命令,则其与曲线的起始点(<em>当前位置</em>)相同。后续的坐标序列将被解释为隐式的绝对位置的平滑二次贝塞尔曲线(<code>T</code>)命令的参数。</p>

<p><a data-link-icon="https://csdnimg.cn/release/blog_editor_html/release2.4.5/ckeditor/plugins/CsdnLink/icons/icon-default.png?t=PBP8" data-link-title="公式:" href="https://developer.mozilla.org/zh-CN/docs/Web/SVG/Reference/Attribute/d#%E5%85%AC%E5%BC%8F%EF%BC%9A_5" title="公式:">公式:</a></p>

<p>Po&prime;&nbsp;=&nbsp;Pn&nbsp;= {<code>x</code>,&nbsp;<code>y</code>}</p>
</td>
</tr>
<tr>
<th scope="row">t</th>
<td>(<code>dx</code>,<code>dy</code>)+</td>
<td>
<p><em>当前位置</em><em>终点</em><em>终点</em><em>当前位置</em>沿 x 轴偏移&nbsp;<code>dx</code>&nbsp;以及沿 y 轴偏移&nbsp;<code>dy</code>&nbsp;处)之间绘制一条平滑的二次贝塞尔曲线。<em>控制点</em>是上一条曲线命令的<em>控制点</em><em>当前位置</em>上的反射点;若上一条命令不是曲线命令,则其与曲线的起始点(<em>当前位置</em>)相同。后续的坐标序列将被解释为隐式的相对位置的平滑二次贝塞尔曲线(<code>t</code>)命令的参数。</p>

<p><a data-link-icon="https://csdnimg.cn/release/blog_editor_html/release2.4.5/ckeditor/plugins/CsdnLink/icons/icon-default.png?t=PBP8" data-link-title="公式:" href="https://developer.mozilla.org/zh-CN/docs/Web/SVG/Reference/Attribute/d#%E5%85%AC%E5%BC%8F%EF%BC%9A_6" title="公式:">公式:</a></p>

<p>Po&prime;&nbsp;=&nbsp;Pn&nbsp;= {xo&nbsp;+&nbsp;<code>dx</code>,&nbsp;yo&nbsp;+&nbsp;<code>dy</code>}</p>
</td>
</tr>
</tbody>

示例

<svg
  viewBox="0 0 200 100"
  xmlns="http://www.w3.org/2000/svg"
  xmlns:xlink="http://www.w3.org/1999/xlink">
  <!-- 二次贝塞尔曲线,带有隐式重复 -->
  <path
    fill="none"
    stroke="red"
    d="M 10,50
           Q 25,25 40,50
           t 30,0 30,0 30,0 30,0 30,0" />

  <!-- 高亮显示曲线顶点和控制点 -->
  <g>
    <polyline points="10,50 25,25 40,50" stroke="rgba(0,0,0,.2)" fill="none" />
    <circle cx="25" cy="25" r="1.5" />

    <!-- 曲线顶点 -->
    <circle cx="10" cy="50" r="1.5" />
    <circle cx="40" cy="50" r="1.5" />

    <g id="SmoothQuadraticDown">
      <polyline
        points="40,50 55,75 70,50"
        stroke="rgba(0,0,0,.2)"
        stroke-dasharray="2"
        fill="none" />
      <circle cx="55" cy="75" r="1.5" fill="lightgrey" />
      <circle cx="70" cy="50" r="1.5" />
    </g>

    <g id="SmoothQuadraticUp">
      <polyline
        points="70,50 85,25 100,50"
        stroke="rgba(0,0,0,.2)"
        stroke-dasharray="2"
        fill="none" />
      <circle cx="85" cy="25" r="1.5" fill="lightgrey" />
      <circle cx="100" cy="50" r="1.5" />
    </g>

    <use xlink:href="#SmoothQuadraticDown" x="60" />
    <use xlink:href="#SmoothQuadraticUp" x="60" />
    <use xlink:href="#SmoothQuadraticDown" x="120" />
  </g>
</svg>

椭圆曲线

椭圆曲线是定义为椭圆的一部分的曲线。有时,使用椭圆曲线绘制高度规则的曲线会比使用贝塞尔曲线更容易。

命令 参数 备注
A (rx ry angle large-arc-flag sweep-flag x y)+

在当前位置和坐标 x,y 之间绘制一条椭圆曲线。用于绘制圆弧的椭圆中心根据命令的其他参数确定:

<ul>
<li><code>rx</code>&nbsp;<code>ry</code>&nbsp;是椭圆的两个半径;</li>
<li><code>angle</code>&nbsp;表示椭圆相对于 x 轴的旋转角度;</li>
<li><code>large-arc-flag</code>&nbsp;&nbsp;<code>sweep-flag</code>&nbsp;允许选择必须绘制的弧线,因为其他参数可以绘制 4 条可能的弧线。
<ul>
<li><code>large-arc-flag</code>&nbsp;允许选择一个大弧线(<code>1</code>)或一个小弧线(<code>0</code>),</li>
<li><code>sweep-flag</code>&nbsp;允许选择一条顺时针旋转的弧线(<code>1</code>)或一条逆时针旋转的弧线(<code>0</code></li>
</ul>
</li>
</ul>
坐标&nbsp;<code>x</code>,<code>y</code>&nbsp;将成为下一个命令中的当前位置。后续参数集合的序列将被解释为隐式的绝对位置的椭圆曲线(<code>A</code>)命令的参数。</td>
</tr>
<tr>
<th scope="row">a</th>
<td>(<code>rx</code>&nbsp;<code>ry</code>&nbsp;<code>angle</code>&nbsp;<code>large-arc-flag</code>&nbsp;<code>sweep-flag</code>&nbsp;<code>dx</code>&nbsp;<code>dy</code>)+</td>
<td>
<p>在当前位置和指定位置之间绘制一条椭圆曲线。指定位置为当前位置沿 x 轴偏移&nbsp;<code>dx</code>&nbsp;以及沿 y 轴偏移&nbsp;<code>dy</code>&nbsp;处。用于绘制圆弧的椭圆中心根据命令的其他参数确定:</p>

<ul>
<li><code>rx</code>&nbsp;&nbsp;<code>ry</code>&nbsp;是椭圆的两个半径;</li>
<li><code>angle</code>&nbsp;表示椭圆相对于 x 轴的旋转角度;</li>
<li><code>large-arc-flag</code>&nbsp;&nbsp;<code>sweep-flag</code>&nbsp;允许选择必须绘制的弧线,因为其他参数可以绘制 4 条可能的弧线。
<ul>
<li><code>large-arc-flag</code>&nbsp;允许选择一个大弧线(<code>1</code>)或一个小弧线(<code>0</code>),</li>
<li><code>sweep-flag</code>&nbsp;允许选择一条顺时针旋转的弧线(<code>1</code>)或一条逆时针旋转的弧线(<code>0</code></li>
</ul>
</li>
</ul>
当前位置沿 x 轴偏移&nbsp;<code>dx</code>&nbsp;以及沿 y 轴偏移后的位置将成为下一个命令中的当前位置。后续参数集合的序列将被解释为隐式的相对位置的椭圆曲线(<code>a</code>)命令的参数。</td>
</tr>
</tbody>

示例

<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
  <!-- 通过弧形标志绘制不同的弧形路径 -->
  <path
    fill="none"
    stroke="red"
    d="M 6,10
           A 6 4 10 1 0 14,10" />

  <path
    fill="none"
    stroke="lime"
    d="M 6,10
           A 6 4 10 1 1 14,10" />

  <path
    fill="none"
    stroke="purple"
    d="M 6,10
           A 6 4 10 0 1 14,10" />

  <path
    fill="none"
    stroke="pink"
    d="M 6,10
           A 6 4 10 0 0 14,10" />
</svg>

ClosePath

ClosePath 命令将从当前位置绘制一条直线到路径中的第一个点。

命令 参数 备注
Z, z 通过连接路径的最后一个点与路径的起始点来闭合当前的子路径。如果这两个点的坐标不同,则在两者之间绘制一条直线。

备注:使用 ClosePath 命令闭合的形状的外观可能与使用其他命令向起始点绘制一条线而闭合的形状不同,因为前者是将线条的末端连接在一起(根据 stroke-linejoin 的设置),而不是仅仅绘制到坐标点上。

示例

<svg viewBox="0 -1 30 11" xmlns="http://www.w3.org/2000/svg">
  <!--
  一个起点和终点不同的开放形状
  -->
  <path
    stroke="red"
    d="M 5,1
           l -4,8 8,0" />

  <!--
  一个起点和终点相同的开放形状
  -->
  <path
    stroke="red"
    d="M 15,1
           l -4,8 8,0 -4,-8" />

  <!--
  一个起点和终点不同的闭合形状
  -->
  <path
    stroke="red"
    d="M 25,1
           l -4,8 8,0
           z" />
</svg>

❌
❌