2017-12-07から1日間の記事一覧

テストG-Codeを生成するPythonプログラム

import math r = 20 base = 0.5 spd = 4000.0 print("G28") print("G1 Z%f F%f" % (base,spd)) for h in range(20): z = base + h*0.1 for theta in range(360): rad = (theta*math.pi/180.0) x = r*math.cos(rad) y = r*math.sin(rad) print("G1 X%f Y%f Z%…

RepRapでChecksumの計算アルゴリズム

http://reprap.org/wiki/G-code#.2A:_Checksum擬似コード int cs = 0; for(i = 0; cmd[i] != '*' && cmd[i] != NULL; i++) cs = cs ^ cmd[i]; cs &= 0xff; // Defensive programming... テストコード #include <stdio.h> int main(){ int cs = 0; char *cmd = "N380 G</stdio.h>…

姫野ベンチ

http://accc.riken.jp/supercom/himenobmt/download/98-source/ wget http://accc.riken.jp/wp-content/uploads/2015/07/himenobmt.c.zipUbuntu16.04 mimax = 129 mjmax = 65 mkmax = 65 imax = 128 jmax = 64 kmax =64 cpu : 1.343832 sec. Loop executed f…