我有一个 pov-ray 文件,它定义了很多圆柱体和球体。有时这些形状被定义为具有“color@”,这使得 povray 无法渲染。我发现的一种解决方案是删除有问题的圆柱体和球体。所以一个包含这个文本的文件
cylinder {
< -0.17623, 0.24511, -0.27947>, < -0.15220, 0.22658, -0.26472>, 0.00716
texture { colorO }
}
sphere {
< -0.00950, 0.00357, 0.00227>, 0.00716
texture { color@ }
}
cylinder {
< -0.00950, 0.00357, 0.00227>, < 0.00327, 0.00169, 0.00108>, 0.00716
texture { color@ }
}
sphere {
< 0.15373, 0.00601, 0.18223>, 0.00716
texture { colorO }
}
会变成这个文本
cylinder {
< -0.17623, 0.24511, -0.27947>, < -0.15220, 0.22658, -0.26472>, 0.00716
texture { colorO }
}
sphere {
< 0.15373, 0.00601, 0.18223>, 0.00716
texture { colorO }
}
有没有办法用 shell 脚本来做这个替换?最好在 tcsh 中。谢谢!