使用SVG,我试图复制小提琴的琴弦——它们是如何向螺母端逐渐变细的。我希望我可以使用变换来实现这一点(因为我有其他复杂的形状,并且希望保持统一的逻辑坐标)。但我不确定转换应该是什么。
基本上,我希望最左边的Y坐标按比例缩放。66,在最右侧,无缩放(1.0)。
(在下面的示例中,Y中心线为32.5)。
<p>This is how I want it to look:</p>
<svg width="500" height="60">
<g stroke-width="1" stroke="black">
<line x1="10" y1="17.5" x2="490" y2="10"/>
<line x1="10" y1="27.5" x2="490" y2="25" />
<line x1="10" y1="37.5" x2="490" y2="40"/>
<line x1="10" y1="47.5" x2="490" y2="55"/>
</g>
</svg>
<p>But I want to accomplish it by using a transform on the group element below.</p>
<svg width="500" height="60">
<g transform="??????" stroke-width="1" stroke="black">
<line x1="10" y1="10" x2="490" y2="10"/>
<line x1="10" y1="25" x2="490" y2="25" />
<line x1="10" y1="40" x2="490" y2="40"/>
<line x1="10" y1="55" x2="490" y2="55"/>
</g>
</svg>