矢量路径

利用地理矢量数据进行路径规划 地理矢量数据通常是指包括点(如地标、位置坐标)、线(如街道、河流)和多边形(如行政区划、建筑物轮廓)这样的基本几何构造,这些都是构成空间数据的基本要素。在路径规划中,这些矢量数据可以被用来表示网络中的节点和边,以及它们之间的关系。路径规划通常需要解决的问题是找到两点之间的最短路径或最优路径。在ros_param.yaml里面更改初始位置和GPS话题。在move_base.launch中更改osm路径。 阅读详情

 

矢量路径

内容

8.1简介

路径表示可以填充,抚摸,用作剪切路径或三者的任意组合的形状的轮廓。(请参阅填充,描边和绘制服务器以及剪切,屏蔽和合成。)

使用当前点的概念描述路径。与纸上绘画类似,当前点可以被认为是笔的位置。可以改变笔的位置,并且可以通过以直线或曲线拖动笔来跟踪形状的轮廓(打开或关闭)。

路径表示对象轮廓的几何形状,根据moveto(设置新的当前点), lineto(绘制直线),curveto(使用立方Bézier绘制曲线),弧(椭圆或圆弧)定义和closepath(通过画线到最后一个moveto来关闭当前形状)元素。复合路径(即,具有多个子路径的路径)可以允许诸如对象中的“环形孔”之类的效果。

本章介绍SVG路径的语法,行为和DOM接口。SVG路径的各种实现说明可以在'path'元素实现说明和Elliptical arc实现说明中找到。

使用'path'元素在SVG中定义路径。

8.2 “路径”元素

'路径'

分类:

图形元素,形状元素

内容模型:

以任何顺序的以下任意数量的元素:

属性:

DOM接口:

属性定义:

d =“ 路径数据 ”

形状轮廓的定义。请参阅路径数据。
动画:是的。 仅当动画规范中的每个路径数据规范与“d”属性具有完全相同的路径数据命令列表时,才可以使用路径数据动画。如果指定了动画并且路径数据命令列表不相同,则动画规范出错(请参阅错误处理)。动画引擎基于给定动画元素的属性分别将每个参数插值到每个路径数据命令。标志和布尔值被插值为0到1之间的分数,任何非零值都被认为是1 / true的值。

pathLength =“ <number> ”

作者以用户单位计算路径的总长度。此值用于校准用户代理自己的路径距离 计算与作者的距离。用户代理将通过'pathLength'与用户代理自己的总路径长度计算值的比率来缩放所有沿路径计算。'pathLength'可能影响路径上的文本计算, 动画动画和各种笔画操作。
负值是错误(请参阅错误处理)。
动画:是的。

8.3路径数据

8.3.1路径数据的一般信息

通过包含'path' 元素来定义路径,该'path'元素包含d =“(路径数据)” 属性,其中'd'属性包含 moveto,line,curve(立方和二次Béziers),arc和closepath 指令。

示例triangle01 指定三角形形状的路径。(该 中号表示通过MoveTo中, 大号小号表明了lineTo s,并且 Ž表示closepath)。

<span style="color:#a52a2a"><?xml version =“1.0”standalone =“no”?>
<!DOCTYPE svg PUBLIC“ -  // W3C // DTD SVG 1.1 // EN” 
  “http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd”>
<svg width =“4cm”height =“4cm”viewBox =“0 0 400 400”
     xmlns =“http://www.w3.org/2000/svg”version =“1.1”>
  <title>示例triangle01-'path'的简单示例</ title>
  <desc>绘制三角形的路径</ desc>
  <rect x =“1”y =“1”width =“398”height =“398”
        fill =“none”stroke =“blue”/>
  <路径d =“M 100 100 L 300 100 L 200 300 z”
        fill =“red”stroke =“blue”stroke-width =“3”/>
</ SVG></span>
示例triangle01
示例triangle01  - “路径”的简单示例

将此示例视为SVG(仅支持SVG的浏览器)

路径数据可以包含换行符,因此可以分成多行以提高可读性。由于某些相关工具的行长度限制,建议SVG生成器跨多行分割长路径数据字符串,每行不超过255个字符。另请注意,换行符仅允许在路径数据中的某些位置。

路径数据的语法是简洁的,以便允许最小的文件大小和有效的下载,因为许多SVG文件将由它们的路径数据支配。SVG尝试最小化路径数据大小的一些方法如下:

  • 所有指令都表示为一个字符(例如, moveto表示为M)。
  • 可以消除多余的空白区域和诸如逗号的分隔符(例如,“M 100 100 L 200 200”包含不必要的空间并且可以更紧凑地表达为“M100 100L200 200”)。
  • 如果连续多次使用相同的命令,则可以在后续命令中删除命令字母(例如,您可以在“M 100 200 L 200 100 L -100 -200”中删除第二个“L”并使用“M 100” 200 L 200 100 -100 -200“而不是”。
  • 所有命令的相对版本都可用(大写表示绝对坐标,小写表示相对坐标)。
  • 替代形式的lineto可用于优化水平和垂直线(绝对和相对)的特殊情况。
  • 可以使用替代形式的曲线来优化特殊情况,其中当前段上的一些控制点可以从前一段的控制点自动确定。

路径数据语法是前缀表示法(即,命令后跟参数)。唯一允许的小数点是Unicode U + 0046 FULL STOP(“。”)字符(在Unicode中也称为PERIOD,点和小数点),不允许使用其他分隔符[ UNICODE ]。(例如,以下是路径数据流中的无效数值:“13,000.56”。而是说:“13000.56”。)

对于命令的相对版本,所有坐标值都相对于命令开头的当前点。

在下表中,使用以下表示法:

  • ():参数分组
  • +:需要一个或多个给定参数

以下部分列出了这些命令。

8.3.2 “moveto”命令

“moveto”命令(M或 m)建立新的当前点。效果就好像“笔”被抬起并移动到一个新的位置。路径数据段(如果有)必须以“moveto”命令开头。随后的“moveto”命令(即,当“moveto”不是第一个命令时)表示新子路径的开始 :

命令名称参数描述
M(绝对值)
m(相对)
搬去(XY)+在给定(x,y)坐标处开始新的子路径。 M(大写)表示将遵循绝对坐标; m(小写)表示将遵循相对坐标。如果moveto后跟多对坐标,则后续对被视为隐式lineto命令。因此,如果moveto是相对的,则隐式lineto命令将是相对的,而如果moveto是绝对的,则是绝对的。如果相对移动到(m)作为路径的第一个元素出现,然后将其视为一对绝对坐标。在这种情况下,即使初始移动被解释为绝对移动,后续的坐标对也被视为相对的。

8.3.3 “closepath”命令

“闭路径”(Z或z)结束当前子路径并导致从当前点到当前子路径的初始点绘制自动直线。如果“closepath”后面紧跟“moveto”,则“moveto”标识下一个子路径的起点。如果紧跟任何其他命令后跟随“closepath”,则下一个子路径将在与当前子路径相同的初始点开始。

当子路径以“关闭路径”结束时,它的行为与通过“lineto”命令在“stroke-linejoin” 和“stroke-linecap”中实现“手动”关闭子路径时的行为不同。使用“closepath”,子路径的最后一段的末尾使用“stroke-linejoin”的当前值与子路径的初始段的开头“连接” 。如果您通过“lineto”命令“手动”关闭子路径,则第一个段的开始和最后一个段的结尾不会连接,而是使用“stroke-linecap”的当前值进行上限。在命令结束时,

命令名称参数描述
Z或
z
closepath(没有)通过从当前点到当前子路径的初始点绘制一条直线来关闭当前子路径。由于Z和z命令不带参数,因此它们具有相同的效果。

8.3.4 “lineto”命令

各种“lineto”命令从当前点绘制直线到新点:

命令名称参数描述
L(绝对)
l(相对)
了lineTo(XY)+从当前点到给定(x,y)坐标绘制一条线,该坐标成为新的当前点。 L(大写)表示将遵循绝对坐标; l(小写)表示将遵循相对坐标。可以指定多个坐标对来绘制折线。在命令结束时,新的当前点被设置为提供的最终坐标集。
H(绝对值)
h(相对)
水平线X +绘制从当前点(cpx,cpy)到(x,cpy)的水平线。H(大写)表示将遵循绝对坐标; h (小写)表示将遵循相对坐标。可以提供多个x值(尽管通常这没有意义)。在命令结束时,新的当前点变为(x,cpy),表示x的最终值。
V(绝对)
v(相对)
垂直线Y +绘制从当前点(cpx,cpy)到(cpx,y)的垂直线。V(大写)表示将遵循绝对坐标; v (小写)表示将遵循相对坐标。可以提供多个y值(尽管通常这没有意义)。在命令结束时,新的当前点变为(cpx,y),表示y的最终值。

8.3.5曲线命令

这三组命令绘制曲线:

  • CubicBézier命令(C, c,S和 s)。立方贝塞尔曲线段由起点,终点和两个控制点定义。
  • 二次Bézier命令(Q, q,T和 t)。二次贝塞尔曲线段由起点,终点和一个控制点定义。
  • 椭圆弧命令(A和a)。椭圆弧段绘制椭圆的一段。

8.3.6三次Bézier曲线命令

立方Bézier命令如下:

命令名称参数描述
C(绝对)
c(相对)
curveto(x1 y1 x2 y2 xy)+使用(x1,y1)作为曲线起点处的控制点和(x2,y2)作为曲线末端的控制点,绘制从当前点到(x,y)的三次Bézier曲线。C(大写)表示将遵循绝对坐标; c(小写)表示将遵循相对坐标。可以指定多组坐标来绘制多面体。在命令结束时,新的当前点成为多面体中使用的最终(x,y)坐标对。
S(绝对)
s(相对)
速记/平滑曲线(x2 y2 xy)+绘制从当前点到(x,y)的三次贝塞尔曲线。假设第一个控制点是前一个命令相对于当前点的第二个控制点的反射。(如果没有上一个命令或前一个命令不是C,c,S或s,则假设第一个控制点与当前点重合。)(x2,y2)是第二个控制点(即曲线末端的控制点)。 S(大写)表示将遵循绝对坐标; 小号(小写)表示将遵循相对坐标。可以指定多组坐标来绘制多面体。在命令结束时,新的当前点成为多面体中使用的最终(x,y)坐标对。

示例cubic01显示了路径中三次Bézier命令的一些简单用法。该示例使用内部CSS样式表来指定样式属性。注意,“S”命令的控制点是作为前一个“C”命令的控制点相对于“S”命令的起始点的反映而自动计算的。

<span style="color:#a52a2a"><?xml version =“1.0”standalone =“no”?>
<!DOCTYPE svg PUBLIC“ -  // W3C // DTD SVG 1.1 // EN” 
  “http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd”>
<svg width =“5cm”height =“4cm”viewBox =“0 0 500 400”
     xmlns =“http://www.w3.org/2000/svg”version =“1.1”>
  <title>路径数据</ title>中的cubic01-立方Bézier命令示例
  <desc>图片显示路径数据的简单示例
        使用“C”和“S”命令,
        以及显示控制点的注释
        和终点</ desc>
  <style type =“text / css”> <![CDATA [
    .Border {fill:none; 行程:蓝色; 笔画宽度:1}
    .Connect {fill:none; 行程:#888888; 笔画宽度:2}
    .SamplePath {fill:none; 行程:红色; 笔画宽度:5}
    .EndPoint {fill:none; 行程:#888888; 笔画宽度:2}
    .CtlPoint {填写:#888888; 中风:无}
    .AutoCtlPoint {fill:none; 行程:蓝色; 笔画宽度:4}
    .Label {font-size:22; font-family:Verdana}
  ]]> </样式>

  <rect class =“Border”x =“1”y =“1”width =“498”height =“398”/>

  <polyline class =“Connect”points =“100,200 100,100”/>
  <polyline class =“Connect”points =“250,100 250,200”/>
  <polyline class =“Connect”points =“250,200 250,300”/>
  <polyline class =“Connect”points =“400,300 400,200”/>
  <path class =“SamplePath”d =“M100,200 C100,100 250,100 250,200
                                       S400,300 400,200“/>
  <circle class =“EndPoint”cx =“100”cy =“200”r =“10”/>
  <circle class =“EndPoint”cx =“250”cy =“200”r =“10”/>
  <circle class =“EndPoint”cx =“400”cy =“200”r =“10”/>
  <circle class =“CtlPoint”cx =“100”cy =“100”r =“10”/>
  <circle class =“CtlPoint”cx =“250”cy =“100”r =“10”/>
  <circle class =“CtlPoint”cx =“400”cy =“300”r =“10”/>
  <circle class =“AutoCtlPoint”cx =“250”cy =“300”r =“9”/>
  <text class =“Label”x =“25”y =“70”> M100,200 C100,100 250,100 250,200 </ text>
  <text class =“Label”x =“325”y =“350”
        style =“text-anchor:middle”> S400,300 400,200 </ text>
</ SVG></span>
示例cubic01
示例cubic01  - 路径数据中的立方Bézier同义词

将此示例视为SVG(仅支持SVG的浏览器)

下图显示了一些立方贝塞尔曲线如何根据控制点的位置改变其形状。前五个例子说明了一个单立方Bézier路径段。右下角的示例显示“C”命令后跟“S”命令。

路径数据中的cubic02  - cubicBézier命令示例

将此示例视为SVG(仅支持SVG的浏览器)
 

8.3.7二次Bézier曲线命令

二次Bézier命令如下:

命令名称参数描述
Q(绝对)
q(相对)
二次Bézier曲线(x1 y1 xy)+使用(x1,y1)作为控制点,绘制从当前点到(x,y)的二次Bézier曲线。 Q(大写)表示将遵循绝对坐标; q(小写)表示将遵循相对坐标。可以指定多组坐标来绘制多面体。在命令结束时,新的当前点成为多面体中使用的最终(x,y)坐标对。
T(绝对值)
t(相对)
速记/平滑二次Bézier曲线(XY)+绘制从当前点到(x,y)的二次贝塞尔曲线。假设控制点是前一个命令相对于当前点的控制点的反映。(如果没有上一个命令或前一个命令不是Q,q,T或t,则假设控制点与当前点重合。)T(大写)表示将遵循绝对坐标; t (小写)表示将遵循相对坐标。在命令结束时,新的当前点成为多面体中使用的最终(x,y)坐标对。

示例quad01显示了路径中二次Bézier命令的一些简单用法。注意,“T”命令的控制点自动计算为前一个“Q”命令的控制点相对于“T”命令的起始点的反映。

<span style="color:#a52a2a"><?xml version =“1.0”standalone =“no”?>
<!DOCTYPE svg PUBLIC“ -  // W3C // DTD SVG 1.1 // EN” 
  “http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd”>
<svg width =“12cm”height =“6cm”viewBox =“0 0 1200 600”
     xmlns =“http://www.w3.org/2000/svg”version =“1.1”>
  <title>示例quad01  - 路径数据中的二次Bézier命令</ title>
  <desc>图片显示“Q”和“T”命令,
        以及显示控制点的注释
        和终点</ desc>
  <rect x =“1”y =“1”width =“1198”height =“598”
        fill =“none”stroke =“blue”stroke-width =“1”/>

  <路径d =“M200,300 Q400,50 600,300 T1000,300”
        fill =“none”stroke =“red”stroke-width =“5”/>
  <! - 结束点 - >
  <g fill =“black”>
    <circle cx =“200”cy =“300”r =“10”/>
    <circle cx =“600”cy =“300”r =“10”/>
    <circle cx =“1000”cy =“300”r =“10”/>
  </ g>的
  <! - 从终点到控制点的控制点和线 - >
  <g fill =“#888888”>
    <circle cx =“400”cy =“50”r =“10”/>
    <circle cx =“800”cy =“550”r =“10”/>
  </ g>的
  <路径d =“M200,300 L400,50 L600,300 
           L800,550 L1000,300“
        fill =“none”stroke =“#888888”stroke-width =“2”/>
</ SVG></span>
示例quad01
示例quad01  - 路径数据中的二次Bézier命令

将此示例视为SVG(仅支持SVG的浏览器)

8.3.8椭圆弧曲线命令

椭圆弧命令如下:

命令名称参数描述
A(绝对)
a(相对)
椭圆弧(rx ry x轴旋转大弧标志扫描标志x y)+从当前点到(x,y)绘制一个椭圆弧。椭圆的大小和方向由两个半径(rx,ry)和 x轴旋转定义,其指示椭圆作为整体如何相对于当前坐标系旋转。自动计算椭圆的中心(cx, cy)以满足其他参数施加的约束。large-arc-flag和 sweep-flag有助于自动计算并帮助确定如何绘制弧。

示例arcs01显示了路径中弧命令的一些简单用法。

<span style="color:#a52a2a"><?xml version =“1.0”standalone =“no”?>
<!DOCTYPE svg PUBLIC“ -  // W3C // DTD SVG 1.1 // EN” 
  “http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd”>
<svg width =“12cm”height =“5.25cm”viewBox =“0 0 1200 400”
     xmlns =“http://www.w3.org/2000/svg”version =“1.1”>
  <title>示例arcs01  - 路径数据</ title>中的arc命令
  <desc>饼图的图片有两个饼楔和
        带有弧光的线条图片</ desc>
  <rect x =“1”y =“1”width =“1198”height =“398”
        fill =“none”stroke =“blue”stroke-width =“1”/>

  <路径d =“M300,200 h-150 a150,150 0 1,0 150,-150 z”
        fill =“red”stroke =“blue”stroke-width =“5”/>
  <路径d =“M275,175 v-150 a150,150 0 0,0 -150,150 z”
        fill =“yellow”stroke =“blue”stroke-width =“5”/>

  <路径d =“M600,350升50,-25 
           a25,25 -30 0,150,-25 l 50,-25 
           a25,50 -30 0,1 50,-25 l 50,-25 
           a25,75 -30 0,150,-25 l 50,-25 
           a25,100 -30 0,150,-25 l 50,-25“
        fill =“none”stroke =“red”stroke-width =“5”/>
</ SVG></span>
示例arcs01
示例arcs01  - 路径数据中的arc命令

将此示例视为SVG(仅支持SVG的浏览器)

椭圆弧命令绘制椭圆的一部分,满足以下约束:

  • 弧从当前点开始
  • 弧在点(x, y)处结束
  • 椭圆有两个半径(rx, ry)
  • 椭圆的x轴相对于当前坐标系的x轴旋转 x轴旋转。

对于大多数情况,实际上存在四个不同的弧(两个不同的椭圆,每个具有两个不同的弧扫描)以满足这些约束。large-arc-flag 和sweep-flag表示绘制四个弧中的哪一个,如下所示:

  • 在四个候选弧扫描中,两个将表示大于或等于180度的弧扫描(“大弧”),两个将表示小于或等于180度的弧扫描(“小 - 弧”)。如果 大弧标志为'1',则将选择两个较大弧扫描中的一个; 否则,如果 大弧标志为'0',将选择一个较小的弧扫描,
  • 如果sweep-flag为'1',则弧将以“正角”方向绘制(即椭圆公式x = cx + rx * cos(theta)和y = cy + ry * sin(theta)评估θ,使得theta以对应于当前点的角度开始并且积极地增加直到弧到达(x,y))。值0使得弧以“负角度”方向绘制(即,θ以对应于当前点的角度值开始并且减小直到弧到达(x,y))。

下面说明了大弧标志和扫描标志的四种组合以及 将根据这些标志的值绘制的四种不同的弧。对于每种情况,使用以下路径数据命令:

<路径d =“M 125,75 a100,50 0?,?100,50”
      style =“fill:none; stroke:red; stroke-width:6”/>

“?,?” 由“0,0”“0,1”“1,0”和“1,1”代替,以产生四种可能的情况。

旗子的例证在弧命令的

将此示例视为SVG(仅支持SVG的浏览器)

有关路径数据椭圆弧命令的详细实施说明,请参阅椭圆弧实施说明。

8.3.9路径数据的语法

以下表示法用于Backus-Naur形式(BNF)路径数据语法描述:

  • *:0或更多
  • +:1或更多
  • ?:0或1
  • ():分组
  • |:分隔替代品
  • 双引号环绕文字

以下是SVG路径的BNF。

<span style="color:#a52a2a">SVG路径:
    wsp * moveto-drawto-command-groups?WSP *
MOVETO-drawto命令的基团:
    通过MoveTo-drawto-命令组
    | moveto-drawto-command-group wsp * moveto-drawto-command-groups
通过MoveTo-drawto-命令组:
    moveto wsp * drawto-commands?
drawto的命令:
    drawto命令
    | drawto-command wsp * drawto-commands
drawto命令:
    closepath
    | 了lineTo
    | 水平了lineTo
    | 垂直了lineTo
    | curveto
    | 光滑curveto
    | 二次 - 贝塞尔 -  curveto
    | 光滑二次 - 贝塞尔 -  curveto
    | 椭圆弧
搬去:
    (“M”|“m”)wsp * moveto-argument-sequence
MOVETO参数的序列:
    坐标对
    | 坐标对逗号wsp?线 - 参数序列
closepath:
    (“Z”|“z”)
了lineTo:
    (“L”|“l”)wsp * lineto-argument-sequence
线 - 参数序列:
    坐标对
    | 坐标对逗号wsp?线 - 参数序列
水平了lineTo:
    (“H”|“h”)wsp * horizo​​ntal-lineto-argument-sequence
水平线 - 参数序列:
    坐标
    | 坐标逗号wsp?水平线 - 参数序列
垂直了lineTo:
    (“V”|“v”)wsp * vertical-lineto-argument-sequence
垂直线 - 参数序列:
    坐标
    | 坐标逗号wsp?垂直线 - 参数序列
curveto:
    (“C”|“c”)wsp * curveto-argument-sequence
curveto参数的序列:
    curveto参数的
    | curveto-argument comma-wsp?curveto参数的序
curveto-参数:
    坐标对逗号wsp?坐标对逗号wsp?坐标对
光滑curveto:
    (“S”|“s”)wsp * smooth-curveto-argument-sequence
光滑curveto参数的序列:
    光滑curveto参数的
    | smooth-curveto-argument逗号-wsp?光滑curveto参数的序
光滑curveto-参数:
    坐标对逗号wsp?坐标对
二次 - 贝塞尔 -  curveto:
    (“Q”|“q”)wsp * quadratic-bezier-curveto-argument-sequence
二次 - 贝塞尔 -  curveto参数的序列:
    二次 - 贝塞尔 -  curveto参数的
    | quadratic-bezier-curveto-argument逗号-wsp?
        二次 - 贝塞尔 -  curveto参数的序列
二次 - 贝塞尔 -  curveto-参数:
    坐标对逗号wsp?坐标对
光滑二次 - 贝塞尔 -  curveto:
    (“T”|“t”)wsp * smooth-quadratic-bezier-curveto-argument-sequence
平滑二次-贝塞尔-curveto参数的序列:
    坐标对
    | 坐标对逗号wsp?平滑二次-贝塞尔-curveto参数的序
椭圆弧:
    (“A”|“a”)wsp * elliptical-arc-argument-sequence
椭圆弧参数序列:
    椭圆弧参数
    | elliptical-arc-argument comma-wsp?椭圆弧参数序列
椭圆弧参数:
    非负数字逗号-wsp?非负数字逗号-wsp?
        数字逗号-wsp标志逗号-wsp?标志逗号wsp?坐标对
坐标对:
    坐标逗号wsp?坐标
坐标:
    数
非负号码:
    整数常数
    | 浮点常数
数:
    标志?整数常数
    | 标志?浮点常数
旗:
    “0”| “1”
逗号WSP:
    (wsp +逗号?wsp *)| (逗号wsp *)
逗号:
    “”
整型常量:
    数字序列
浮点常数:
    分数常数指数?
    | 数字序列指数
分数不变:
    数字序列?“” 数字序列
    | 数字序列“。”
指数:
    (“e”|“E”)标志?数字序列
标志:
    “+”| “ - ”
数字序列:
    数字
    | 数字数字序列
数字:
    “0”| “1”| “2”| “3”| “4”| “5”| “6”| “7”| “8”| “9”
WSP:
    (#x20 |#x9 | #xD | #xA)
</span>

BNF的处理必须消耗尽可能多的给定BNF产量,在遇到不再满足产品的字符时停止。因此,在字符串“M 100-200”中,“moveto”的第一个坐标消耗字符“100”并在遇到减号时停止,因为减号不能跟随“坐标”产生中的数字。结果是第一个坐标为“100”,第二个坐标为“-200”。

类似地,对于字符串“M 0.6.5”,“moveto”的第一个坐标消耗字符“0.6”并在遇到第二个小数点时停止,因为“坐标”的产生仅允许一个小数点。结果是第一个坐标为“0.6”,第二个坐标为“.5”。

请注意,BNF允许路径“d”属性为空。这不是错误,而是禁用路径的渲染。

8.4沿路径的距离

各种操作,包括路径上的文本和运动动画 以及各种笔划操作,要求用户代理计算沿着图形元素的几何形状的距离,例如“路径”。

存在用于计算沿路径的距离的精确数学,但是公式非常复杂并且需要大量计算。建议创作产品和用户代理使用能够产生尽可能精确结果的算法; 但是,为了适应实现差异并帮助距离计算产生近似作者意图的结果,'pathLength'属性可用于提供作者对路径总长度的计算,以便用户代理可以沿着距离缩放距离-path计算“pathLength”与用户代理自己的总路径长度计算值之比。

“path”元素内的“moveto”操作被定义为具有零长度。只有各种“lineto”,“curveto”和“arcto”命令有助于路径长度计算。

8.5 DOM接口

8.5.1接口SVGPathSeg

所述SVGPathSeg接口是一个路径数据指定内对应于单个命令一个基本接口。

<span style="color:#000000">interface <strong>SVGPathSeg</strong> {

  //路径段类型
  const unsigned short <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_UNKNOWN" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_UNKNOWN">PATHSEG_UNKNOWN</a> = 0;
  const unsigned short <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_CLOSEPATH" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_CLOSEPATH">PATHSEG_CLOSEPATH</a> = 1;
  const unsigned short <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_MOVETO_ABS" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_MOVETO_ABS">PATHSEG_MOVETO_ABS</a> = 2;
  const unsigned short <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_MOVETO_REL" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_MOVETO_REL">PATHSEG_MOVETO_REL</a> = 3;
  const unsigned short <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_LINETO_ABS" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_LINETO_ABS">PATHSEG_LINETO_ABS</a> = 4;
  const unsigned short <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_LINETO_REL" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_LINETO_REL">PATHSEG_LINETO_REL</a> = 5;
  const unsigned short <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_CURVETO_CUBIC_ABS" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_CURVETO_CUBIC_ABS">PATHSEG_CURVETO_CUBIC_ABS</a> = 6;
  const unsigned short <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_CURVETO_CUBIC_REL" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_CURVETO_CUBIC_REL">PATHSEG_CURVETO_CUBIC_REL</a> = 7;
  const unsigned short <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_CURVETO_QUADRATIC_ABS" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_CURVETO_QUADRATIC_ABS">PATHSEG_CURVETO_QUADRATIC_ABS</a> = 8;
  const unsigned short <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_CURVETO_QUADRATIC_REL" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_CURVETO_QUADRATIC_REL">PATHSEG_CURVETO_QUADRATIC_REL</a> = 9;
  const unsigned short <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_ARC_ABS" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_ARC_ABS">PATHSEG_ARC_ABS</a> = 10;
  const unsigned short <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_ARC_REL" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_ARC_REL">PATHSEG_ARC_REL</a> = 11;
  const unsigned short <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_LINETO_HORIZONTAL_ABS" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_LINETO_HORIZONTAL_ABS">PATHSEG_LINETO_HORIZONTAL_ABS</a> = 12;
  const unsigned short <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_LINETO_HORIZONTAL_REL" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_LINETO_HORIZONTAL_REL">PATHSEG_LINETO_HORIZONTAL_REL</a> = 13;
  const unsigned short <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_LINETO_VERTICAL_ABS" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_LINETO_VERTICAL_ABS">PATHSEG_LINETO_VERTICAL_ABS</a> = 14;
  const unsigned short <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_LINETO_VERTICAL_REL" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_LINETO_VERTICAL_REL">PATHSEG_LINETO_VERTICAL_REL</a> = 15;
  const unsigned short <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_CURVETO_CUBIC_SMOOTH_ABS" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_CURVETO_CUBIC_SMOOTH_ABS">PATHSEG_CURVETO_CUBIC_SMOOTH_ABS</a> = 16;
  const unsigned short <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_CURVETO_CUBIC_SMOOTH_REL" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_CURVETO_CUBIC_SMOOTH_REL">PATHSEG_CURVETO_CUBIC_SMOOTH_REL</a> = 17;
  const unsigned short <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS">PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS</a> = 18;
  const unsigned short <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL">PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL</a> = 19;

  readonly属性unsigned short <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__pathSegType" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__pathSegType">pathSegType</a> ;
  readonly属性DOMString <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__pathSegTypeAsLetter" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSeg__pathSegTypeAsLetter">pathSegTypeAsLetter</a> ;
};</span>

“路径段类型”组中的常量:

PATHSEG_UNKNOWN (unsigned short)

单位类型不是预定义类型之一。尝试定义此类型的新值或尝试将现有值切换为此类型无效。

PATHSEG_CLOSEPATH (unsigned short)

对应于“closepath”(z)路径数据命令。

PATHSEG_MOVETO_ABS (无符号短)

对应于“绝对移动”(M)路径数据命令。

PATHSEG_MOVETO_REL (无符号短)

对应于“相对移动”(m)路径数据命令。

PATHSEG_LINETO_ABS (unsigned short)

对应于“绝对线路”(L)路径数据命令。

PATHSEG_LINETO_REL (无符号短)

对应于“相对线路”(l)路径数据命令。

PATHSEG_CURVETO_CUBIC_ABS (无符号短)

对应于“绝对立方Bézier曲线到”(C)路径数据命令。

PATHSEG_CURVETO_CUBIC_REL (无符号短)

对应于“相对立方Bézier曲线到”(c)路径数据命令。

PATHSEG_CURVETO_QUADRATIC_ABS (unsigned short)

对应于“绝对二次Bézier曲线到”(Q)路径数据命令。

PATHSEG_CURVETO_QUADRATIC_REL (无符号短)

对应于“相对二次Bézier曲线到”(q)路径数据命令。

PATHSEG_ARC_ABS (无符号短)

对应于“绝对arcto”(A)路径数据命令。

PATHSEG_ARC_REL (无符号短)

对应于“相对arcto”(a)路径数据命令。

PATHSEG_LINETO_HORIZONTAL_ABS (无符号短)

对应于“绝对水平线到”(H)路径数据命令。

PATHSEG_LINETO_HORIZONTAL_REL (无符号短)

对应于“相对水平线到”(h)路径数据命令。

PATHSEG_LINETO_VERTICAL_ABS (无符号短)

对应于“绝对垂直线路”(V)路径数据命令。

PATHSEG_LINETO_VERTICAL_REL (无符号短)

对应于“相对垂直线到”(v)路径数据命令。

PATHSEG_CURVETO_CUBIC_SMOOTH_ABS (无符号短)

对应于“绝对平滑三次曲线到”(S)路径数据命令。

PATHSEG_CURVETO_CUBIC_SMOOTH_REL (无符号短)

对应于“相对平滑的立方曲线到”(s)路径数据命令。

PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS (无符号短)

对应于“绝对平滑二次曲线到”(T)路径数据命令。

PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL (无符号短)

对应于“相对平滑的二次曲线到”(t)路径数据命令。

属性:

pathSegType (readonly unsigned short)

由此接口上定义的常量之一指定的路径段的类型。

pathSegTypeAsLetter (readonly DOMString)

路径段的类型,由相应的一个字符命令名称指定。

8.5.2接口SVGPathSegClosePath

所述SVGPathSegClosePath接口对应于“closepath”(z)的数据路径指令。

<span style="color:#000000">interface <strong>SVGPathSegClosePath</strong>:<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg</a> {
};</span>

8.5.3接口SVGPathSegMovetoAbs

所述SVGPathSegMovetoAbs接口对应于“绝对通过MoveTo”(M)路径数据命令。

<span style="color:#000000">interface <strong>SVGPathSegMovetoAbs</strong>:<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg</a> {
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegMovetoAbs__x" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegMovetoAbs__x">x</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegMovetoAbs__y" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegMovetoAbs__y">y</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
};</span>

属性:

x (浮动)

此路径段结束点的绝对X坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

y (浮动)

此路径段结束点的绝对Y坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

8.5.4接口SVGPathSegMovetoRel

所述SVGPathSegMovetoRel接口对应于“相对通过MoveTo”(M)路径数据命令。

<span style="color:#000000">interface <strong>SVGPathSegMovetoRel</strong>:<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg</a> {
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegMovetoRel__x" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegMovetoRel__x">x</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegMovetoRel__y" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegMovetoRel__y">y</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
};</span>

属性:

x (浮动)

此路径段的结束点的相对X坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

y (浮动)

此路径段结束点的相对Y坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

8.5.5接口SVGPathSegLinetoAbs

所述SVGPathSegLinetoAbs接口对应于“绝对了lineTo”(L)的路径数据命令。

<span style="color:#000000">interface <strong>SVGPathSegLinetoAbs</strong>:<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg</a> {
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegLinetoAbs__x" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegLinetoAbs__x">x</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegLinetoAbs__y" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegLinetoAbs__y">y</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
};</span>

属性:

x (浮动)

此路径段结束点的绝对X坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

y (浮动)

此路径段结束点的绝对Y坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

8.5.6接口SVGPathSegLinetoRel

所述SVGPathSegLinetoRel接口对应于“相对了lineTo”(L)的路径数据命令。

<span style="color:#000000">interface <strong>SVGPathSegLinetoRel</strong>:<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg</a> {
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegLinetoRel__x" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegLinetoRel__x">x</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegLinetoRel__y" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegLinetoRel__y">y</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
};</span>

属性:

x (浮动)

此路径段的结束点的相对X坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

y (浮动)

此路径段结束点的相对Y坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

8.5.7接口SVGPathSegCurvetoCubicAbs

所述SVGPathSegCurvetoCubicAbs接口对应于“绝对三次贝塞尔curveto”(C)的路径数据命令。

<span style="color:#000000">interface <strong>SVGPathSegCurvetoCubicAbs</strong>:<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg</a> {
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicAbs__x" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicAbs__x">x</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicAbs__y" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicAbs__y">y</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicAbs__x1" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicAbs__x1">x1</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicAbs__y1" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicAbs__y1">y1</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicAbs__x2" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicAbs__x2">x2</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicAbs__y2" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicAbs__y2">y2</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
};</span>

属性:

x (浮动)

此路径段结束点的绝对X坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

y (浮动)

此路径段结束点的绝对Y坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

x1 (浮动)

第一个控制点的绝对X坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

y1 (浮动)

第一个控制点的绝对Y坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

x2 (浮动)

第二个控制点的绝对X坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

y2 (浮动)

第二个控制点的绝对Y坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

8.5.8接口SVGPathSegCurvetoCubicRel

所述SVGPathSegCurvetoCubicRel接口对应于“相对三次贝塞尔curveto”(c)中的路径数据命令。

<span style="color:#000000">interface <strong>SVGPathSegCurvetoCubicRel</strong>:<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg</a> {
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicRel__x" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicRel__x">x</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicRel__y" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicRel__y">y</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicRel__x1" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicRel__x1">x1</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicRel__y1" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicRel__y1">y1</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicRel__x2" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicRel__x2">x2</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicRel__y2" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicRel__y2">y2</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
};</span>

属性:

x (浮动)

此路径段的结束点的相对X坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

y (浮动)

此路径段结束点的相对Y坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

x1 (浮动)

第一个控制点的相对X坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

y1 (浮动)

第一个控制点的相对Y坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

x2 (浮动)

第二个控制点的相对X坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

y2 (浮动)

第二个控制点的相对Y坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

8.5.9接口SVGPathSegCurvetoQuadraticAbs

所述SVGPathSegCurvetoQuadraticAbs接口对应于“绝对二次贝塞尔curveto”(Q)路径数据命令。

<span style="color:#000000">interface <strong>SVGPathSegCurvetoQuadraticAbs</strong>:<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg</a> {
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoQuadraticAbs__x" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoQuadraticAbs__x">x</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoQuadraticAbs__y" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoQuadraticAbs__y">y</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoQuadraticAbs__x1" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoQuadraticAbs__x1">x1</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoQuadraticAbs__y1" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoQuadraticAbs__y1">y1</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
};</span>

属性:

x (浮动)

此路径段结束点的绝对X坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

y (浮动)

此路径段结束点的绝对Y坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

x1 (浮动)

第一个控制点的绝对X坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

y1 (浮动)

第一个控制点的绝对Y坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

8.5.10接口SVGPathSegCurvetoQuadraticRel

所述SVGPathSegCurvetoQuadraticRel接口对应于“相对二次贝塞尔curveto”(Q)路径数据命令。

<span style="color:#000000">interface <strong>SVGPathSegCurvetoQuadraticRel</strong>:<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg</a> {
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoQuadraticRel__x" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoQuadraticRel__x">x</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoQuadraticRel__y" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoQuadraticRel__y">y</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoQuadraticRel__x1" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoQuadraticRel__x1">x1</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoQuadraticRel__y1" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoQuadraticRel__y1">y1</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
};</span>

属性:

x (浮动)

此路径段的结束点的相对X坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

y (浮动)

此路径段结束点的相对Y坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

x1 (浮动)

第一个控制点的相对X坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

y1 (浮动)

第一个控制点的相对Y坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

8.5.11接口SVGPathSegArcAbs

所述SVGPathSegArcAbs接口对应于“绝对包含arcTo”(A)路径数据命令。

<span style="color:#000000">interface <strong>SVGPathSegArcAbs</strong>:<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg</a> {
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcAbs__x" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcAbs__x">x</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcAbs__y" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcAbs__y">y</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcAbs__r1" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcAbs__r1">r1</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcAbs__r2" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcAbs__r2">r2</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcAbs__angle" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcAbs__angle">angle</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute boolean <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcAbs__largeArcFlag" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcAbs__largeArcFlag">largeArcFlag</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute boolean <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcAbs__sweepFlag" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcAbs__sweepFlag">sweepFlag</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
};</span>

属性:

x (浮动)

此路径段结束点的绝对X坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

y (浮动)

此路径段结束点的绝对Y坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

r1 (浮动)

椭圆的x轴半径(即r1)。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

r2 (浮动)

椭圆的y轴半径(即r2)。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

角度(浮动)

椭圆的x轴相对于用户坐标系的x轴的旋转角度(以度为单位)。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

largeArcFlag (boolean)

large-arc-flag参数的值。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

sweepFlag (布尔值)

sweep-flag参数的值。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

8.5.12接口SVGPathSegArcRel

所述SVGPathSegArcRel接口对应于“相对包含arcTo”(a)中路径数据命令。

<span style="color:#000000">interface <strong>SVGPathSegArcRel</strong>:<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg</a> {
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcRel__x" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcRel__x">x</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcRel__y" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcRel__y">y</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcRel__r1" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcRel__r1">r1</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcRel__r2" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcRel__r2">r2</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcRel__angle" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcRel__angle">angle</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute boolean <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcRel__largeArcFlag" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcRel__largeArcFlag">largeArcFlag</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute boolean <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcRel__sweepFlag" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegArcRel__sweepFlag">sweepFlag</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
};</span>

属性:

x (浮动)

此路径段的结束点的相对X坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

y (浮动)

此路径段结束点的相对Y坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

r1 (浮动)

椭圆的x轴半径(即r1)。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

r2 (浮动)

椭圆的y轴半径(即r2)。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

角度(浮动)

椭圆的x轴相对于用户坐标系的x轴的旋转角度(以度为单位)。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

largeArcFlag (boolean)

large-arc-flag参数的值。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

sweepFlag (布尔值)

sweep-flag参数的值。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

8.5.13接口SVGPathSegLinetoHorizo​​ntalAbs

所述SVGPathSegLinetoHorizo​​ntalAbs接口对应于“绝对水平了lineTo”(H)路径数据命令。

<span style="color:#000000">interface <strong>SVGPathSegLinetoHorizo​​ntalAbs</strong>:<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg</a> {
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegLinetoHorizontalAbs__x" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegLinetoHorizontalAbs__x">x</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
};</span>

属性:

x (浮动)

此路径段结束点的绝对X坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

8.5.14接口SVGPathSegLinetoHorizo​​ntalRel

所述SVGPathSegLinetoHorizo​​ntalRel接口对应于“相对水平了lineTo”(H)路径数据命令。

<span style="color:#000000">interface <strong>SVGPathSegLinetoHorizo​​ntalRel</strong>:<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg</a> {
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegLinetoHorizontalRel__x" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegLinetoHorizontalRel__x">x</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
};</span>

属性:

x (浮动)

此路径段的结束点的相对X坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

8.5.15接口SVGPathSegLinetoVerticalAbs

所述SVGPathSegLinetoVerticalAbs接口对应于“绝对垂直了lineTo”(V)的路径数据命令。

<span style="color:#000000">interface <strong>SVGPathSegLinetoVerticalAbs</strong>:<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg</a> {
  attribute float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegLinetoVerticalAbs__y" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegLinetoVerticalAbs__y">y</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
};</span>

属性:

y (浮动)

此路径段结束点的绝对Y坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

8.5.16接口SVGPathSegLinetoVerticalRel

所述SVGPathSegLinetoVerticalRel接口对应于“相对竖直了lineTo”(v)的路径数据命令。

<span style="color:#000000">interface <strong>SVGPathSegLinetoVerticalRel</strong>:<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg</a> {
  attribute float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegLinetoVerticalRel__y" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegLinetoVerticalRel__y">y</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
};</span>

属性:

y (浮动)

此路径段结束点的相对Y坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

8.5.17接口SVGPathSegCurvetoCubicSmoothAbs

所述SVGPathSegCurvetoCubicSmoothAbs接口对应于“绝对平滑三次curveto”(S)路径数据命令。

<span style="color:#000000">interface <strong>SVGPathSegCurvetoCubicSmoothAbs</strong>:<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg</a> {
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicSmoothAbs__x" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicSmoothAbs__x">x</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicSmoothAbs__y" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicSmoothAbs__y">y</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicSmoothAbs__x2" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicSmoothAbs__x2">x2</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicSmoothAbs__y2" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicSmoothAbs__y2">y2</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
};</span>

属性:

x (浮动)

此路径段结束点的绝对X坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

y (浮动)

此路径段结束点的绝对Y坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

x2 (浮动)

第二个控制点的绝对X坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

y2 (浮动)

第二个控制点的绝对Y坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

8.5.18接口SVGPathSegCurvetoCubicSmoothRel

所述SVGPathSegCurvetoCubicSmoothRel接口对应于“相对平滑三次curveto”(多个)路径数据命令。

<span style="color:#000000">interface <strong>SVGPathSegCurvetoCubicSmoothRel</strong>:<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg</a> {
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicSmoothRel__x" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicSmoothRel__x">x</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicSmoothRel__y" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicSmoothRel__y">y</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicSmoothRel__x2" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicSmoothRel__x2">x2</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicSmoothRel__y2" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoCubicSmoothRel__y2">y2</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
};</span>

属性:

x (浮动)

此路径段的结束点的相对X坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

y (浮动)

此路径段结束点的相对Y坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

x2 (浮动)

第二个控制点的相对X坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

y2 (浮动)

第二个控制点的相对Y坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

8.5.19接口SVGPathSegCurvetoQuadraticSmoothAbs

所述SVGPathSegCurvetoQuadraticSmoothAbs接口对应于“绝对平滑三次curveto”(T)的路径数据命令。

<span style="color:#000000">interface <strong>SVGPathSegCurvetoQuadraticSmoothAbs</strong>:<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg</a> {
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoQuadraticSmoothAbs__x" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoQuadraticSmoothAbs__x">x</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoQuadraticSmoothAbs__y" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoQuadraticSmoothAbs__y">y</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
};</span>

属性:

x (浮动)

此路径段结束点的绝对X坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

y (浮动)

此路径段结束点的绝对Y坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

8.5.20接口SVGPathSegCurvetoQuadraticSmoothRel

所述SVGPathSegCurvetoQuadraticSmoothRel接口对应于“相对平滑三次curveto”(t)的路径数据命令。

<span style="color:#000000">interface <strong>SVGPathSegCurvetoQuadraticSmoothRel</strong>:<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg</a> {
  属性float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoQuadraticSmoothRel__x" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoQuadraticSmoothRel__x">x</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  attribute float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoQuadraticSmoothRel__y" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegCurvetoQuadraticSmoothRel__y">y</a> setraises(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
};</span>

属性:

x (浮动)

此路径段的结束点的相对X坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

y (浮动)

此路径段结束点的相对Y坐标。

设置例外

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

尝试更改只读属性的值时触发。

8.5.21接口SVGPathSegList

此接口定义SVGPathSeg对象的列表。

SVGPathSegList与其他SVGxxxList接口具有相同的属性和方法。实现者可以考虑使用单个基类来实现各种SVGxxxList接口。

<span style="color:#000000">interface <strong>SVGPathSegList</strong> {

  readonly属性unsigned long <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegList__numberOfItems" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegList__numberOfItems">numberOfItems</a> ;

  void <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegList__clear" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegList__clear">clear</a>()引发(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegList__initialize" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegList__initialize">初始化</a>(在<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg中使用</a> newItem)引发(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegList__getItem" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegList__getItem">getItem</a>(在无符号长索引中)引发(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegList__insertItemBefore" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegList__insertItemBefore">insertItemBefore</a>(在<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg</a> newItem中,在unsigned long索引中)引发(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegList__replaceItem" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegList__replaceItem">replaceItem</a>(在<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg</a> newItem中,在unsigned long索引中)引发(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegList__removeItem" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegList__removeItem">removeItem</a>(在无符号长索引中)引发(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegList__appendItem" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathSegList__appendItem">appendItem</a>(在<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSeg" class="idlinterface">SVGPathSeg</a> newItem中)引发(<a data-cke-saved-href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187" class="idlinterface">DOMException</a>);
};</span>

属性:

numberOfItems (只读无符号长)

列表中的项目数。

操作:

void clear()

清除列表中所有现有的当前项,结果为空列表。

异常

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

当列表无法修改时引发。

SVGPathSeg 初始化(在SVGPathSeg newItem中)

清除列表中的所有现有当前项,并重新初始化列表以保存参数指定的单个项。如果插入的项目已经在列表中,则在将其插入此列表之前,它将从之前的列表中删除。插入的项目是项目本身而不是副本。

参数

  1. SVGPathSeg newItem

    应成为列表唯一成员的项目。

返回

正在插入列表的项目。

异常

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

当列表无法修改时引发。

SVGPathSeg getItem(在无符号长索引中)

从列表中返回指定的项目。返回的项目是项目本身而不是副本。对项目所做的任何更改都会立即反映在列表中。

参数

  1. 无符号长索引

    要返回的列表中项目的索引。第一项是0号。

返回

所选项目。

异常

DOMException,代码INDEX_SIZE_ERR

如果索引号大于或等于numberOfItems,则引发。

SVGPathSeg insertItemBefore(在SVGPathSeg newItem中,在unsigned long 索引中)

在指定位置的列表中插入新项目。第一项是数字0.如果newItem已经在列表中,则在将其插入此列表之前,它将从之前的列表中删除。插入的项目是项目本身而不是副本。如果该项目已在此列表中,请注意之前要插入的项目的索引是在删除项目之前。

参数

  1. SVGPathSeg newItem

    要插入列表的项目。

  2. 无符号长索引

    要插入新项目的项目的索引。第一项是数字0.如果索引等于0,则新项目将插入列表的前面。如果索引大于或等于numberOfItems,则新项目将附加到列表的末尾。

返回

插入的项目。

异常

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

当列表无法修改时引发。

SVGPathSeg replaceItem(在SVGPathSeg newItem中,在unsigned long 索引中)

使用新项替换列表中的现有项。如果 newItem已经在列表中,则在将其插入此列表之前,它将从之前的列表中删除。插入的项目是项目本身而不是副本。如果该项目已在此列表中,请注意要替换的项目的索引是在 删除项目之前。

参数

  1. SVGPathSeg newItem

    要插入列表的项目。

  2. 无符号长索引

    要替换的项目的索引。第一项是0号。

返回

插入的项目。

异常

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

当列表无法修改时引发。

DOMException,代码INDEX_SIZE_ERR

如果索引号大于或等于numberOfItems,则引发。

SVGPathSeg removeItem(在unsigned long 索引中)

从列表中删除现有项目。

参数

  1. 无符号长索引

    要删除的项目的索引。第一项是0号。

返回

删除的项目。

异常

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

当列表无法修改时引发。

DOMException,代码INDEX_SIZE_ERR

如果索引号大于或等于numberOfItems,则引发。

SVGPathSeg appendItem(在SVGPathSeg newItem中)

在列表末尾插入一个新项目。如果newItem已经在列表中,则在将其插入此列表之前,它将从之前的列表中删除。插入的项目是项目本身而不是副本。

参数

  1. SVGPathSeg newItem

    要插入的项目。第一项是0号。

返回

插入的项目。

异常

DOMException,代码NO_MODIFICATION_ALLOWED_ERR

当列表无法修改时引发。

8.5.22接口SVGAnimatedPathData

SVGAnimatedPathData接口支持具有 保存SVG路径数据的“d”属性的元素,并支持为该属性设置动画的功能。

所述SVGAnimatedPathData接口提供两个列表来访问和修改基(即,静态的)中的内容“d”属性:

  • DOM属性pathSegList提供对“d”属性的静态/基本内容的访问,其形式与SVG的语法一对一匹配。
  • DOM属性normalizedPathSegList提供对'd'属性的静态/基本内容的规范化访问,其中所有路径数据命令以SVGPathSeg类型的以下子集表示 :SVG_PATHSEG_MOVETO_ABS(M),SVG_PATHSEG_LINETO_ABS(L),SVG_PATHSEG_CURVETO_CUBIC_ABS(C)和SVG_PATHSEG_CLOSEPATH(z)。

和两个列表来访问'd' 属性的当前动画值:

  • DOM属性animatedPathSegList提供对“d”属性的当前动画内容的访问,其形式与SVG的语法一对一匹配。
  • DOM属性animatedNormalizedPathSegList提供对'd' 属性的当前动画内容的规范化访问,其中所有路径数据命令以SVGPathSeg类型的以下子集表示:SVG_PATHSEG_MOVETO_ABS(M),SVG_PATHSEG_LINETO_ABS(L),SVG_PATHSEG_CURVETO_CUBIC_ABS(C)和SVG_PATHSEG_CLOSEPATH (Z)。

两个列表中的每一个始终保持同步。对一个列表的修改将立即导致修改相应的列表。对normalizedPathSegList的修改可能导致pathSegList中的条目 被分成一组规范化的路径段。

另外,通过XML DOM访问的'path'元素上的'd'属性(例如,使用 方法调用)将反映对pathSegList或 normalizedPathSegList所做的任何更改。getAttribute()

<span style="color:#000000">interface <strong>SVGAnimatedPathData</strong> {
  readonly属性<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegList" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegList" class="idlinterface">SVGPathSegList </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGAnimatedPathData__pathSegList" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGAnimatedPathData__pathSegList">pathSegList</a> ;
  readonly属性<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegList" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegList" class="idlinterface">SVGPathSegList </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGAnimatedPathData__normalizedPathSegList" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGAnimatedPathData__normalizedPathSegList">normalizedPathSegList</a> ;
  readonly属性<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegList" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegList" class="idlinterface">SVGPathSegList </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGAnimatedPathData__animatedPathSegList" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGAnimatedPathData__animatedPathSegList">animatedPathSegList</a> ;
  readonly属性<a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegList" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegList" class="idlinterface">SVGPathSegList </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGAnimatedPathData__animatedNormalizedPathSegList" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGAnimatedPathData__animatedNormalizedPathSegList">animatedNormalizedPathSegList</a> ;
};</span>

属性:

pathSegList (readonly SVGPathSegList)

提供对“d” 属性的基本(即静态)内容的访问,其形式与SVG的语法一对一匹配。因此,如果'd'属性具有“绝对移动(M)”和“绝对arcto(A)”命令,则pathSegList将具有两个条目:SVG_PATHSEG_MOVETO_ABS和SVG_PATHSEG_ARC_ABS。

normalizedPathSegList (readonly SVGPathSegList)

提供对“d”属性的基本(即静态)内容的访问, 其中所有路径数据命令均以SVGPathSeg 类型的以下子集表示:SVG_PATHSEG_MOVETO_ABS(M),SVG_PATHSEG_LINETO_ABS(L),SVG_PATHSEG_CURVETO_CUBIC_ABS(C )和SVG_PATHSEG_CLOSEPATH(z)。因此,如果'd'属性具有“绝对移动(M)”和“绝对arcto(A)”命令,则pathSegList将具有一个SVG_PATHSEG_MOVETO_ABS条目,后跟一系列接近弧的SVG_PATHSEG_LINETO_ABS条目。这种替代表示可用于为将受益于更有限的命令集的开发人员提供更简单的界面。

唯一有效的SVGPathSeg类型是SVG_PATHSEG_MOVETO_ABS(M),SVG_PATHSEG_LINETO_ABS(L),SVG_PATHSEG_CURVETO_CUBIC_ABS(C)和SVG_PATHSEG_CLOSEPATH(z)。

animatedPathSegList (readonly SVGPathSegList)

提供对“d” 属性的当前动画内容的访问,其形式与SVG的语法一对一匹配。如果给定的属性或属性是动画的,则包含属性或属性的当前动画值,并且对象本身及其内容都是只读的。如果当前未对给定属性或属性进行动画处理,则包含与pathSegList相同的值。

animatedNormalizedPathSegList (readonly SVGPathSegList)

提供对“d”属性的当前动画内容的访问, 其中所有路径数据命令均以SVGPathSeg 类型的以下子集表示:SVG_PATHSEG_MOVETO_ABS(M),SVG_PATHSEG_LINETO_ABS(L),SVG_PATHSEG_CURVETO_CUBIC_ABS(C)和SVG_PATHSEG_CLOSEPATH( Z)。如果给定的属性或属性是动画的,则包含属性或属性的当前动画值,并且对象本身及其内容都是只读的。如果当前未对给定属性或属性进行动画处理,则包含与normalizedPathSegList相同的值。

8.5.23接口SVGPathElement

所述SVGPathElement接口对应于“路径” 元件。

<span style="color:#000000">interface <strong>SVGPathElement</strong>:<a data-cke-saved-href="https://www.w3.org/TR/SVG11/types.html#InterfaceSVGElement" href="https://www.w3.org/TR/SVG11/types.html#InterfaceSVGElement" class="idlinterface">SVGElement</a>,
                            <a data-cke-saved-href="https://www.w3.org/TR/SVG11/types.html#InterfaceSVGTests" href="https://www.w3.org/TR/SVG11/types.html#InterfaceSVGTests" class="idlinterface">SVGTests</a>,
                            <a data-cke-saved-href="https://www.w3.org/TR/SVG11/types.html#InterfaceSVGLangSpace" href="https://www.w3.org/TR/SVG11/types.html#InterfaceSVGLangSpace" class="idlinterface">SVGLangSpace</a>,
                            <a data-cke-saved-href="https://www.w3.org/TR/SVG11/types.html#InterfaceSVGExternalResourcesRequired" href="https://www.w3.org/TR/SVG11/types.html#InterfaceSVGExternalResourcesRequired" class="idlinterface">SVGExternalResourcesRequired</a>,
                            <a data-cke-saved-href="https://www.w3.org/TR/SVG11/types.html#InterfaceSVGStylable" href="https://www.w3.org/TR/SVG11/types.html#InterfaceSVGStylable" class="idlinterface">SVGStylable</a>,
                            <a data-cke-saved-href="https://www.w3.org/TR/SVG11/types.html#InterfaceSVGTransformable" href="https://www.w3.org/TR/SVG11/types.html#InterfaceSVGTransformable" class="idlinterface">SVGTransformable</a>,
                            <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGAnimatedPathData" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGAnimatedPathData" class="idlinterface">SVGAnimatedPathData</a> {

  readonly属性<a data-cke-saved-href="https://www.w3.org/TR/SVG11/types.html#InterfaceSVGAnimatedNumber" href="https://www.w3.org/TR/SVG11/types.html#InterfaceSVGAnimatedNumber" class="idlinterface">SVGAnimatedNumber </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__pathLength" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__pathLength">pathLength</a> ;

  float <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__getTotalLength" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__getTotalLength">getTotalLength</a>();
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/coords.html#InterfaceSVGPoint" href="https://www.w3.org/TR/SVG11/coords.html#InterfaceSVGPoint" class="idlinterface">SVGPoint </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__getPointAtLength" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__getPointAtLength">getPointAtLength</a>(浮动距离);
  unsigned long <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__getPathSegAtLength" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__getPathSegAtLength">getPathSegAtLength</a>(浮点距离);
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegClosePath" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegClosePath" class="idlinterface">SVGPathSegClosePath </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegClosePath" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegClosePath">createSVGPathSegClosePath</a>();
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegMovetoAbs" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegMovetoAbs" class="idlinterface">SVGPathSegMovetoAbs </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegMovetoAbs" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegMovetoAbs">createSVGPathSegMovetoAbs</a>(在float x中,在float y中);
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegMovetoRel" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegMovetoRel" class="idlinterface">SVGPathSegMovetoRel </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegMovetoRel" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegMovetoRel">createSVGPathSegMovetoRel</a>(在float x中,在float y中);
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegLinetoAbs" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegLinetoAbs" class="idlinterface">SVGPathSegLinetoAbs </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegLinetoAbs" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegLinetoAbs">createSVGPathSegLinetoAbs</a>(在float x中,在float y中);
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegLinetoRel" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegLinetoRel" class="idlinterface">SVGPathSegLinetoRel </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegLinetoRel" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegLinetoRel">createSVGPathSegLinetoRel</a>(在float x中,在float y中);
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegCurvetoCubicAbs" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegCurvetoCubicAbs" class="idlinterface">SVGPathSegCurvetoCubicAbs </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegCurvetoCubicAbs" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegCurvetoCubicAbs">createSVGPathSegCurvetoCubicAbs</a>(在float x中,在float y中,在float x1中,在float y1中,在float x2中,在float y2中);
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegCurvetoCubicRel" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegCurvetoCubicRel" class="idlinterface">SVGPathSegCurvetoCubicRel</a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegCurvetoCubicRel" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegCurvetoCubicRel">createSVGPathSegCurvetoCubicRel</a>(在float x中,在float y中,在float x1中,在float y1中,在float x2中,在float y2中);
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegCurvetoQuadraticAbs" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegCurvetoQuadraticAbs" class="idlinterface">SVGPathSegCurvetoQuadraticAbs </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegCurvetoQuadraticAbs" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegCurvetoQuadraticAbs">createSVGPathSegCurvetoQuadraticAbs</a>(在float x中,在float y中,在float x1中,在float y1中);
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegCurvetoQuadraticRel" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegCurvetoQuadraticRel" class="idlinterface">SVGPathSegCurvetoQuadraticRel </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegCurvetoQuadraticRel" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegCurvetoQuadraticRel">createSVGPathSegCurvetoQuadraticRel</a>(在float x中,在float y中,在float x1中,在float y1中);
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegArcAbs" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegArcAbs" class="idlinterface">SVGPathSegArcAbs </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegArcAbs" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegArcAbs">createSVGPathSegArcAbs</a>(在float x中,在float y中,在float r1中,在float r2中,在float角中,在boolean largeArcFlag中,在boolean sweepFlag中);
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegArcRel" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegArcRel" class="idlinterface">SVGPathSegArcRel </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegArcRel" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegArcRel">createSVGPathSegArcRel</a>(在float x中,在float y中,在float r1中,在float r2中,在float角中,在boolean largeArcFlag中,在boolean sweepFlag中);
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegLinetoHorizontalAbs" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegLinetoHorizontalAbs" class="idlinterface">SVGPathSegLinetoHorizo​​ntalAbs </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegLinetoHorizontalAbs" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegLinetoHorizontalAbs">createSVGPathSegLinetoHorizo​​ntalAbs</a>(在float x中);
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegLinetoHorizontalRel" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegLinetoHorizontalRel" class="idlinterface">SVGPathSegLinetoHorizo​​ntalRel </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegLinetoHorizontalRel" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegLinetoHorizontalRel">createSVGPathSegLinetoHorizo​​ntalRel</a>(在float x中);
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegLinetoVerticalAbs" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegLinetoVerticalAbs" class="idlinterface">SVGPathSegLinetoVerticalAbs </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegLinetoVerticalAbs" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegLinetoVerticalAbs">createSVGPathSegLinetoVerticalAbs</a>(在float y中);
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegLinetoVerticalRel" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegLinetoVerticalRel" class="idlinterface">SVGPathSegLinetoVerticalRel </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegLinetoVerticalRel" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegLinetoVerticalRel">createSVGPathSegLinetoVerticalRel</a>(在float y中);
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegCurvetoCubicSmoothAbs" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegCurvetoCubicSmoothAbs" class="idlinterface">SVGPathSegCurvetoCubicSmoothAbs </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegCurvetoCubicSmoothAbs" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegCurvetoCubicSmoothAbs">createSVGPathSegCurvetoCubicSmoothAbs</a>(在float x中,在float y中,在float x2中,在float y2中);
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegCurvetoCubicSmoothRel" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegCurvetoCubicSmoothRel" class="idlinterface">SVGPathSegCurvetoCubicSmoothRel </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegCurvetoCubicSmoothRel" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegCurvetoCubicSmoothRel">createSVGPathSegCurvetoCubicSmoothRel</a>(在float x中,在float y中,在float x2中,在float y2中);
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegCurvetoQuadraticSmoothAbs" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegCurvetoQuadraticSmoothAbs" class="idlinterface">SVGPathSegCurvetoQuadraticSmoothAbs</a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegCurvetoQuadraticSmoothAbs" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegCurvetoQuadraticSmoothAbs">createSVGPathSegCurvetoQuadraticSmoothAbs</a>(在float x中,在float y中);
  <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegCurvetoQuadraticSmoothRel" href="https://www.w3.org/TR/SVG11/paths.html#InterfaceSVGPathSegCurvetoQuadraticSmoothRel" class="idlinterface">SVGPathSegCurvetoQuadraticSmoothRel </a> <a data-cke-saved-href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegCurvetoQuadraticSmoothRel" href="https://www.w3.org/TR/SVG11/paths.html#__svg__SVGPathElement__createSVGPathSegCurvetoQuadraticSmoothRel">createSVGPathSegCurvetoQuadraticSmoothRel</a>(在float x中,在float y中);
};</span>

属性:

pathLength (只读SVGAnimatedNumber)

对应于给定'path' 元素的属性pathLength。

操作:

float getTotalLength()

使用用户代理的沿路径距离算法返回用户代理的路径总长度的计算值,作为当前用户坐标系中的距离。

返回

路径的总长度。

SVGPoint getPointAtLength(浮动距离)

使用用户代理的沿路径距离算法 返回用户空间中的(x,y)坐标,该坐标是沿路径的距离单位。

参数

  1. 浮动距离

    沿路径的距离,相对于路径的起点,作为当前用户坐标系中的距离。

返回

用户空间中返回的点。

unsigned long getPathSegAtLength(浮点距离)

使用用户代理的沿路径距离算法 将索引返回到pathSegList,该路径是沿路径的距离单位。

参数

  1. 浮动距离

    沿路径的距离,相对于路径的起点,作为当前用户坐标系中的距离。

返回

路径段的索引,其中第一个路径段为数字0。

SVGPathSegClosePath createSVGPathSegClosePath()

返回独立的无父SVGPathSegClosePath对象。

返回

独立的无父SVGPathSegClosePath对象。

SVGPathSegMovetoAbs createSVGPathSegMovetoAbs(在float x中,在float y中)

返回独立的无父SVGPathSegMovetoAbs对象。

参数

  1. 浮动x

    此路径段结束点的绝对X坐标。

  2. 浮ÿ

    此路径段结束点的绝对Y坐标。

返回

独立的无父SVGPathSegMovetoAbs对象。

SVGPathSegMovetoRel createSVGPathSegMovetoRel(在float x中,在float y中)

返回独立的无父SVGPathSegMovetoRel对象。

参数

  1. 浮动x

    此路径段的结束点的相对X坐标。

  2. 浮ÿ

    此路径段结束点的相对Y坐标。

返回

独立的无父SVGPathSegMovetoRel对象。

SVGPathSegLinetoAbs createSVGPathSegLinetoAbs(在float x中,在float y中)

返回独立的无父SVGPathSegLinetoAbs对象。

参数

  1. 浮动x

    此路径段结束点的绝对X坐标。

  2. 浮ÿ

    此路径段结束点的绝对Y坐标。

返回

独立的无父SVGPathSegLinetoAbs对象。

SVGPathSegLinetoRel createSVGPathSegLinetoRel(在float x中,在float y中)

返回独立的无父SVGPathSegLinetoRel对象。

参数

  1. 浮动x

    此路径段的结束点的相对X坐标。

  2. 浮ÿ

    此路径段结束点的相对Y坐标。

返回

独立的无父SVGPathSegLinetoRel对象。

SVGPathSegCurvetoCubicAbs createSVGPathSegCurvetoCubicAbs(在float x中,在float y中,在float x1中,在float y1中,在float x2中,在float y2中))

返回独立的无父SVGPathSegCurvetoCubicAbs对象。

参数

  1. 浮动x

    此路径段结束点的绝对X坐标。

  2. 浮ÿ

    此路径段结束点的绝对Y坐标。

  3. 浮点x1

    第一个控制点的绝对X坐标。

  4. 漂浮y1

    第一个控制点的绝对Y坐标。

  5. 浮动x2

    第二个控制点的绝对X坐标。

  6. 漂浮y2

    第二个控制点的绝对Y坐标。

返回

独立的无父SVGPathSegCurvetoCubicAbs对象。

SVGPathSegCurvetoCubicRel createSVGPathSegCurvetoCubicRel(在float x中,在float y中,在float x1中,在float y1中,在float x2中,在float y2中)

返回独立的无父SVGPathSegCurvetoCubicRel对象。

参数

  1. 浮动x

    此路径段的结束点的相对X坐标。

  2. 浮ÿ

    此路径段结束点的相对Y坐标。

  3. 浮点x1

    第一个控制点的相对X坐标。

  4. 漂浮y1

    第一个控制点的相对Y坐标。

  5. 浮动x2

    第二个控制点的相对X坐标。

  6. 漂浮y2

    第二个控制点的相对Y坐标。

返回

独立的无父SVGPathSegCurvetoCubicRel对象。

SVGPathSegCurvetoQuadraticAbs createSVGPathSegCurvetoQuadraticAbs(在float x中,在float y中,在float x1中,在float y1中)

返回独立的无父SVGPathSegCurvetoQuadraticAbs对象。

参数

  1. 浮动x

    此路径段结束点的绝对X坐标。

  2. 浮ÿ

    此路径段结束点的绝对Y坐标。

  3. 浮点x1

    第一个控制点的绝对X坐标。

  4. 漂浮y1

    第一个控制点的绝对Y坐标。

返回

一个独立的,无父的SVGPathSegCurvetoQuadraticAbs对象。

SVGPathSegCurvetoQuadraticRel createSVGPathSegCurvetoQuadraticRel(在float x中,在float y中,在float x1中,在float y1中)

返回独立的无父SVGPathSegCurvetoQuadraticRel对象。

参数

  1. 浮动x

    此路径段的结束点的相对X坐标。

  2. 浮ÿ

    此路径段结束点的相对Y坐标。

  3. 浮点x1

    第一个控制点的相对X坐标。

  4. 漂浮y1

    第一个控制点的相对Y坐标。

返回

独立的无父SVGPathSegCurvetoQuadraticRel对象。

SVGPathSegArcAbs createSVGPathSegArcAbs(在float x中,在float y中,在float r1中,在float r2中,在float 角中,在boolean largeArcFlag中,在boolean sweepFlag中)

返回独立的无父SVGPathSegArcAbs对象。

参数

  1. 浮动x

    此路径段结束点的绝对X坐标。

  2. 浮ÿ

    此路径段结束点的绝对Y坐标。

  3. 漂浮r1

    椭圆的x轴半径(即r1)。

  4. 漂浮r2

    椭圆的y轴半径(即r2)。

  5. 浮角

    椭圆的x轴相对于用户坐标系的x轴的旋转角度(以度为单位)。

  6. boolean largeArcFlag

    large-arc-flag参数的值。

  7. boolean sweepFlag

    large-arc-flag参数的值。

返回

独立的无父SVGPathSegArcAbs对象。

SVGPathSegArcRel createSVGPathSegArcRel(在float x中,在float y中,在float r1中,在float r2中,在float 角中,在boolean largeArcFlag中,在boolean sweepFlag中))

返回独立的无父SVGPathSegArcRel对象。

参数

  1. 浮动x

    此路径段的结束点的相对X坐标。

  2. 浮ÿ

    此路径段结束点的相对Y坐标。

  3. 漂浮r1

    椭圆的x轴半径(即r1)。

  4. 漂浮r2

    椭圆的y轴半径(即r2)。

  5. 浮角

    椭圆的x轴相对于用户坐标系的x轴的旋转角度(以度为单位)。

  6. boolean largeArcFlag

    large-arc-flag参数的值。

  7. boolean sweepFlag

    large-arc-flag参数的值。

返回

独立的无父SVGPathSegArcRel对象。

SVGPathSegLinetoHorizo​​ntalAbs createSVGPathSegLinetoHorizo​​ntalAbs(在float x中)

返回独立的无父SVGPathSegLinetoHorizo​​ntalAbs对象。

参数

  1. 浮动x

    此路径段结束点的绝对X坐标。

返回

独立的无父SVGPathSegLinetoHorizo​​ntalAbs对象。

SVGPathSegLinetoHorizo​​ntalRel createSVGPathSegLinetoHorizo​​ntalRel(在float x中)

返回独立的无父SVGPathSegLinetoHorizo​​ntalRel对象。

参数

  1. 浮动x

    此路径段的结束点的相对X坐标。

返回

独立的无父SVGPathSegLinetoHorizo​​ntalRel对象。

SVGPathSegLinetoVerticalAbs createSVGPathSegLinetoVerticalAbs(在float y中)

返回独立的无父SVGPathSegLinetoVerticalAbs对象。

参数

  1. 浮ÿ

    此路径段结束点的绝对Y坐标。

返回

独立的无父SVGPathSegLinetoVerticalAbs对象。

SVGPathSegLinetoVerticalRel createSVGPathSegLinetoVerticalRel(在float y中)

返回独立的无父SVGPathSegLinetoVerticalRel对象。

参数

  1. 浮ÿ

    此路径段结束点的相对Y坐标。

返回

独立的无父SVGPathSegLinetoVerticalRel对象。

SVGPathSegCurvetoCubicSmoothAbs createSVGPathSegCurvetoCubicSmoothAbs(在float x中,在float y中,在float x2中,在float y2中)

返回独立的无父SVGPathSegCurvetoCubicSmoothAbs对象。

参数

  1. 浮动x

    此路径段结束点的绝对X坐标。

  2. 浮ÿ

    此路径段结束点的绝对Y坐标。

  3. 浮动x2

    第二个控制点的绝对X坐标。

  4. 漂浮y2

    第二个控制点的绝对Y坐标。

返回

独立的无父SVGPathSegCurvetoCubicSmoothAbs对象。

SVGPathSegCurvetoCubicSmoothRel createSVGPathSegCurvetoCubicSmoothRel(在float x中,在float y中,在float x2中,在float y2中)

返回独立的无父SVGPathSegCurvetoCubicSmoothRel对象。

参数

  1. 浮动x

    此路径段的结束点的相对X坐标。

  2. 浮ÿ

    此路径段结束点的相对Y坐标。

  3. 浮动x2

    第二个控制点的相对X坐标。

  4. 漂浮y2

    第二个控制点的相对Y坐标。

返回

独立的无父SVGPathSegCurvetoCubicSmoothRel对象。

SVGPathSegCurvetoQuadraticSmoothAbs createSVGPathSegCurvetoQuadraticSmoothAbs(在float x中,在float y中)

返回独立的无父SVGPathSegCurvetoQuadraticSmoothAbs对象。

参数

  1. 浮动x

    此路径段结束点的绝对X坐标。

  2. 浮ÿ

    此路径段结束点的绝对Y坐标。

返回

一个独立的,无父的SVGPathSegCurvetoQuadraticSmoothAbs对象。

SVGPathSegCurvetoQuadraticSmoothRel createSVGPathSegCurvetoQuadraticSmoothRel(在float x中,在float y中)

返回独立的无父SVGPathSegCurvetoQuadraticSmoothRel对象。

参数

  1. 浮动x

    此路径段的结束点的相对X坐标。

  2. 浮ÿ

    此路径段结束点的相对Y坐标。

返回

一个独立的,无父的SVGPathSegCurvetoQuadraticSmoothRel对象。

 

最后,给大家推荐几款可以生成矢量路径的工具:

1. Illustrator CS6

以利用Ai软件生成铁轨的矢量路径为例。

第一步,绘制铁轨的矢量图。

第二步,点击:文件->存储为->保存类型选择SVG->点击保存->SVG代码

点击SVG代码,即可查看矢量路径了。

第三步,查看SVG代码。

d标签中的内容即为矢量路径了。

2.矢量路径在线生成工具:https://editor.method.ac/

此网站可以在线绘图并转为路径,不过操作起来并没有Illustrator CS6那么方便,推荐大家下载一个试用版的Illustrator CS6。

西门子V90 PN伺服控制核心:FB284功能块详解与实战 在工业自动化中,伺服定位控制是运动控制的基础环节,其本质是PLC通过PROFINET协议与伺服驱动器实现高速、确定性数据交互。FB284作为西门子为V90 PN定制的标准化功能块,封装了GSD映射、状态机管理与周期性PDO同步机制,将底层寄存器操作抽象为高可靠调用接口。相比MOVE指令或MC_MoveAbsolute等通用方案,FB284显著降低时序错乱风险,提升多轴同步精度与故障响应能力。它广泛应用于包装、灌装、装配等中端产线,尤其适配S7-1200/1500平台下的快速部署与现场维护。本文聚焦V90 P 阅读详情

相关推荐

DeepStream实战:多路视频AI分析从CPU瓶颈到GPU高吞吐

视频流智能分析在智慧交通和边缘计算中愈发关键,但传统CPU拉流解码加GPU推理的链路,常面临CPU占用过高、GPU利用率低下的窘境。DeepStream作为NVIDIA推出的流式推理框架,基于GStreamer插件生态,以NVMM内存管理让视频数据在GPU侧高效流转,配合NVDEC硬件解码、NvStreamMux多路批处理与TensorRT优化,大幅降低CPU负担并提升多路视频并行吞吐。针对1080p甚至更高分辨率的RTSP流,它能将多路帧汇聚为batch批量推理,从而支撑实时车辆识别、道路分析等生产级应用

weixin_29051245的博客 181

SVG矢量图中矢量路径的获取

矢量图中矢量路径的获取 首先下载一张svg图片,例如,在阿里矢量图标库中下载 用代码编辑器打开下载的图片 将标签中的d属性复制出来,写成下面的格式 这样就可以拿到矢量图中的路径了! SVG矢量图是无损的,是矢量图,图片是由直线以和曲线以及绘制他们的方法组成,当你放大一个SVG图片的时候你看到的还是线和曲线,而不会出现线素点。这意味着,SVG在放大时,不会是真,所以特别适合用来做企业logo等。 ...

qq_45021462的博客 6956

当 AI + 可视化融入消防:开启智能消防新时代

总结来说,AI + 可视化技术融入消防,开启了智能消防新时代。它以精准预警、高效救援和全面资源管理,革新消防工作方式。从前期规划到系统搭建,再到后期运维,每个环节都为提升消防能力奠定基础。尽管面临技术成本、数据安全和人员适应等挑战,但随着技术发展和应用推广,这些问题将逐步解决。相信在 AI + 可视化助力下,消防领域将不断进步,为人们创造更安全生活环境,有效抵御火灾威胁。

2401_87844374的博客 1221

echarts中自定义图片的矢量路径

echarts中自定义图片的矢量路径

hdy119yaner的博客 2775

Dify社区版多工作空间功能解锁:源码修改与多租户架构解析

多租户架构是现代SaaS平台实现数据隔离与资源管理的核心技术,其核心原理是通过租户模型将用户、应用和数据在逻辑上隔离。在AI应用开发平台中,这种架构能有效支持多团队、多项目并行开发,确保不同业务线的数据安全与独立迭代。Dify作为开源AI应用构建平台,其底层已设计完善的多租户模型,但社区版默认限制了单用户单工作空间。本文通过精准修改两处关键代码——账户初始化逻辑与系统功能开关,释放了平台固有的多工作空间管理能力。该方案无需改动数据库结构,直接利用现有RBAC权限体系,实现了类似企业版的**多租户隔离**体验

weixin_27059669的博客 1071

SAP SD POD 配置与 VLPOD 操作:3步解决发货10件开票7件的业务场景

本文详细解析了SAP SD POD功能在解决发货与开票数量差异中的应用,通过3步配置法实现精准匹配。重点介绍了POD核心逻辑、关键配置步骤及VLPOD操作技巧,帮助企业高效处理易损品运输等复杂场景,提升供应链管理效率。

weixin_30613343的博客 396

PS-第四天-矢量形状与路径

矢量形状与路径 矢量图与位图 矢量图:由点,线,形,以数学矢量方式来记录的图形 特点:放大不失真 位图:是由像素来构成的图像 特点:放大失真 选区绘制的形状与形状工具绘制的形状的区别 选区绘制的属于位图 需要新建图层,放大会失真 形状工具绘制的属于矢量图 不需要新建图层,放大不会失真 形状工具组U 矩形工具:可以绘制矢量的矩形,可以双击图形缩略图进行改色 在属性栏中可以改尺寸,也可以在空...

水滴的专栏 1092

Vue3+Openlayers教程导航页【目录】

欢迎来到 Vue3+Openlayers 系列教程,这里是我在 优快云 编写的所有 Vue3+Openlayers 系列相关文章的索引页,适合初学者到进阶用户系统阅读。👀 更多教程正在持续更新中,欢迎关注我,一起探索 Openlayers 的强大魅力!

小彭的博客 1280

OpenGL绘制矢量路径的思路

1. 引言 软件方法绘制,如QT、Android(skia)都自带2D绘图引擎,支持矢量路径填充并且抗锯齿!如果使用OpenGL绘制矢量,对建模算法以及纹理都有要求,不同的建模算法决定了最终的视觉效果。OpenGL绘制路径,抗锯齿效果由纹理来实现。下面介绍两种不同效果的路径实现和绘制: 2. 纯色圆角路径 通过纹理方式实现抗锯齿单色路径绘制。 建模算法非常简单:将一个polyline分解成

dizuo的专栏 8373

AI应用架构师实战:超算中AI与量子计算融合的初探与架构

当大模型的算力需求突破E级超算的极限,当量子计算的“量子优势”从实验室走向真实场景,超算+AI+量子计算的融合架构成为解决复杂问题的关键路径。本文从架构师的实战视角出发,系统拆解三者融合的底层逻辑:从“计算本质”的第一性原理推导,到“量子-经典异构”的架构设计;从“量子机器学习”的代码实现,到“金融/医药”的场景落地。我们将回答:如何用超算支撑量子计算的噪声抑制与纠错?如何用量子计算加速AI模型的训练与推理?如何设计可扩展、高可用的融合系统?最终给出架构师的实战指南——从技术选型到运营管理的全流程方法论。

AIGC应用创新大全的博客 925

深度学习在地质勘探中的应用:使用Python构建卷积神经网络进行地震数据分析

在本文中,我们介绍了如何利用深度学习技术,特别是卷积神经网络(CNN),来处理和分析地震数据。我们使用了Python编程语言和TensorFlow框架构建了一个CNN模型,并使用地震数据进行了训练和评估。在本文中,我们将探讨如何利用深度学习技术,特别是卷积神经网络(CNN),来处理和分析地震数据。首先,我们需要获取地震数据集。通过本文的介绍,希望您能对深度学习在地质勘探领域的应用有更深入的了解,并能够应用这些技术来解决实际问题。在准备好地震数据和构建CNN模型后,我们需要将数据分为训练集和测试集。

斌擎科技 1474

HCIP第十天

hcip

m0_60040684的博客 916

​ISP算法及架构分析介绍

ISP算法及架构分析介绍ISP即Image Signal Processor,是一种图像处理架构,不是我们用的下载器。ISP其实算是图像处理的一个特例,一般应用于前端设备(相对于SENSOR),从结果上看就是将RAW数据转换成压缩后的RGB(一般)数据,供后续CPU使用(识别、压缩等)。市面上很少有直接介绍ISP的书籍或者资料,今天我们主要是聊一聊ISP算法的架构,这样大...

OpenFPGA的博客 5407

链路状态、距离矢量、路径矢量对比

每个路由器通过洪泛(Flooding)向全网广播链路状态信息(LSA),构建全局拓扑数据库(LSDB),并独立使用最短路径算法(如Dijkstra)计算最优路径。记录路由的完整路径(如BGP的AS路径列表),基于策略(如最短AS路径、本地优先级)选择最优路径,避免环路。(Border Gateway Protocol):互联网核心路由协议,管理跨自治系统(AS)的路由。(混合型):结合链路状态特性(如触发更新),支持快速收敛,但为Cisco专有。互联网服务提供商(ISP)间的路由(BGP)。

tiantianwxq的博客 1429

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

echarts中自定义图片的矢量路径设置

echarts中自定义图片的矢量路径设置欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表FLowchart流程图导出与导入导...

huhaixx的博客 2万+

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

PS——矢量形状与路径

一、形状工具1、形状图层:用形状工具的时候自动新建的图层2、矢量图:由点、线、形构成,以数学矢量的方式记录的图像(1)特点:放大不失真3、位图:由像素构成的图像(所以只要有弧度就一定会形成锯齿状)(1)特点:放大失真4、形状工具的使用(1)想要绘制正方形/圆形同样是按住shift键进行拖拽操作(2)同样是用移动工具来移动(3)改变大小同样是用ctrl+t自由变换(4)改变颜色:双击图层缩略图 --...

UNDEFINED_AUBE的博客 5636

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

【路径规划】基于球形矢量的灰狼算法求解UAV路径规划问题

在无人机(UAV)的任务执行过程中,路径规划是至关重要的一环。路径规划需要在满足飞行约束条件的情况下,确保无人机从起点到终点的最短路径或最优路径。本文提出了一种基于球形矢量的灰狼算法(Spherical Vector Grey Wolf Optimization, SVGWO)来求解UAV路径规划问题。通过结合球形矢量约束和灰狼算法的全局优化能力,该方法能够快速收敛到最优路径,同时在复杂环境中避开障碍物。

2401_84610415的博客 1125

【路径规划】短时内穿过矢量风场的路径规划研究附Matlab代码

路径规划是机器人学、交通运输以及航空航天等领域的核心问题。在实际环境中,载具往往需要穿越复杂的矢量风场,例如无人机在高空飞行或船舶在复杂海流中航行。本文旨在探讨短时内穿越矢量风场的路径规划问题,分析矢量风场对路径的影响,并综述现有解决策略,包括考虑矢量场的静态路径规划方法和基于实时调整的动态路径规划方法。最后,我们对未来的研究方向进行展望,指出融合机器学习和深度学习等先进技术,以应对更加复杂和动态的风场环境,将是未来的发展趋势。路径规划,矢量风场,短时,静态规划,动态规划,无人机,船舶1. 引言。

qq_59747472的博客 712

使用Python实现矢量路径的压缩、解压与可视化

路径命令解析输入:包含moveTolineToqCurveTo(二次贝塞尔曲线)、closePath命令的路径数据。输出:转换为对象,用于绘制矢量图形。路径命令映射M→moveTo:移动到起点L→lineTo:绘制直线Q→qCurveTo:二次贝塞尔曲线Z→closePath:闭合路径JSON压缩策略将坐标元组展平为一维列表,减少冗余。闭合路径(Z)的参数为空列表。matplotlib路径渲染使用Path对象和PathPatch实现复杂曲线的绘制。CURVE3。

东方佑 1019

【无人机跟踪】基于矢量场的路径跟随算法的反正弦矢量场制导下无人机路径跟踪附matlab代码

​close all;clear all;clc;​。

matlab_daizuo的博客 228
上一篇: Echarts绘图技术总结
下一篇: Python环境配置
ilike_program
博客等级 码龄10年 20粉丝 15原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值