将 SVG 圆组合并为单一路径

Unite SVG Group of Circles to Single Path

我可能把问题的标题弄错了,因为我真的不知道如何问我想要做什么。让我解释一下。

我有一个包含约 700 个组的大型 SVG 文件 (<g></g>)。每个组都有不同数量的 <circle> 路径,位置不同,组内的所有圆圈具有相同的半径和颜色。目前,每个圆圈都是它自己的路径,这使得文件太大而无法执行任何操作,因为有数十万个这样的圆圈。我需要将每个组中的所有圆圈组合成一条路径。我已经想出如何在 Adob​​e Illustrator 中执行此操作,我的方法是 select 来自图层面板的组内的所有圆圈,然后使用 Windows>Pathfinder>Unite 将圆圈合并到一个形状。但是,我将不得不遍历每个组 one-by-one,这太多了。有什么可以为我做这样的事情吗?我不想花几天时间检查每个小组 团结他们...

我的 SVG 示例:

<g fill="#71b190" stroke="#71b190" stroke-width=".1">
    <circle cx="-505753.529" cy="-173234.268" r="1.1"/>
    <circle cx="-505749.628" cy="-173234.226" r="1.1"/>
    <circle cx="-505747.843" cy="-173234.215" r="1.1"/>
    <circle cx="-505742.67" cy="-173234.194" r="1.1"/>
    <circle cx="-505706.735" cy="-173234.09" r="1.1"/>
    <circle cx="-505703.787" cy="-173309.959" r="1.1"/>
    <circle cx="-505703.526" cy="-173237.828" r="1.1"/>
    <circle cx="-505702.73" cy="-173238.572" r="1.1"/>
    <circle cx="-505702.316" cy="-173238.744" r="1.1"/>
    <circle cx="-505701.269" cy="-173239.237" r="1.1"/>
    <circle cx="-505701.002" cy="-173262.186" r="1.1"/>
    <circle cx="-505701.002" cy="-173262.212" r="1.1"/>
    <circle cx="-505700.939" cy="-173254.578" r="1.1"/>
    <circle cx="-505700.934" cy="-173254.835" r="1.1"/>
    <circle cx="-505700.923" cy="-173250.798" r="1.1"/>
    <circle cx="-505700.923" cy="-173251.264" r="1.1"/>
    <circle cx="-505700.918" cy="-173258.374" r="1.1"/>
    <circle cx="-505700.913" cy="-173241.781" r="1.1"/>
    <circle cx="-505700.913" cy="-173242.739" r="1.1"/>
    <circle cx="-505700.913" cy="-173258.426" r="1.1"/>
    <circle cx="-505700.902" cy="-173245.551" r="1.1"/>
    <circle cx="-505700.897" cy="-173246.3" r="1.1"/>
    <circle cx="-505698.138" cy="-173234.048" r="1.1"/>
    <circle cx="-505692.127" cy="-173233.948" r="1.1"/>
    <circle cx="-505691.802" cy="-173233.932" r="1.1"/>
    <circle cx="-505691.258" cy="-173233.906" r="1.1"/>
    <circle cx="-505689.216" cy="-173292.806" r="1.1"/>
    <circle cx="-505688.697" cy="-173238.723" r="1.1"/>
    <circle cx="-505688.357" cy="-173233.775" r="1.1"/>
    <circle cx="-505688.273" cy="-173236.268" r="1.1"/>
    <circle cx="-505688.205" cy="-173244.734" r="1.1"/>
    <circle cx="-505688.174" cy="-173246.776" r="1.1"/>
    <circle cx="-505688.142" cy="-173248.818" r="1.1"/>
    <circle cx="-505688.127" cy="-173249.918" r="1.1"/>
    <circle cx="-505688.111" cy="-173251.018" r="1.1"/>
    <circle cx="-505688.095" cy="-173251.96" r="1.1"/>
    <circle cx="-505688.079" cy="-173253.06" r="1.1"/>
    <circle cx="-505688.064" cy="-173254.159" r="1.1"/>
    <circle cx="-505688.048" cy="-173255.102" r="1.1"/>
    <circle cx="-505688.032" cy="-173256.201" r="1.1"/>
    <circle cx="-505688.001" cy="-173258.243" r="1.1"/>
    <circle cx="-505686.818" cy="-173243.561" r="1.1"/>
    <circle cx="-505683.058" cy="-173243.368" r="1.1"/>
    <circle cx="-505681.178" cy="-173243.268" r="1.1"/>
    <circle cx="-505679.299" cy="-173243.148" r="1.1"/>
    <circle cx="-505678.346" cy="-173301.278" r="1.1"/>
    <circle cx="-505665.905" cy="-173295.22" r="1.1"/>
    <circle cx="-505665.905" cy="-173296.743" r="1.1"/>
    <circle cx="-505665.905" cy="-173296.969" r="1.1"/>
    <circle cx="-505665.905" cy="-173299.524" r="1.1"/>
    <circle cx="-505665.905" cy="-173299.707" r="1.1"/>
    <circle cx="-505665.518" cy="-173309.64" r="1.1"/>
    <circle cx="-505665.203" cy="-173285.193" r="1.1"/>
    <circle cx="-505665.125" cy="-173419.538" r="1.1"/>
    <circle cx="-505664.298" cy="-173317.331" r="1.1"/>
    <circle cx="-505664.177" cy="-173285.25" r="1.1"/>
    <circle cx="-505663.722" cy="-173488.878" r="1.1"/>
    <circle cx="-505663.449" cy="-173488.401" r="1.1"/>
    <circle cx="-505663.041" cy="-173419.501" r="1.1"/>
    <circle cx="-505662.643" cy="-173311.064" r="1.1"/>
    <circle cx="-505661.962" cy="-173311.048" r="1.1"/>
    <circle cx="-505661.57" cy="-173393.248" r="1.1"/>
    <circle cx="-505661.496" cy="-173394.248" r="1.1"/>
    <circle cx="-505661.481" cy="-173394.667" r="1.1"/>
    <circle cx="-505661.475" cy="-173390.813" r="1.1"/>
    <circle cx="-505661.402" cy="-173396.342" r="1.1"/>
    <circle cx="-505661.287" cy="-173398.945" r="1.1"/>
    <circle cx="-505661.172" cy="-173401.463" r="1.1"/>
    <circle cx="-505661.13" cy="-173402.301" r="1.1"/>
    <circle cx="-505660.711" cy="-173311.011" r="1.1"/>
    <circle cx="-505660.465" cy="-173299.786" r="1.1"/>
    <circle cx="-505659.789" cy="-173388.389" r="1.1"/>
    <circle cx="-505659.035" cy="-173286.559" r="1.1"/>
    <circle cx="-505658.868" cy="-173419.423" r="1.1"/>
    <circle cx="-505658.334" cy="-173386.907" r="1.1"/>
    <circle cx="-505658.287" cy="-173479.752" r="1.1"/>
    <circle cx="-505657.978" cy="-173386.546" r="1.1"/>
    <circle cx="-505657.255" cy="-173394.101" r="1.1"/>
    <circle cx="-505656.862" cy="-173385.394" r="1.1"/>
    <circle cx="-505656.779" cy="-173419.381" r="1.1"/>
    <circle cx="-505656.459" cy="-173299.786" r="1.1"/>
    <circle cx="-505656.339" cy="-173384.818" r="1.1"/>
    <circle cx="-505655.889" cy="-173310.875" r="1.1"/>
    <circle cx="-505655.229" cy="-173310.86" r="1.1"/>
    <circle cx="-505654.847" cy="-173402.39" r="1.1"/>
    <circle cx="-505654.339" cy="-173289.24" r="1.1"/>
    <circle cx="-505654.339" cy="-173472.966" r="1.1"/>
    <circle cx="-505653.894" cy="-173310.818" r="1.1"/>
    <circle cx="-505653.726" cy="-173316.577" r="1.1"/>
    <circle cx="-505653.658" cy="-173381.975" r="1.1"/>
    <circle cx="-505653.36" cy="-173393.939" r="1.1"/>
    <circle cx="-505653.129" cy="-173381.425" r="1.1"/>
    <circle cx="-505652.606" cy="-173419.297" r="1.1"/>
    <circle cx="-505652.349" cy="-173380.488" r="1.1"/>
    <circle cx="-505652.161" cy="-173402.28" r="1.1"/>
    <circle cx="-505652.098" cy="-173246.996" r="1.1"/>
    <circle cx="-505652.04" cy="-173229.272" r="1.1"/>
    <circle cx="-505651.883" cy="-173310.76" r="1.1"/>
    <circle cx="-505651.846" cy="-173246.907" r="1.1"/>
    <circle cx="-505651.265" cy="-173402.243" r="1.1"/>
    <circle cx="-505650.867" cy="-173230.812" r="1.1"/>
    <circle cx="-505650.37" cy="-173392.761" r="1.1"/>
    <circle cx="-505650.338" cy="-173378.226" r="1.1"/>
    <circle cx="-505650.255" cy="-173390.541" r="1.1"/>
    <circle cx="-505650.208" cy="-173295.759" r="1.1"/>
    <circle cx="-505650.066" cy="-173378.084" r="1.1"/>
    <circle cx="-505650.009" cy="-173402.191" r="1.1"/>
    <circle cx="-505649.893" cy="-173291.963" r="1.1"/>
    <circle cx="-505649.836" cy="-173236.153" r="1.1"/>
    <circle cx="-505649.689" cy="-173244.923" r="1.1"/>
    <circle cx="-505649.689" cy="-173298.199" r="1.1"/>
    <circle cx="-505649.652" cy="-173402.18" r="1.1"/>
    <circle cx="-505649.59" cy="-173298.545" r="1.1"/>
    <circle cx="-505649.145" cy="-173387.734" r="1.1"/>
    <circle cx="-505649.118" cy="-173393.756" r="1.1"/>
    <circle cx="-505649.103" cy="-173310.682" r="1.1"/>
    <circle cx="-505648.899" cy="-173377.477" r="1.1"/>
    <circle cx="-505648.862" cy="-173301.053" r="1.1"/>
    <circle cx="-505648.569" cy="-173310.655" r="1.1"/>
    <circle cx="-505648.453" cy="-173316.603" r="1.1"/>
    <circle cx="-505648.438" cy="-173292.832" r="1.1"/>
    <circle cx="-505648.433" cy="-173419.203" r="1.1"/>
    <circle cx="-505648.317" cy="-173228.372" r="1.1"/>
    <circle cx="-505647.684" cy="-173402.097" r="1.1"/>
    <circle cx="-505647.322" cy="-173402.081" r="1.1"/>
    <circle cx="-505647.307" cy="-173377.043" r="1.1"/>
    <circle cx="-505647.265" cy="-173377.011" r="1.1"/>
    <circle cx="-505647.228" cy="-173227.864" r="1.1"/>
    <circle cx="-505646.747" cy="-173393.672" r="1.1"/>
    <circle cx="-505646.427" cy="-173402.05" r="1.1"/>
    <circle cx="-505646.349" cy="-173419.156" r="1.1"/>
    <circle cx="-505645.532" cy="-173402.013" r="1.1"/>
    <circle cx="-505643.594" cy="-173376.618" r="1.1"/>
    <circle cx="-505643.296" cy="-173317.509" r="1.1"/>
    <circle cx="-505643.286" cy="-173317.509" r="1.1"/>
    <circle cx="-505643.055" cy="-173298.503" r="1.1"/>
    <circle cx="-505642.84" cy="-173410.171" r="1.1"/>
    <circle cx="-505642.82" cy="-173376.467" r="1.1"/>
    <circle cx="-505642.772" cy="-173300.733" r="1.1"/>
    <circle cx="-505642.448" cy="-173304.618" r="1.1"/>
    <circle cx="-505642.196" cy="-173430.785" r="1.1"/>
    <circle cx="-505642.155" cy="-173227.639" r="1.1"/>
    <circle cx="-505642.024" cy="-173315.127" r="1.1"/>
    <circle cx="-505641.956" cy="-173316.975" r="1.1"/>
    <circle cx="-505641.919" cy="-173317.74" r="1.1"/>
    <circle cx="-505641.767" cy="-173320.049" r="1.1"/>
    <circle cx="-505641.516" cy="-173325.468" r="1.1"/>
    <circle cx="-505641.401" cy="-173330.207" r="1.1"/>
    <circle cx="-505640.537" cy="-173358.779" r="1.1"/>
    <circle cx="-505640.469" cy="-173359.811" r="1.1"/>
    <circle cx="-505640.374" cy="-173361.633" r="1.1"/>
    <circle cx="-505640.212" cy="-173364.445" r="1.1"/>
    <circle cx="-505640.202" cy="-173234.76" r="1.1"/>
    <circle cx="-505640.139" cy="-173350.894" r="1.1"/>
    <circle cx="-505640.102" cy="-173367.283" r="1.1"/>
    <circle cx="-505640.05" cy="-173368.681" r="1.1"/>
    <circle cx="-505640.039" cy="-173351.402" r="1.1"/>
    <circle cx="-505639.605" cy="-173227.576" r="1.1"/>
    <circle cx="-505639.589" cy="-173227.576" r="1.1"/>
    <circle cx="-505635.117" cy="-173336.458" r="1.1"/>
    <circle cx="-505634.84" cy="-173337.537" r="1.1"/>
    <circle cx="-505634.782" cy="-173337.746" r="1.1"/>
    <circle cx="-505634.725" cy="-173339.024" r="1.1"/>
    <circle cx="-505634.693" cy="-173338.459" r="1.1"/>
    <circle cx="-505634.678" cy="-173338.27" r="1.1"/>
    <circle cx="-505634.222" cy="-173330.5" r="1.1"/>
    <circle cx="-505634.128" cy="-173327.526" r="1.1"/>
    <circle cx="-505634.054" cy="-173327.17" r="1.1"/>
    <circle cx="-505633.918" cy="-173332.851" r="1.1"/>
    <circle cx="-505632.238" cy="-173325.609" r="1.1"/>
    <circle cx="-505631.73" cy="-173263.872" r="1.1"/>
    <circle cx="-505631.724" cy="-173266.338" r="1.1"/>
    <circle cx="-505631.714" cy="-173272.255" r="1.1"/>
    <circle cx="-505631.704" cy="-173276.203" r="1.1"/>
    <circle cx="-505631.704" cy="-173276.349" r="1.1"/>
    <circle cx="-505631.677" cy="-173257.264" r="1.1"/>
    <circle cx="-505631.662" cy="-173254.986" r="1.1"/>
    <circle cx="-505631.588" cy="-173252.311" r="1.1"/>
    <circle cx="-505631.573" cy="-173286.418" r="1.1"/>
    <circle cx="-505631.52" cy="-173250.96" r="1.1"/>
    <circle cx="-505631.478" cy="-173290.455" r="1.1"/>
    <circle cx="-505631.478" cy="-173290.544" r="1.1"/>
    <circle cx="-505631.379" cy="-173292.864" r="1.1"/>
    <circle cx="-505631.332" cy="-173238.341" r="1.1"/>
    <circle cx="-505630.447" cy="-173325.704" r="1.1"/>
    <circle cx="-505630.389" cy="-173325.698" r="1.1"/>
    <circle cx="-505630.154" cy="-173325.683" r="1.1"/>
    <circle cx="-505629.761" cy="-173276.407" r="1.1"/>
    <circle cx="-505628.117" cy="-173275.888" r="1.1"/>
    <circle cx="-505626.593" cy="-173264.542" r="1.1"/>
    <circle cx="-505626.274" cy="-173207.878" r="1.1"/>
    <circle cx="-505626.201" cy="-173276.103" r="1.1"/>
    <circle cx="-505625.415" cy="-173211.193" r="1.1"/>
    <circle cx="-505625.389" cy="-173212.533" r="1.1"/>
    <circle cx="-505625.295" cy="-173205.957" r="1.1"/>
    <circle cx="-505625.284" cy="-173217.978" r="1.1"/>
    <circle cx="-505625.232" cy="-173220.748" r="1.1"/>
    <circle cx="-505625.179" cy="-173222.801" r="1.1"/>
    <circle cx="-505625.075" cy="-173226.963" r="1.1"/>
    <circle cx="-505625.049" cy="-173229.094" r="1.1"/>
    <circle cx="-505624.975" cy="-173231.576" r="1.1"/>
    <circle cx="-505624.829" cy="-173236.53" r="1.1"/>
    <circle cx="-505624.583" cy="-173283.423" r="1.1"/>
    <circle cx="-505624.394" cy="-173203.051" r="1.1"/>
    <circle cx="-505624.279" cy="-173276.318" r="1.1"/>
    <circle cx="-505623.206" cy="-173228.958" r="1.1"/>
    <circle cx="-505623.169" cy="-173375.487" r="1.1"/>
    <circle cx="-505622.954" cy="-173220.403" r="1.1"/>
    <circle cx="-505622.944" cy="-173240.142" r="1.1"/>
    <circle cx="-505622.902" cy="-173202.873" r="1.1"/>
    <circle cx="-505622.886" cy="-173238.875" r="1.1"/>
    <circle cx="-505622.881" cy="-173238.949" r="1.1"/>
    <circle cx="-505622.677" cy="-173275.637" r="1.1"/>
    <circle cx="-505622.52" cy="-173331.772" r="1.1"/>
    <circle cx="-505622.488" cy="-173263.469" r="1.1"/>
    <circle cx="-505622.462" cy="-173331.584" r="1.1"/>
    <circle cx="-505622.404" cy="-173331.395" r="1.1"/>
    <circle cx="-505622.342" cy="-173331.207" r="1.1"/>
    <circle cx="-505622.169" cy="-173210.35" r="1.1"/>
    <circle cx="-505621.645" cy="-173201.831" r="1.1"/>
    <circle cx="-505621.509" cy="-173243.849" r="1.1"/>
    <circle cx="-505621.357" cy="-173228.901" r="1.1"/>
    <circle cx="-505621.127" cy="-173274.831" r="1.1"/>
    <circle cx="-505620.671" cy="-173220.052" r="1.1"/>
    <circle cx="-505620.614" cy="-173375.299" r="1.1"/>
    <circle cx="-505620.556" cy="-173260.039" r="1.1"/>
    <circle cx="-505620.399" cy="-173283.266" r="1.1"/>
    <circle cx="-505619.75" cy="-173273.836" r="1.1"/>
    <circle cx="-505619.713" cy="-173257.18" r="1.1"/>
    <circle cx="-505619.582" cy="-173327.819" r="1.1"/>
    <circle cx="-505619.42" cy="-173327.248" r="1.1"/>
    <circle cx="-505619.336" cy="-173326.966" r="1.1"/>
    <circle cx="-505619.258" cy="-173326.678" r="1.1"/>
    <circle cx="-505618.865" cy="-173254.316" r="1.1"/>
    <circle cx="-505618.86" cy="-173254.295" r="1.1"/>
    <circle cx="-505618.849" cy="-173254.264" r="1.1"/>
    <circle cx="-505618.828" cy="-173209.486" r="1.1"/>
    <circle cx="-505618.519" cy="-173201.396" r="1.1"/>
    <circle cx="-505618.394" cy="-173219.706" r="1.1"/>
    <circle cx="-505618.331" cy="-173272.857" r="1.1"/>
    <circle cx="-505617.781" cy="-173238.65" r="1.1"/>
    <circle cx="-505617.661" cy="-173228.812" r="1.1"/>
    <circle cx="-505616.891" cy="-173201.82" r="1.1"/>
    <circle cx="-505616.734" cy="-173272.113" r="1.1"/>
    <circle cx="-505616.111" cy="-173219.355" r="1.1"/>
    <circle cx="-505616.1" cy="-173219.355" r="1.1"/>
    <circle cx="-505615.812" cy="-173228.738" r="1.1"/>
    <circle cx="-505615.802" cy="-173228.738" r="1.1"/>
    <circle cx="-505615.577" cy="-173208.637" r="1.1"/>
    <circle cx="-505615.566" cy="-173208.637" r="1.1"/>
    <circle cx="-505615.54" cy="-173208.627" r="1.1"/>
    <circle cx="-505615.257" cy="-173202.244" r="1.1"/>
    <circle cx="-505614.964" cy="-173271.715" r="1.1"/>
    <circle cx="-505614.854" cy="-173271.694" r="1.1"/>
    <circle cx="-505613.561" cy="-173276.396" r="1.1"/>
    <circle cx="-505613.404" cy="-173276.627" r="1.1"/>
    <circle cx="-505613.399" cy="-173276.632" r="1.1"/>
    <circle cx="-505613.383" cy="-173276.653" r="1.1"/>
    <circle cx="-505613.378" cy="-173276.663" r="1.1"/>
    <circle cx="-505613.205" cy="-173259.673" r="1.1"/>
    <circle cx="-505612.796" cy="-173259.652" r="1.1"/>
    <circle cx="-505612.692" cy="-173370.906" r="1.1"/>
    <circle cx="-505612.576" cy="-173238.409" r="1.1"/>
    <circle cx="-505612.388" cy="-173259.631" r="1.1"/>
    <circle cx="-505611.995" cy="-173259.61" r="1.1"/>
    <circle cx="-505611.98" cy="-173202.192" r="1.1"/>
    <circle cx="-505611.608" cy="-173259.62" r="1.1"/>
    <circle cx="-505611.597" cy="-173259.62" r="1.1"/>
    <circle cx="-505611.566" cy="-173259.62" r="1.1"/>
    <circle cx="-505610.424" cy="-173282.936" r="1.1"/>
    <circle cx="-505610.168" cy="-173332.453" r="1.1"/>
    <circle cx="-505610.121" cy="-173219.408" r="1.1"/>
    <circle cx="-505609.969" cy="-173222.298" r="1.1"/>
    <circle cx="-505609.55" cy="-173231.288" r="1.1"/>
    <circle cx="-505609" cy="-173201.49" r="1.1"/>
    <circle cx="-505608.807" cy="-173238.236" r="1.1"/>
    <circle cx="-505608.456" cy="-173332.406" r="1.1"/>
    <circle cx="-505608.272" cy="-173199.427" r="1.1"/>
    <circle cx="-505607.775" cy="-173335.207" r="1.1"/>
    <circle cx="-505607.634" cy="-173370.738" r="1.1"/>
    <circle cx="-505607.44" cy="-173341.872" r="1.1"/>
    <circle cx="-505607.309" cy="-173341.872" r="1.1"/>
    <circle cx="-505607.073" cy="-173238.153" r="1.1"/>
    <circle cx="-505606.848" cy="-173354.889" r="1.1"/>
    <circle cx="-505606.848" cy="-173354.936" r="1.1"/>
    <circle cx="-505606.843" cy="-173355.057" r="1.1"/>
    <circle cx="-505606.843" cy="-173355.104" r="1.1"/>
    <circle cx="-505606.827" cy="-173355.79" r="1.1"/>
    <circle cx="-505606.827" cy="-173355.884" r="1.1"/>
    <circle cx="-505606.785" cy="-173358.088" r="1.1"/>
    <circle cx="-505606.759" cy="-173199.396" r="1.1"/>
    <circle cx="-505606.759" cy="-173359.476" r="1.1"/>
    <circle cx="-505606.744" cy="-173360.052" r="1.1"/>
    <circle cx="-505606.738" cy="-173360.34" r="1.1"/>
    <circle cx="-505606.733" cy="-173360.581" r="1.1"/>
    <circle cx="-505606.539" cy="-173349.365" r="1.1"/>
    <circle cx="-505606.524" cy="-173362.623" r="1.1"/>
    <circle cx="-505606.487" cy="-173362.984" r="1.1"/>
    <circle cx="-505606.272" cy="-173282.947" r="1.1"/>
    <circle cx="-505605.775" cy="-173238.079" r="1.1"/>
    <circle cx="-505604.613" cy="-173332.285" r="1.1"/>
    <circle cx="-505604.571" cy="-173211.062" r="1.1"/>
    <circle cx="-505603.649" cy="-173332.238" r="1.1"/>
    <circle cx="-505602.618" cy="-173283.193" r="1.1"/>
    <circle cx="-505602.492" cy="-173278.559" r="1.1"/>
    <circle cx="-505602.366" cy="-173273.92" r="1.1"/>
    <circle cx="-505602.283" cy="-173283.214" r="1.1"/>
    <circle cx="-505602.241" cy="-173269.281" r="1.1"/>
    <circle cx="-505602.11" cy="-173264.631" r="1.1"/>
    <circle cx="-505600.445" cy="-173370.498" r="1.1"/>
    <circle cx="-505599.701" cy="-173332.055" r="1.1"/>
    <circle cx="-505598.136" cy="-173237.723" r="1.1"/>
    <circle cx="-505597.649" cy="-173283.538" r="1.1"/>
    <circle cx="-505595.753" cy="-173370.309" r="1.1"/>
    <circle cx="-505593.135" cy="-173283.852" r="1.1"/>
    <circle cx="-505591.324" cy="-173283.978" r="1.1"/>
    <circle cx="-505591.067" cy="-173331.688" r="1.1"/>
    <circle cx="-505590.952" cy="-173280.685" r="1.1"/>
    <circle cx="-505589.601" cy="-173270.574" r="1.1"/>
    <circle cx="-505589.145" cy="-173370.058" r="1.1"/>
    <circle cx="-505588.182" cy="-173270.558" r="1.1"/>
    <circle cx="-505587.878" cy="-173270.553" r="1.1"/>
    <circle cx="-505587.428" cy="-173283.386" r="1.1"/>
    <circle cx="-505586.983" cy="-173283.318" r="1.1"/>
    <circle cx="-505586.093" cy="-173386.656" r="1.1"/>
    <circle cx="-505586.04" cy="-173270.522" r="1.1"/>
    <circle cx="-505585.904" cy="-173209.711" r="1.1"/>
    <circle cx="-505585.899" cy="-173369.969" r="1.1"/>
    <circle cx="-505584.878" cy="-173209.679" r="1.1"/>
    <circle cx="-505584.307" cy="-173270.485" r="1.1"/>
    <circle cx="-505583.532" cy="-173282.789" r="1.1"/>
    <circle cx="-505582.47" cy="-173270.448" r="1.1"/>
    <circle cx="-505581.946" cy="-173369.806" r="1.1"/>
    <circle cx="-505581.852" cy="-173240.493" r="1.1"/>
    <circle cx="-505580.736" cy="-173270.417" r="1.1"/>
    <circle cx="-505580.208" cy="-173209.548" r="1.1"/>
    <circle cx="-505580.051" cy="-173241.409" r="1.1"/>
    <circle cx="-505579.506" cy="-173282.439" r="1.1"/>
    <circle cx="-505579.113" cy="-173282.412" r="1.1"/>
    <circle cx="-505577.972" cy="-173369.634" r="1.1"/>
    <circle cx="-505577.249" cy="-173270.349" r="1.1"/>
    <circle cx="-505577.145" cy="-173282.287" r="1.1"/>
    <circle cx="-505573.93" cy="-173209.329" r="1.1"/>
    <circle cx="-505573.636" cy="-173270.291" r="1.1"/>
    <circle cx="-505573.244" cy="-173369.424" r="1.1"/>
    <circle cx="-505572.914" cy="-173369.414" r="1.1"/>
    <circle cx="-505571.327" cy="-173369.34" r="1.1"/>
    <circle cx="-505570.605" cy="-173369.309" r="1.1"/>
    <circle cx="-505569.338" cy="-173249.567" r="1.1"/>
    <circle cx="-505569.013" cy="-173258.044" r="1.1"/>
    <circle cx="-505568.935" cy="-173260.097" r="1.1"/>
    <circle cx="-505568.825" cy="-173262.709" r="1.1"/>
    <circle cx="-505568.636" cy="-173266.123" r="1.1"/>
    <circle cx="-505568.421" cy="-173369.215" r="1.1"/>
    <circle cx="-505568.27" cy="-173369.204" r="1.1"/>
    <circle cx="-505568.081" cy="-173275.428" r="1.1"/>
    <circle cx="-505567.804" cy="-173369.183" r="1.1"/>
    <circle cx="-505565.18" cy="-173274.904" r="1.1"/>
    <circle cx="-505565.149" cy="-173247.886" r="1.1"/>
    <circle cx="-505564.735" cy="-173209.161" r="1.1"/>
    <circle cx="-505563.735" cy="-173394.101" r="1.1"/>
    <circle cx="-505563.405" cy="-173387.797" r="1.1"/>
    <circle cx="-505563.295" cy="-173403.458" r="1.1"/>
    <circle cx="-505562.96" cy="-173261.788" r="1.1"/>
    <circle cx="-505562.882" cy="-173274.595" r="1.1"/>
    <circle cx="-505562.808" cy="-173248.017" r="1.1"/>
    <circle cx="-505562.651" cy="-173209.119" r="1.1"/>
    <circle cx="-505562.41" cy="-173368.948" r="1.1"/>
    <circle cx="-505561.274" cy="-173247.97" r="1.1"/>
    <circle cx="-505561.033" cy="-173274.888" r="1.1"/>
    <circle cx="-505559.918" cy="-173330.468" r="1.1"/>
    <circle cx="-505559.913" cy="-173276.255" r="1.1"/>
    <circle cx="-505559.85" cy="-173277.119" r="1.1"/>
    <circle cx="-505559.85" cy="-173277.129" r="1.1"/>
    <circle cx="-505559.85" cy="-173277.14" r="1.1"/>
    <circle cx="-505559.85" cy="-173277.15" r="1.1"/>
    <circle cx="-505559.693" cy="-173330.453" r="1.1"/>
    <circle cx="-505557.855" cy="-173261.699" r="1.1"/>
    <circle cx="-505557.499" cy="-173261.694" r="1.1"/>
    <circle cx="-505557.368" cy="-173247.886" r="1.1"/>
    <circle cx="-505556.976" cy="-173330.275" r="1.1"/>
    <circle cx="-505556.771" cy="-173247.865" r="1.1"/>
    <circle cx="-505555.776" cy="-173247.86" r="1.1"/>
    <circle cx="-505554.556" cy="-173368.607" r="1.1"/>
    <circle cx="-505554.483" cy="-173330.139" r="1.1"/>
    <circle cx="-505553.63" cy="-173330.091" r="1.1"/>
    <circle cx="-505553.462" cy="-173330.076" r="1.1"/>
    <circle cx="-505553.457" cy="-173261.558" r="1.1"/>
    <circle cx="-505552.122" cy="-173261.233" r="1.1"/>
    <circle cx="-505551.886" cy="-173247.803" r="1.1"/>
    <circle cx="-505551.792" cy="-173247.797" r="1.1"/>
    <circle cx="-505550.959" cy="-173399.18" r="1.1"/>
    <circle cx="-505550.315" cy="-173260.17" r="1.1"/>
    <circle cx="-505550.268" cy="-173247.782" r="1.1"/>
    <circle cx="-505549.682" cy="-173259.804" r="1.1"/>
    <circle cx="-505549.472" cy="-173259.594" r="1.1"/>
    <circle cx="-505549.268" cy="-173247.761" r="1.1"/>
    <circle cx="-505548.75" cy="-173257.924" r="1.1"/>
    <circle cx="-505548.739" cy="-173256.924" r="1.1"/>
    <circle cx="-505548.504" cy="-173256.07" r="1.1"/>
    <circle cx="-505548.42" cy="-173256.442" r="1.1"/>
    <circle cx="-505548.294" cy="-173387.122" r="1.1"/>
    <circle cx="-505548.19" cy="-173255.222" r="1.1"/>
    <circle cx="-505548.059" cy="-173329.756" r="1.1"/>
    <circle cx="-505546.226" cy="-173329.641" r="1.1"/>
    <circle cx="-505545.655" cy="-173329.599" r="1.1"/>
    <circle cx="-505544.263" cy="-173247.687" r="1.1"/>
    <circle cx="-505543.985" cy="-173249.913" r="1.1"/>
    <circle cx="-505543.357" cy="-173249.19" r="1.1"/>
    <circle cx="-505542.828" cy="-173386.912" r="1.1"/>
    <circle cx="-505540.425" cy="-173208.423" r="1.1"/>
    <circle cx="-505540.388" cy="-173208.418" r="1.1"/>
    <circle cx="-505539.828" cy="-173208.391" r="1.1"/>
    <circle cx="-505539.487" cy="-173329.777" r="1.1"/>
    <circle cx="-505536.356" cy="-173330.301" r="1.1"/>
    <circle cx="-505534.356" cy="-173330.395" r="1.1"/>
    <circle cx="-505531.55" cy="-173330.442" r="1.1"/>
    <circle cx="-505503.699" cy="-173263.673" r="1.1"/>
    <circle cx="-505502.516" cy="-173343.422" r="1.1"/>
    <circle cx="-505502.479" cy="-173343.223" r="1.1"/>
    <circle cx="-505502.464" cy="-173330.673" r="1.1"/>
    <circle cx="-505502.448" cy="-173343.045" r="1.1"/>
    <circle cx="-505502.301" cy="-173342.223" r="1.1"/>
    <circle cx="-505502.202" cy="-173338.972" r="1.1"/>
    <circle cx="-505502.186" cy="-173339.37" r="1.1"/>
    <circle cx="-505496.667" cy="-173247.771" r="1.1"/>
    <circle cx="-505496.259" cy="-173312.237" r="1.1"/>
    <circle cx="-505494.84" cy="-173247.714" r="1.1"/>
    <circle cx="-505493.337" cy="-173271.145" r="1.1"/>
    <circle cx="-505491.348" cy="-173242.174" r="1.1"/>
    <circle cx="-505491.348" cy="-173242.221" r="1.1"/>
    <circle cx="-505491.316" cy="-173244.033" r="1.1"/>
    <circle cx="-505491.107" cy="-173247.928" r="1.1"/>
    <circle cx="-505491.039" cy="-173249.63" r="1.1"/>
    <circle cx="-505491.028" cy="-173250.237" r="1.1"/>
    <circle cx="-505491.018" cy="-173251.107" r="1.1"/>
    <circle cx="-505490.997" cy="-173253.285" r="1.1"/>
    <circle cx="-505490.986" cy="-173254.196" r="1.1"/>
    <circle cx="-505490.986" cy="-173254.306" r="1.1"/>
    <circle cx="-505490.122" cy="-173257.154" r="1.1"/>
    <circle cx="-505488.573" cy="-173311.823" r="1.1"/>
    <circle cx="-505487.672" cy="-173247.583" r="1.1"/>
    <circle cx="-505486.646" cy="-173277.8" r="1.1"/>
    <circle cx="-505486.143" cy="-173249.729" r="1.1"/>
    <circle cx="-505486.091" cy="-173250.813" r="1.1"/>
    <circle cx="-505486.075" cy="-173251.494" r="1.1"/>
    <circle cx="-505486.054" cy="-173253.463" r="1.1"/>
    <circle cx="-505485.986" cy="-173255.149" r="1.1"/>
    <circle cx="-505485.981" cy="-173255.29" r="1.1"/>
    <circle cx="-505485.75" cy="-173278.616" r="1.1"/>
    <circle cx="-505484.708" cy="-173311.608" r="1.1"/>
    <circle cx="-505483.85" cy="-173280.569" r="1.1"/>
    <circle cx="-505480.938" cy="-173244.389" r="1.1"/>
    <circle cx="-505480.881" cy="-173249.572" r="1.1"/>
    <circle cx="-505480.834" cy="-173250.892" r="1.1"/>
    <circle cx="-505480.771" cy="-173252.662" r="1.1"/>
    <circle cx="-505480.766" cy="-173253.431" r="1.1"/>
    <circle cx="-505480.734" cy="-173255.96" r="1.1"/>
    <circle cx="-505480.493" cy="-173309.671" r="1.1"/>
</g>

当我使用 Illustrator 合并圆圈时,它看起来像这样(如您所见,它小得多):

<g clip-path="url(#a)" transform="translate(353688.12 120977.663) scale(.695)" fill="none" stroke="#a1c3cc">
    <path d="M-942472.56-471233.662H942477.89h-5.236V471233.714H-942477.89h5.236V-470191.752" stroke-width=".1"/>
    <path d="M-942477.796-172787.596H942477.796M-507890.812 471238.898V-471238.898" stroke-width="1.1"/>
</g>

有什么东西可以帮我做这个吗?或者比我提到的方式更快的方法?也许这是 Snap.svg 可以做到但我想不通的事情?

我不太确定你真正想要的是什么,也不确定它会小得多,将圆圈表示为路径,它最终在路径字符串中包含更多信息,但你确实摆脱了一些标记(可能还有 dom 元素)。所以不确定这种类型的东西是否是你想要的,但可能会给出一些想法......

假设你有一些圈子..

<svg id="svg" version="1.1" xmlns="http://www.w3.org/2000/svg">
   <circle cx="50.202" cy="50.972" r="10.1"/>
   <circle cx="40.186" cy="50.37" r="10.1"/>
   <circle cx="30" cy="50.771" r="10.1"/>
</svg>

您可以使用 Snap 遍历它们并构建一个字符串,就像这样..

Snap.plugin( function( Snap, Element, Paper, global ) {
        Paper.prototype.circlePathString = function(cx,cy,r) {
            var p = "M" + cx + "," + cy;
            p += "m" + -r + ",0";
            p += "a" + r + "," + r + " 0 1,0 " + (r*2) +",0";
            p += "a" + r + "," + r + " 0 1,0 " + -(r*2) + ",0";
            return p;
        };
});

var s = Snap("#svg");
var totalPath = '';
var circles = s.selectAll('circle');

circles.forEach( function( el ) {
   totalPath += s.circlePathString( el.attr('cx'), el.attr('cy'),    el.attr('r') );
   el.remove();
} );

var newCirclePath = s.path( totalPath ).attr({ fill: 'red' });
alert( s.innerSVG() );

您必须遍历每个组并添加新路径,但这可能很有用。我不确定插画师是否在做其他聪明的事情来减小尺寸,或者是否有更简单的方法来表示路径中的圆圈,(或者我只是错过了重点),所以这可能还不够,但可以帮助别人。

jsfiddle

即使可以使用一些 js 来完成,恕我直言,Illustrator(您已经使用的工具)为您提供了一种方法。 (或者如果他们不给它 是可能的)

据我了解,您已经有了这样的结构,但重复了一千次:

然后您要做的是为每个组使用 Illustrator 的 pathfinders 中的 unite 工具。

让 Illustrator 为您完成。

  • 创建动作:Window > Actions > Create New Action(在新打开面板的右下角)。设置它的名字。然后它开始记录您正在做的事情,因此请密切注意弹出面板以避免发生不良情况。

  • Select 第一组,如下图所示。对其应用 unite pathfinder

  • Select下一组,但是为了保存在我们的batch Action中,使用Select > Next Object Below.确保select 动作已保存在“动作”面板中:

  • 然后你可以点击左下角的方块停止录制。

  • 现在,要么你选择点击播放按钮一千次,要么你写一个脚本来做。
    似乎 Adob​​e 的 ExtendScript 既不能调用操作也不能调用 Pathfinder 工具……因此,如果您在 mac 或 VB win 脚本上,则必须使用 AppleScript。

我不知道 VB 但这是 AppleScript,您会明白其中的逻辑。

tell application "Adobe Illustrator"
    activate
    set x to count group items of document 1
    repeat x times
        do script "Your Awesome Action" from "Default Actions"
    end repeat
end tell

从 AppleScript 编辑器执行此脚本,(您的文档仍处于打开状态并且尚未合并组 selected) 稍等片刻,您就完成了.