1 Star 0 Fork 2

chenyp401/CAM

forked from zzthfut/CAM 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Test_genDpPath.py 939 Bytes
一键复制 编辑 原始数据 按行查看 历史
zzthfut 提交于 2023-08-15 15:49 . 9-16
import time
from GenDpPath import genDpPath
from SliceAlgo import readSlcFile
from Utility import degToRad
from VtkAdaptor import VtkAdaptor
if __name__ == "__main__":
interval = 5
angle = 0
pathses = []
layers = readSlcFile("/home/zzt/Downloads/tower.SLC")
start = time.perf_counter()
for i in range(len(layers)):
print("dp,layer:%d/%d" % (i + 1, len(layers)))
theta = degToRad(angle) if (i % 2 == 1) else degToRad(angle + 90)
paths = genDpPath(layers[i].contours, interval, theta)
pathses.append(paths)
end = time.perf_counter()
print("GenDpPath time:%f seconds" % (end - start))
va = VtkAdaptor()
for layer in layers:
for contour in layer.contours:
va.drawPolyline(contour).GetProperty().SetColor(0, 0, 0)
for paths in pathses:
for path in paths:
va.drawPolyline(path).GetProperty().SetColor(1, 0, 0)
va.display()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/chenyp401/cam.git
git@gitee.com:chenyp401/cam.git
chenyp401
cam
CAM
master

搜索帮助