Экспорт подсборок с мешами (SDF) и плана сборки (PDDL) из FreeCAD в виде архива zip
This commit is contained in:
parent
7f13c0056f
commit
e65236aab6
37 changed files with 1022 additions and 176 deletions
23
sdf/helper/fs.py
Normal file
23
sdf/helper/fs.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
import os
|
||||
import json
|
||||
|
||||
|
||||
class FS:
|
||||
def readJSON(path: str):
|
||||
return json.loads((open(path)).read())
|
||||
|
||||
def writeFile(data, filePath, fileName):
|
||||
|
||||
file_to_open = filePath + fileName
|
||||
|
||||
f = open(file_to_open, 'w', )
|
||||
|
||||
f.write(data)
|
||||
def readFile(path:str):
|
||||
return open(path).read()
|
||||
|
||||
def readFilesTypeFolder(pathFolder: str, fileType = '.json'):
|
||||
filesJson = list(
|
||||
filter(lambda x: x[-fileType.__len__():] == fileType, os.listdir(pathFolder)))
|
||||
return filesJson
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue