Экспорт подсборок с мешами (SDF) и плана сборки (PDDL) из FreeCAD в виде архива zip

This commit is contained in:
IDONTSUDO 2023-04-18 14:01:46 +00:00 committed by Igor Brylyov
parent 7f13c0056f
commit e65236aab6
37 changed files with 1022 additions and 176 deletions

23
sdf/helper/fs.py Normal file
View 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