forked from cmccomb/TrussMe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathframeWorker.py
39 lines (32 loc) · 1.06 KB
/
frameWorker.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 03 23:20:44 2017
@author: Lukas
"""
from trussme import truss
import Tkinter as tk
import tkFileDialog
import os
import datetime
def import_data():
root = tk.Tk()
root.withdraw()
file_path = tkFileDialog.askopenfilename()
return file_path
if __name__ == "__main__":
file_path = import_data()
# Build truss from file
t = truss.Truss(file_path)
t.set_goal(min_fos_buckling=1.5,
min_fos_yielding=1.5,
max_mass=5.0,
max_deflection=6e-3)
# Save report
# A C H T U N G: Derzeit wird OHNE Report nichts berechnet,
# entsprechend stimmt auch der Plot nicht
timestamp = '{:%Y-%m-%d_%H-%M-%S}'.format(datetime.datetime.now())
base_name = os.path.splitext(os.path.basename(file_path))[0]
t.print_and_save_report(os.path.join(os.path.dirname(__file__),
'report_'+base_name+'_'+timestamp+'.txt'))
# Plot truss
t.plot(mlbl=True, jlbl=True, ldlbl=True, legend=True)