admin管理员组文章数量:1023764
Is it possible to get distance between paper point and path?
const point = new Point([100, 200]);
const path = new Path();
path.strokeColor = 'black';
path.add(new Point(30, 30));
path.add(new Point(100, 100));
Is it possible to get distance between paper point and path?
const point = new Point([100, 200]);
const path = new Path();
path.strokeColor = 'black';
path.add(new Point(30, 30));
path.add(new Point(100, 100));
Share
Improve this question
edited Nov 24, 2017 at 20:21
daniele3004
14k13 gold badges76 silver badges78 bronze badges
asked Nov 23, 2017 at 10:03
Ewelina RybczyńskaEwelina Rybczyńska
312 bronze badges
1 Answer
Reset to default 10point.getDistance(path.getNearestPoint(point))
will get you the distance between the point in question and the nearest point to it on the path.
Is it possible to get distance between paper point and path?
const point = new Point([100, 200]);
const path = new Path();
path.strokeColor = 'black';
path.add(new Point(30, 30));
path.add(new Point(100, 100));
Is it possible to get distance between paper point and path?
const point = new Point([100, 200]);
const path = new Path();
path.strokeColor = 'black';
path.add(new Point(30, 30));
path.add(new Point(100, 100));
Share
Improve this question
edited Nov 24, 2017 at 20:21
daniele3004
14k13 gold badges76 silver badges78 bronze badges
asked Nov 23, 2017 at 10:03
Ewelina RybczyńskaEwelina Rybczyńska
312 bronze badges
1 Answer
Reset to default 10point.getDistance(path.getNearestPoint(point))
will get you the distance between the point in question and the nearest point to it on the path.
本文标签: javascriptPaperjs distance between point and pathStack Overflow
版权声明:本文标题:javascript - Paper.js distance between point and path - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745531511a2154771.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论