Eneroth3 / eneroth-svg-exporter

Export SVG from SketchUp selection.
MIT License
8 stars 0 forks source link

`Exporter::svg_path()` reported to not be closing paths #2

Closed DanRathbun closed 2 years ago

DanRathbun commented 2 years ago

Exporter::svg_path() reported to not be closing paths. - "exporter.rb", line 151

REF: https://forums.sketchup.com/t/eneroth-svg-exporter/174017

I think that (contrary to what the OP said in post 3 of your forum topic,) line 169 should remain as is.

Line 155 should become ...

   end.join(" ") << " Z"

... so that each loop tells the SVG path to close as it is processing faces (which are a set of closed edges.)

Then d_inner should begin with a space if there are inner loops, so line 165 should insert a leading space like:

     d_inner[0] = " M"

And again, each inner loop should close it's corresponding SVG path, so line 164 should be:

     end.join(" ") << " Z"
Eneroth3 commented 2 years ago

Fixed. Awaiting EW review now.

Thanks for logging.