建立方向盘项目初始版本
This commit is contained in:
10
scripts/verify_fan_direct_motor_side_140.FCMacro
Normal file
10
scripts/verify_fan_direct_motor_side_140.FCMacro
Normal file
@@ -0,0 +1,10 @@
|
||||
import FreeCAD as A, Part, json, os
|
||||
p=r'C:\projects\wheel\models\fan_direct_motor_side_140\Assembly.FCStd'
|
||||
d=A.openDocument(p);d.recompute()
|
||||
out={}
|
||||
fan=d.getObject('DirectFan')
|
||||
for name in ('Rail0','Rail1'):
|
||||
a=d.getObject(name);out[name]={'fan_distance':a.Shape.distToShape(fan.Shape)[0],'fan_overlap':a.Shape.common(fan.Shape).Volume,'length':a.Shape.BoundBox.YLength}
|
||||
assert all(abs(v['length']-140)<1e-6 and v['fan_distance']<1e-6 and abs(v['fan_overlap'])<1e-6 for v in out.values())
|
||||
open(r'C:\projects\wheel\models\fan_direct_motor_side_140\contact_validation.json','w').write(json.dumps(out,indent=2))
|
||||
A.closeDocument(d.Name);os._exit(0)
|
||||
Reference in New Issue
Block a user