我使用 wolframscript 生成数百个图像,例如 八面体 4 倍对称的可视化 (将在动画视频中组合),如下所示:
Map[
Export[
"img" <> IntegerString[# , 10, 6] <> ".jpg",
Show[
(* Graphics3D with >300,000 polygons *),
ViewVector -> {#, {0,0,#[[3]]}}& @ viewPoints[[#]],
ViewVertical -> {0, 0, 1},
ViewAngle -> 35 Degree,
ImageSize -> Large
]
] &,
Range[ ToExpression[#[[1]]], ToExpression[#[[2]]] ]& @ Rest[$ScriptCommandLine]
]
由于 FE 中的光栅化操作触发 Mathematica Frontend 12.1.1 中的内存泄漏,我被迫从这样的 shell 脚本分段运行脚本
./hp-h+h-bps+ghp-t7-s2-9.wls 1 5
./hp-h+h-bps+ghp-t7-s2-9.wls 6 10
./hp-h+h-bps+ghp-t7-s2-9.wls 11 15
...
./hp-h+h-bps+ghp-t7-s2-9.wls 191 195
./hp-h+h-bps+ghp-t7-s2-9.wls 196 200
是否可以从 wolframscript 中杀死前端?(Run["kill -9 pidOfMathematicaServer"] 将不起作用,因为这也会杀死产生 FE 的内核。)