1 Star 0 Fork 2

chenyp401/CAM

forked from zzthfut/CAM 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Test_hatch.py 778 Bytes
一键复制 编辑 原始数据 按行查看 历史
zzthfut 提交于 2023-08-13 19:50 . 9-11
from ClipperAdaptor import ClipperAdaptor
import vtk
from GenHatch import genClipHatches, genSweepHatches
import Utility
from VtkAdaptor import VtkAdaptor
va = VtkAdaptor()
path = [(0, 0), (100, 0), (100, 100), (50, 60), (0, 100)]
poly = ClipperAdaptor(0).toPoly(path)
angle = Utility.degToRad(90)
# segs = genClipHatches([poly], 6, angle)
segs = genSweepHatches([poly], 6, angle)
va.drawPolyline(poly).GetProperty().SetColor(0, 0, 0)
for i in range(len(segs)):
va.drawSegment(segs[i]).GetProperty().SetColor(1, 0, 0)
textSrc = vtk.vtkVectorText()
textSrc.SetText("%d" % (i))
textActor = va.drawPdSrc(textSrc)
textActor.SetPosition(segs[i].B.x, segs[i].B.y, segs[i].B.z)
textActor.SetScale(3)
textActor.GetProperty().SetColor(0, 0, 1)
va.display()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/chenyp401/cam.git
git@gitee.com:chenyp401/cam.git
chenyp401
cam
CAM
master

搜索帮助