Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SVG弧不';不要走到圆圈的边缘_Svg - Fatal编程技术网

SVG弧不';不要走到圆圈的边缘

SVG弧不';不要走到圆圈的边缘,svg,Svg,我正在手工制作一个SVG,以显示一个包含n个段的圆,其中m个段被填充 在我的第一个简单测试用例中,我设置了n=4和m=1。我画了一个圆,然后画了4条路径来显示圆的4个象限之间的划分,我有一条路径,使用圆弧命令用颜色填充其中一个象限。但是,圆弧的填充部分不会完全到达圆的边缘 以下是我的SVG: <svg width="150" height="150" version="1.1" xmlns="http://www.w3.org/2000/svg"> <path d="M

我正在手工制作一个SVG,以显示一个包含n个段的圆,其中m个段被填充

在我的第一个简单测试用例中,我设置了n=4和m=1。我画了一个圆,然后画了4条路径来显示圆的4个象限之间的划分,我有一条路径,使用圆弧命令用颜色填充其中一个象限。但是,圆弧的填充部分不会完全到达圆的边缘

以下是我的SVG:

<svg width="150" height="150" version="1.1" xmlns="http://www.w3.org/2000/svg">
    <path d="M 75 10 A 75 75 0 0 1 140 75 L 75 75 Z" fill="green" stroke="none"/>
    <circle cx="75" cy="75" r="65" stroke="black" fill="transparent" stroke-width="1"/>
    <path d="M75,10 L75,75" fill="none" stroke="black" stroke-width="1"/>
    <path d="M140,75 L75,75" fill="none" stroke="black" stroke-width="1"/>
    <path d="M75,140 L75,75" fill="none" stroke="black" stroke-width="1"/>
    <path d="M10,75 L75,75" fill="none" stroke="black" stroke-width="1"/>
</svg>

当渲染n=3的SVG时,我会遇到同样的问题。事实上,差距更为明显:

<svg width="150" height="150" version="1.1" xmlns="http://www.w3.org/2000/svg">
    <path d="M 75 10 A 75 75 0 0 1 131.29165 107.5 L 75 75 Z" fill="green" stroke="none"/>
    <circle cx="75" cy="75" r="65" stroke="black" fill="transparent" stroke-width="1"/>
    <path d="M 75 10 L 75 75" fill="none" stroke="black" stroke-width="1"/>
    <path d="M 131.29165 107.5 L75,75" fill="none" stroke="black" stroke-width="1"/>
    <path d="M 18.70834 107.5 L75,75" fill="none" stroke="black" stroke-width="1"/>
</svg>


我记得读到过,圆弧确实有一些限制,特别是当它涉及到一个代表一个完整圆的圆弧时,因为确切的路径是未定义的。然而,我没有意识到这意味着越来越长的弧相对于它们所刻的圆越来越窄。我的SVG有问题吗?为什么我的圆弧不能完美地填充圆的“楔形”?

我认为您将半径错误地设置为75,而不是65:

<svg width="150" height="150" version="1.1" xmlns="http://www.w3.org/2000/svg">
    <path d="M 75 10 A 65 65 0 0 1 140 75 L 75 75 Z" fill="green" stroke="none"/>
    <circle cx="75" cy="75" r="65" stroke="black" fill="transparent" stroke-width="1"/>
    <path d="M75,10 L75,75" fill="none" stroke="black" stroke-width="1"/>
    <path d="M140,75 L75,75" fill="none" stroke="black" stroke-width="1"/>
    <path d="M75,140 L75,75" fill="none" stroke="black" stroke-width="1"/>
    <path d="M10,75 L75,75" fill="none" stroke="black" stroke-width="1"/>
</svg>


我认为您将半径错误地设置为75,而不是65:

<svg width="150" height="150" version="1.1" xmlns="http://www.w3.org/2000/svg">
    <path d="M 75 10 A 65 65 0 0 1 140 75 L 75 75 Z" fill="green" stroke="none"/>
    <circle cx="75" cy="75" r="65" stroke="black" fill="transparent" stroke-width="1"/>
    <path d="M75,10 L75,75" fill="none" stroke="black" stroke-width="1"/>
    <path d="M140,75 L75,75" fill="none" stroke="black" stroke-width="1"/>
    <path d="M75,140 L75,75" fill="none" stroke="black" stroke-width="1"/>
    <path d="M10,75 L75,75" fill="none" stroke="black" stroke-width="1"/>
</svg>


哎呀。。。这感觉像是一个非常严重的错误。谢谢嘿,我们都在做:-)有时候我们就是看不见眼前的东西!祝你的项目好运。哎哟。。。这感觉像是一个非常严重的错误。谢谢嘿,我们都在做:-)有时候我们就是看不见眼前的东西!祝你的项目好运。