4

アップロードした STEP ファイルを他の CAD 形式に変換するにはどうすればよいですか? できればPHPを使用してください。

小さな STEP ファイルを 3dContentCentral にアップロードすると、新しくアップロードした STEP ファイルの 20 の異なるファイルタイプ形式がすぐに表示されました。URL の例: http://www.3dcontentcentral.com/Download-Model.aspx?catalogid=171&id=584767

あなたの何人かが私を正しい方向に向けることができることを願っています:)

4

1 に答える 1

4

FreeCADが提供する API を使用して、STEP ファイルを別の 3D 形式に変換できます。

APIはPythonで書かれていますが、PHPでPip - Pythonを使用できます

Python を使用してファイルを STEP から OBJ 形式に変換する方法を示す例を次に示します。

import os
import ImportGui
files = os.listdir("path")
for file in files:
    ImportGui.open("path" + file)
    App.setActiveDocument("Unnamed")
    App.ActiveDocument=App.getDocument("Unnamed")
    Gui.ActiveDocument=Gui.getDocument("Unnamed")
    Gui.SendMsgToActiveView("ViewFit")
    __objs__=[]
    __objs__.append(FreeCAD.getDocument("Unnamed").getObject("Part__Feature"))
    index = 1
    base = 'Part__Feature00'
    while FreeCAD.getDocument("Unnamed").getObject(base + str(index)) is not None:
        __objs__.append(FreeCAD.getDocument("Unnamed").getObject(base + str(index)))
        index+=1

    import Mesh
    Mesh.export(__objs__,"path" + file + ".obj")
    del __objs__
    App.closeDocument("Unnamed")
于 2017-01-10T13:05:51.253 に答える