python - stl_writer.Write 不保存任何文件
问题描述
我正在尝试从 stp 转换为 stl。代码是:
rom OCC.Core.STEPControl import STEPControl_Reader
from OCC.Core.StlAPI import StlAPI_Writer
import os
os.chdir(os.path.dirname(os.path.abspath(__file__)))
input_file = 'stl_test.stp' # input STEP (AP203/AP214 file)
output_file = 'stl_test.stl' # output X3D file
step_reader = STEPControl_Reader()
step_reader.ReadFile( input_file )
step_reader.TransferRoot()
myshape = step_reader.Shape()
print("File readed")
# Export to STL
stl_writer = StlAPI_Writer()
stl_writer.SetASCIIMode(True)
stl_writer.Write(myshape, output_file)
print(stl_writer.Write(myshape, output_file))
print("Written")
这不会在工作目录中保存任何内容。并print(stl_writer.Write(myshape, output_file))
给出错误的输出。
任何人都可以帮忙吗?
解决方案
推荐阅读
- ajax - 使用 Order By 对产品进行排序
- ios - 核心数据:如何最好地重复检查唯一性?保存上下文?取数?
- excel - VBA CDate(Now()) 导致类型不匹配
- node.js - 安装 Strapi 时 SQLite3 出现问题 - 无法在类似字节的对象上使用字符串模式
- angular - Angular ngx-quill 编辑器 - 处理图像点击
- python - jupyter notebook中movies.dat文件解析
- c# - 使用 MVVM 在 Xamarin.Forms 中单击时如何更改 Frame 控件的颜色
- regex - 如何使用 sed 查找路径并将输出与字符串连接起来
- r - 在对 lavaan 进行验证性因子分析时与因子排序相关的错误
- angular - 如何在表单数组中聚焦无效项目