代码拉取完成,页面将自动刷新
Computes the intersection between two SVG paths.
Execute npm run dev
and navigate to http://localhost:9876/debug.html
to see more examples.
import intersect from 'path-intersection';
const path0 = 'M30,100L270,20';
const path1 = 'M150,150m0,-18a18,18,0,1,1,0,36a18,18,0,1,1,0,-36z';
const intersection = intersect(path0, path1);
// [ { x: ..., y: ..., segment1: ..., segment2: ... }, ... ]
Results are approximate, as we use bezier clipping to find intersections.
# install dependencies
npm install
# build and test the library
npm run all
The intersection logic provided by this library is derived from path.js
, a part of Snap.svg.
Use under the terms of the MIT license.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。