在Ellipse和Line之间合并几何不会得到交集 [英] CombineGeometry between an Ellipse and a Line getting no intersection

查看:215
本文介绍了在Ellipse和Line之间合并几何不会得到交集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我测试了这个代码(两个省略号之间的交集,看看接受的答案),但是如果我将其中一个椭圆更改为线几何(或表示线的路径几何),并且它不给我提供交集。有人知道为什么吗?由于线条没有区域,它没有交集?

由于最终我想查看任意路径几何是否相交。我想我必须找到一种方法来为某些区域填充路径,如果没有解决方案来使用路径吗? 解决方案 div>

出于某种原因,我猜测线几何不被视为几何,也许只是某种笔触?无论如何,您需要在您的路径上执行 GetWidenedPathGeometry ,它会为您提供由笔画形状定义的几何图形。


So I tested this code (intersection between two ellipses, look at the accepted answer), but if I change one of the ellipses to a line geometry (or path geometry representing a line) and it gives me no intersection. Does any one know why? Does combine geometry work on area of the geometry, and since lines have no area, it gives no intersection?

Since eventually I would want to see if the arbitrary path geometries intersect. I guess I would have to find a way to "pad" the path with some area, if there is no solution to just using a path?

解决方案

For some reason I guess line geometry is not considered as a geometry, maybe just some sort of a stroke? Anyway, you need to do GetWidenedPathGeometry on your path and it would give you a geometry defined by the shape of the stroke.

这篇关于在Ellipse和Line之间合并几何不会得到交集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆