You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

FillContainsWithDetail方法未按预期工作,请求技术排查

问题:FillContainsWithDetail 返回结果不符合预期

我在使用FillContainsWithDetail方法检测形状包含关系时,遇到了结果不符合预期的情况:

预期行为

  • 当玩家形状完全未接触目标形状时,方法返回Empty
  • 当玩家形状完全包含目标形状时,方法返回FullyContains

检测逻辑代码

我用来检测的方法如下:

public string CheckIfInside(Shape shpPlayer, Shape shpObject) 
{ 
    Geometry geo1 = shpPlayer.RenderedGeometry; 
    Geometry geo2 = shpObject.RenderedGeometry; 
    string s = geo1.FillContainsWithDetail(geo2).ToString(); 
    return s; 
}

实际测试结果

运行测试后,得到的返回结果如下:

[0] "Empty" 
[1] "Empty" 
[2] "Intersects" 
[3] "Intersects" 
[4] "Intersects" 
[5] "Empty" 
[6] "Empty" 
[7] "Intersects" 
[8] "Intersects" 
[9] "FullyInside" 
[10] "Empty" 
[11] "Empty" 
[12] "FullyInside" 
[13] "Empty" 
[14] "Empty" 
[15] "FullyInside" 
[16] "Empty" 
[17] "Empty" 
[18] "FullyInside" 
[19] "Empty" 
[20] "Empty" 
[21] "FullyInside" 
[22] "Empty" 
[23] "Empty" 
[24] "FullyInside" 
[25] "Empty" 
[26] "Empty" 
[27] "FullyInside" 
[28] "Empty" 
[29] "Empty" 
[30] "FullyInside" 
[31] "Empty" 
[32] "Empty" 
[33] "FullyInside" 
[34] "Empty" 
[35] "Empty" 
[36] "FullyInside" 
[37] "Empty" 
[38] "Empty" 
[39] "FullyInside" 
[40] "Empty" 
[41] "Empty" 
[42] "FullyInside" 
[43] "Empty" 
[44] "Empty" 
[45] "FullyInside" 
[46] "Empty" 
[47] "Empty" 
[48] "FullyInside" 
[49] "Empty" 
[50] "Empty"

补充说明

玩家形状(shpPlayer / geo1)是红色小方块,其他待检测的目标形状为树木和湖泊。

希望能得到大家的帮助,看看问题出在哪里!

内容的提问来源于stack exchange,提问作者Greenkiller

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 06:15:56