gcode预览测试

This commit is contained in:
2026-05-14 20:21:16 +08:00
parent 65f221a5d8
commit 837996c436
17 changed files with 1363 additions and 296 deletions

25
refer/test_rot.py Normal file
View File

@@ -0,0 +1,25 @@
import numpy as np
import math
rx = math.radians(-60.0)
rz = math.radians(45.0)
cosX, sinX = math.cos(rx), math.sin(rx)
cosZ, sinZ = math.cos(rz), math.sin(rz)
# Original code rotation matrix
rot = np.array([
[cosZ, -sinZ*cosX, sinZ*sinX, 0],
[sinZ, cosZ*cosX, -cosZ*sinX, 0],
[0, sinX, cosX, 0],
[0, 0, 0, 1]
])
print("Original rot:\\n", rot)
# Correct orbit Rx @ Rz
rot_correct = np.array([
[cosZ, -sinZ, 0, 0],
[cosX*sinZ, cosX*cosZ, -sinX, 0],
[sinX*sinZ, sinX*cosZ, cosX, 0],
[0, 0, 0, 1]
])
print("Rx @ Rz:\\n", rot_correct)