建立方向盘项目初始版本

This commit is contained in:
2026-10-29 22:04:55 +08:00
commit 9962cbfbce
834 changed files with 1519203 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
import FreeCAD as A, Part, json
from pathlib import Path
r=Path(r'C:\projects\wheel\models'); old=Part.read(str(r/'washer_panel_4x4'/'一体式4x4双厚垫片.step')); new=Part.read(str(r/'washer_panel_4x2'/'一体式4x2双厚垫片.step'))
v=A.Vector; checks=[]
for row in range(2):
for col in range(4):
yold=0 if row==0 else 24; yn=12*row; x=12*col
ns=new.common(Part.makeBox(12,12,2,v(x,yn,0)))
os=old.common(Part.makeBox(12,12,2,v(x,yold,0))); os.translate(v(0,yn-yold,0))
a=ns.cut(os).Volume; b=os.cut(ns).Volume
assert abs(a)<1e-6 and abs(b)<1e-6,(row,col,a,b)
checks.append({'row':row,'col':col,'old_minus_new':a,'new_minus_old':b})
(r/'washer_panel_4x2'/'切分比对.json').write_text(json.dumps(checks,ensure_ascii=False,indent=2),encoding='utf-8')
print('8 cells match exactly')