开源改变世界

PocketIsland 类中的错误 #1536

推推 grbl 3年前 (2023-02-03) 173次浏览
关闭
LittlePierre 打开了这个问题 2021 年 2 月 12 日 · 33条评论
关闭

PocketIsland 类中的错误#1536

LittlePierre 打开了这个问题 2021 年 2 月 12 日 · 33条评论

注释

PocketIsland 类中的错误 #1536
贡献者
小皮埃尔 评论了 2021 年 2 月 12 日  

正如在#1535中讨论的那样@Harvie恐怕我发现了一个错误

Path.split2contours(self, acc=EPSV)

即使我还不确定。

当我在文件 triangle4.dxf 上制作一个带内岛的口袋时(压缩以允许在 github 评论中导入),当我激活该选项时我得到奇怪的结果
allow G1 linking segments(default yes)

禁用时,奇怪的片段消失。
我使用直径 2 或直径 5 的立铣刀进行复制。
这是出现问题的文件
triangle4.zip

  • 启用选项后,我用直径 5 的立铣刀得到了这个结果
    PocketIsland 类中的错误 #1536

  • 禁用选项后,我得到了这个
    PocketIsland 类中的错误 #1536

我认为在文件 pocketwithislands.py 的第 75 -81 行中调用 split2contous 时会出现错误

			#concatenate newpath in a single list and split2contours
			if allowG1 :
				MyFullPath = Path("Pocket")
				for path in newpathList :
					for seg in path:
						MyFullPath.append(seg)
				newpathList = MyFullPath.split2contours()

该错误不在 MyFullPath 中附加段,

				for path in newpathList :
					for seg in path:
						MyFullPath.append(seg)

因为我只是附加了 Segment.LINE 类型,我们在图 1 中得到了一条弧线。

以下是口袋出现问题的其他文件,包括旧的口袋功能新的 pocketwithislands 插件
钟表.zip

  • 使用直径为 1 毫米的立铣刀在贝桑松 C 上使用标准口袋工具制作口袋
    PocketIsland 类中的错误 #1536

这两种工具在某些字母上还有其他问题。

此外,如果这可以帮助,

grep -r split2contours

给出以下结果

lib/bpath.py:	def split2contours(self, acc=EPSV):
lib/bpath.py:			opath = opath.split2contours()
lib/bpath.py:	# FIXME: This probably can be replaced with split2contours() and i've just reinvented wheel LOL

plugins/difference.py:				#paths_newbase.extend(newbase.split2contours())

plugins/pocketwithislands.py:			#concatenate newpath in a single list and split2contours
plugins/pocketwithislands.py:				newpathList = MyFullPath.split2contours()
plugins/pocketwithislands.py:		purgednewoutpath= newoutpath.split2contours()#list of paths
plugins/pocketwithislands.py:		cleanpath = cleanpath.split2contours()

CNC.py:			opath = path.split2contours(0.0001) #Lowered accuracy due to problems interfacing arcs and lines in DXF
CNC.py:		opath = opath.split2contours()
CNC.py:				opath = opath.split2contours()
CNC.py:				opath = opath.split2contours()
PocketIsland 类中的错误 #1536
贡献者作者

不,问题不在 split 2 轮廓中,评论时出现
,newpathList = MyFullPath.split2contours()

			if allowG1 :
				MyFullPath = Path("Pocket")
				for path in newpathList :
					for seg in path:
						MyFullPath.append(seg)
# 				newpathList = MyFullPath.split2contours()
		if newpathList:

我得到了以下结果

PocketIsland 类中的错误 #1536
问题是在

class PocketIsland:

但我还不明白为什么。
皮埃尔

PocketIsland 类中的错误 #1536 LittlePierre 更改了标题 Path.split2contours 函数中的错误? PocketIsland 类中的错误 2021 年 2 月 12 日
PocketIsland 类中的错误 #1536
合作者

即使禁用 G1 链接,我也有问题。它在岛屿内部非常一致地进行铣削:
PocketIsland 类中的错误 #1536

带岛屿的原始形状:

PocketIsland 类中的错误 #1536

PocketIsland 类中的错误 #1536
贡献者
马里奥巴斯 评论了 2021 年 2 月 12 日  

真的很感动。我会尝试了解它是如何工作的。
使用位 0.7 会出现此问题

PocketIsland 类中的错误 #1536

PocketIsland 类中的错误 #1536
贡献者

也许“将所有其他形状视为岛屿”选项有用?

PocketIsland 类中的错误 #1536
贡献者作者
小皮埃尔 评论了 2021 年 2 月 12 日  

即使禁用 G1 链接,我也有问题。它在岛屿内部非常一致地进行铣削:

@Harvie
你能把你的文件发给我吗?
在这种情况下,可能是与以下几行相关的另一个问题

			path.directionSet(1) #turn path to CW (conventional when milling inside)

			D = path.direction()
			if D==0: D=1
			dir = path.direction()
			opath = path.offset(offset*float(dir))
			dir = island.direction()
			offIsl = island.offset(-offset*float(dir))

一些想法
尝试将深度递归限制为 0 或 1 以了解您的问题
尝试在“配置文件”中使用偏移函数

@MARIOBASZ
您必须先切换岛屿才能应用口袋岛;我没有看到你发送的图片中的岛屿切换。
我将递归深度限制为 100,也许这可以解释为什么 0.7 位没有更深。

PocketIsland 类中的错误 #1536
贡献者作者
小皮埃尔 评论了 2021 年 2 月 12 日  

更新

@Harvie
我认为我已经重现了您的问题并通过在第 162 行及以下的代码中添加以下行来修复它

			if self.depth >0 and p3 is not None and p4 is not None :
				self.islandG1SegList.append(Segment(Segment.LINE,p3,p4))
			offIsl.intersectSelf()
			offIsl.removeExcluded(island, abs(offset))

与补丁
PocketIsland 类中的错误 #1536

没有补丁
PocketIsland 类中的错误 #1536

祝皮埃尔一切顺利

但仍然存在连接不同口袋路径的坏 g1 段,最初的问题仍然存在
PocketIsland 类中的错误 #1536

压缩包

PocketIsland 类中的错误 #1536
贡献者作者

我已经为@Harvie问题,如果您可以提供反馈。

即使禁用 G1 链接,我也有问题。它在岛屿内部非常一致地进行铣削:

谢谢
皮埃尔

PocketIsland 类中的错误 #1536
合作者
哈维 评论了 2021 年 2 月 12 日  

我想我已经重现了你的问题并修复了它

凉爽的。谢谢。我会尝试。我还注意到您发送的图像中可能存在不必要的空气切断。或者也许我错了,它只是急流在屏幕上融合在一起。

PocketIsland 类中的错误 #1536

至少在我看来,某些区域被切割了两次。不要误会我的意思,这仍然非常棒。但修复它肯定是有道理的。

PocketIsland 类中的错误 #1536
合作者

这是我用过的文件:
pocket_island_bug.ngc.txt

PocketIsland 类中的错误 #1536
贡献者作者
小皮埃尔 评论了 2021 年 2 月 12 日  

嗨托马斯

我已经在禁用选项 allowG1 的情况下使用 Diam 1mm 立铣刀尝试了您的文件错误我在 启用选项 allowG1的情况下得到了以下信息
PocketIsland 类中的错误 #1536

PocketIsland 类中的错误 #1536

因此,您的错误似乎已由 PR #1537
解决, 但原始错误仍然存​​在,因为当从一个区域跳到另一个区域时,链接口袋路径的 G1 段有时会与岛屿相交(很可能)
我将在本周末尝试添加此问题的修复程序。

PocketIsland 类中的错误 #1536
贡献者作者

我还注意到您发送的图像中可能存在不必要的空气切断。或者也许我错了,它只是急流在屏幕上融合在一起。

由于张贴图片的分辨率,我认为这是图像中的人工制品。
但文件似乎没
问题 这是放大图
PocketIsland 类中的错误 #1536

PocketIsland 类中的错误 #1536
合作者

PocketIsland 类中的错误 #1536

PocketIsland 类中的错误 #1536
贡献者作者

啊哈
intersectSelf
removeExcluded
&
split2contours

是真正的 MVP ;)

LittlePierre 添加了对引用此问题的 LittlePierre/bCNC 的提交 2021 年 2 月 13 日

PocketIsland 类中的错误 #1536 LittlePierre 提到了这个问题 2021 年 2 月 13 日
PocketIsland 类中的错误 #1536
贡献者作者

请找到我的 py2 和 py3 TestCases.zip测试用例

我认为现在稳定了。
皮埃尔

LittlePierre 添加了对引用此问题的 LittlePierre/bCNC 的提交 2021 年 2 月 13 日

PocketIsland 类中的错误 #1536
贡献者作者

extraTestCases.zip

现在我已经没有测试用例失败了,我认为这个问题可以被视为 #1538中的最后一个修复解决了

PocketIsland 类中的错误 #1536
贡献者作者

更新:只是为了分享我的观点并询问社区:

我认为 pocketwitisland 实验性插件现在比以前的标准 pocket 工具更稳定,也更强大。
我之所以这样说,是因为我在袖珍标准工具中发现了新工具中没有的错误。

例如,在 extraTestCases 中使用“Besançon”的 C 进行测试
它在 pocket 标准工具上失败
并通过 pocketwithisland 实验插件。

还有很多其他情况。

我们是否应该考虑用实验工具替换标准工具?

另一件事是我已经看到(但不确定):“配置文件”工具中可能存在错误,对某些形状进行偏移有时会失败(待确认)