Dilate and erode SVG shapes using Javascript

前端 未结 2 1152
面向向阳花
面向向阳花 2021-01-16 18:27

EDIT:

I finally found a way to erode and dilate polygons (offsetting) so that new geometry is created using Clipper library: https://sourceforge.net/projects/jsclipp

2条回答
  •  囚心锁ツ
    2021-01-16 19:01

    You can sort of get what you seem to be after by stroking with different stroke-widths in combination with clip-path or mask. Here's an example, some explanations of how it's constructed see here and here (arrow up or down to see some other slides on that example).

    It doesn't give you new geometry though, just something that might look like new geometry.

提交回复
热议问题