本帖最后由 tzbm123456 于 2022-7-3 09:01 编辑
<除去Mesh和Model> file = File.open("D:/A1_IT/Cesium/Cesium_WEB/DataSource/TZBM/jjj/jjjj_F.obj","r+"); i=0 while line = file.gets if (line.include?("Mesh") or line.include?("Model") ) p i; line=del_MeshOrModel(line); p line; i=i+1; def del_MeshOrModel(str) if (str.include?("Mesh") or str.include?("Model")) arr=str.split(" "); arr_New=[]; arr.each{|en| if !(en.include?("Mesh") or en.include?("Model")) arr_New.push(en); end } str=arr_New[0]+" "+arr_New[1]+"\n" end
|