midas-civil 0.1.8__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of midas-civil might be problematic. Click here for more details.

Files changed (32) hide show
  1. {midas_civil-0.1.8 → midas_civil-0.2.0}/PKG-INFO +1 -1
  2. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil/_construction.py +13 -13
  3. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil/_movingload.py +2 -2
  4. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil/_section.py +121 -0
  5. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil/_tendon.py +6 -0
  6. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil.egg-info/PKG-INFO +1 -1
  7. {midas_civil-0.1.8 → midas_civil-0.2.0}/setup.py +1 -1
  8. {midas_civil-0.1.8 → midas_civil-0.2.0}/LICENSE +0 -0
  9. {midas_civil-0.1.8 → midas_civil-0.2.0}/README.md +0 -0
  10. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil/__init__.py +0 -0
  11. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil/_boundary.py +0 -0
  12. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil/_construction_backup.py +0 -0
  13. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil/_element.py +0 -0
  14. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil/_group.py +0 -0
  15. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil/_load.py +0 -0
  16. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil/_mapi.py +0 -0
  17. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil/_material.py +0 -0
  18. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil/_model.py +0 -0
  19. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil/_node.py +0 -0
  20. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil/_result copy.py +0 -0
  21. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil/_result.py +0 -0
  22. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil/_result_extract.py +0 -0
  23. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil/_settlement.py +0 -0
  24. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil/_temperature.py +0 -0
  25. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil/_thickness.py +0 -0
  26. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil/_utils.py +0 -0
  27. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil/_view.py +0 -0
  28. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil.egg-info/SOURCES.txt +0 -0
  29. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil.egg-info/dependency_links.txt +0 -0
  30. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil.egg-info/requires.txt +0 -0
  31. {midas_civil-0.1.8 → midas_civil-0.2.0}/midas_civil.egg-info/top_level.txt +0 -0
  32. {midas_civil-0.1.8 → midas_civil-0.2.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: midas_civil
3
- Version: 0.1.8
3
+ Version: 0.2.0
4
4
  Summary: Python library for MIDAS Civil NX
5
5
  Author: Sumit Shekhar
6
6
  Author-email: sumit.midasit@gmail.com
@@ -659,7 +659,7 @@ class CS:
659
659
 
660
660
  #-----------------------------------------------------------------------------------------------------------------------------------
661
661
 
662
- class TimeLoads:
662
+ class TimeLoad:
663
663
  timeloads = []
664
664
 
665
665
  def __init__(self,
@@ -678,7 +678,7 @@ class CS:
678
678
 
679
679
  Examples:
680
680
  ```python
681
- CS.TimeLoads(10, 35, "DL")
681
+ CS.TimeLoad(10, 35, "DL")
682
682
  ```
683
683
  """
684
684
 
@@ -688,11 +688,11 @@ class CS:
688
688
 
689
689
  # Set ID
690
690
  if id is None:
691
- self.ID = len(CS.TimeLoads.timeloads) + 1
691
+ self.ID = len(CS.TimeLoad.timeloads) + 1
692
692
  else:
693
693
  self.ID = id
694
694
 
695
- CS.TimeLoads.timeloads.append(self)
695
+ CS.TimeLoad.timeloads.append(self)
696
696
 
697
697
  @classmethod
698
698
  def json(cls):
@@ -700,7 +700,7 @@ class CS:
700
700
  Converts Time Loads data to JSON format
701
701
  Example:
702
702
  # Get the JSON data for all time loads
703
- json_data = CS.TimeLoads.json()
703
+ json_data = CS.TimeLoad.json()
704
704
  print(json_data)
705
705
  """
706
706
  json_data = {"Assign": {}}
@@ -722,17 +722,17 @@ class CS:
722
722
 
723
723
  @classmethod
724
724
  def create(cls):
725
- """Creates time loads in the database"""
725
+ """Creates time loads in the CIVIL NX"""
726
726
  return MidasAPI("PUT", "/db/tmld", cls.json())
727
727
 
728
728
  @classmethod
729
729
  def get(cls):
730
- """Gets time loads data from the database"""
730
+ """Gets time loads data from the CIVIL NX"""
731
731
  return MidasAPI("GET", "/db/tmld")
732
732
 
733
733
  @classmethod
734
734
  def sync(cls):
735
- """Updates the TimeLoads class with data from the database"""
735
+ """Updates the TimeLoad class with data from the CIVIL NX"""
736
736
  cls.timeloads = []
737
737
  response = cls.get()
738
738
 
@@ -750,8 +750,8 @@ class CS:
750
750
  day = item.get("DAY", 0)
751
751
  item_id = item.get("ID", 1)
752
752
 
753
- # Create a new TimeLoads object
754
- new_timeload = CS.TimeLoads(
753
+ # Create a new TimeLoad object
754
+ new_timeload = CS.TimeLoad(
755
755
  element_id=int(element_id),
756
756
  day=day,
757
757
  group=group_name,
@@ -759,12 +759,12 @@ class CS:
759
759
  )
760
760
 
761
761
  # Remove the automatically added instance and replace with synced data
762
- CS.TimeLoads.timeloads.pop()
763
- CS.TimeLoads.timeloads.append(new_timeload)
762
+ CS.TimeLoad.timeloads.pop()
763
+ CS.TimeLoad.timeloads.append(new_timeload)
764
764
 
765
765
  @classmethod
766
766
  def delete(cls):
767
- """Deletes all time loads from the database and resets the class"""
767
+ """Deletes all time loads from the CIVIL NX and python class"""
768
768
  cls.timeloads = []
769
769
  return MidasAPI("DELETE", "/db/tmld")
770
770
 
@@ -4,7 +4,7 @@ from ._model import *
4
4
 
5
5
  # ----------------------------------------------------------------------------------------------------------------
6
6
 
7
- def El_list(Start_id: int, End_id: int) -> list:
7
+ def _El_list(Start_id: int, End_id: int) -> list:
8
8
 
9
9
  return list(range(Start_id, End_id + 1))
10
10
 
@@ -330,7 +330,7 @@ class MovingLoad:
330
330
 
331
331
  data = {"Assign": {}}
332
332
  for lane in lanes_list:
333
- E_list = El_list(lane.Elment_start, lane.Elemnt_end)
333
+ E_list = _El_list(lane.Elment_start, lane.Elemnt_end)
334
334
  Load_Dist = "CROSS" if lane.Group_Name else "LANE"
335
335
  opt_auto_lane = lane.width > 0 or lane.opt_width > 0
336
336
 
@@ -1,4 +1,20 @@
1
1
  from ._mapi import *
2
+ import numpy as np
3
+
4
+
5
+ def _poly_dir(poly,rot='CCW'):
6
+ outer_cg = np.mean(poly,axis=0)
7
+ outer_t = np.subtract(poly,outer_cg)
8
+ dir = 0
9
+ for i in range(len(poly)-1):
10
+ dir+=outer_t[i][0]*outer_t[i+1][1]-outer_t[i][1]*outer_t[i+1][0]
11
+ if dir < 0:
12
+ poly.reverse()
13
+
14
+ if rot == 'CW':
15
+ poly.reverse()
16
+
17
+ return poly
2
18
 
3
19
 
4
20
 
@@ -104,6 +120,66 @@ def _Obj2JS(sect):
104
120
  "JOINT": [sect.J1,sect.JL1,sect.JL2,sect.JL3,sect.JL4,sect.JR1,sect.JR2,sect.JR3,sect.JR4]
105
121
  }
106
122
  }
123
+ elif sect.SHAPE in ['VALUE']:
124
+ js = {
125
+ "SECTTYPE": "PSC",
126
+ "SECT_NAME": sect.NAME,
127
+ "CALC_OPT": True,
128
+ "SECT_BEFORE": {
129
+ "SHAPE": "VALU",
130
+ "SECT_I": {
131
+ "SECT_NAME": "",
132
+ "vSIZE": [0.1, 0.1, 0.1, 0.1],
133
+ "OUTER_POLYGON": [
134
+ {
135
+ "VERTEX": [
136
+ {"X": 5, "Y": 5},
137
+ {"X": -5, "Y": 5}
138
+ ]
139
+ }
140
+ ]
141
+ },
142
+ "SHEAR_CHK": True,
143
+ "SHEAR_CHK_POS": [[0.1, 0, 0.1], [0, 0, 0]],
144
+ "USE_AUTO_QY": [[True, True, True], [False, False, False]],
145
+ "WEB_THICK": [0, 0],
146
+ "USE_WEB_THICK_SHEAR": [[True, True, True], [False, False, False]]
147
+ }
148
+ }
149
+
150
+ v_list = []
151
+ for i in sect.OUTER_POLYGON:
152
+ v_list.append({"X":i[0],"Y":i[1]})
153
+ js["SECT_BEFORE"]["SECT_I"]["OUTER_POLYGON"][0]["VERTEX"] =v_list
154
+
155
+
156
+
157
+ if sect.N_INNER_POLYGON > 0 :
158
+
159
+ js["SECT_BEFORE"]["SECT_I"]["INNER_POLYGON"]= []
160
+
161
+ mult_ver = []
162
+ for n in range(sect.N_INNER_POLYGON):
163
+ vi_list = []
164
+
165
+ js["SECT_BEFORE"]["SECT_I"]["INNER_POLYGON"]= [
166
+ {
167
+ "VERTEX": []
168
+ }
169
+ ]
170
+ for i in sect.INNER_POLYGON[n]:
171
+ vi_list.append({"X":i[0],"Y":i[1]})
172
+
173
+ ver_json = {"VERTEX": vi_list}
174
+ mult_ver.append(ver_json)
175
+
176
+ js["SECT_BEFORE"]["SECT_I"]["INNER_POLYGON"] = mult_ver
177
+
178
+
179
+
180
+
181
+
182
+
107
183
 
108
184
  elif sect.TYPE == 'COMPOSITE':
109
185
  if sect.SHAPE in ['CI']:
@@ -573,6 +649,51 @@ class Section:
573
649
 
574
650
  _SectionADD(self)
575
651
 
652
+ class Value(_common):
653
+ def __init__(self,Name:str,
654
+ OuterPolygon:list,InnerPolygon:list=[],
655
+ Offset:Offset=Offset.CC(),useShear=True,use7Dof=False,id:int=0):
656
+
657
+ '''
658
+ Outer Polygon -> List of points ; Last input is different from first
659
+ [(0,0),(1,0),(1,1),(0,1)]
660
+ Inner Polygon -> List of points ; Last input is different from first
661
+ Only one inner polygon
662
+ '''
663
+
664
+ self.ID = id
665
+ self.NAME = Name
666
+ self.SHAPE = 'VALUE'
667
+ self.TYPE = 'PSC'
668
+
669
+ self.OFFSET = Offset
670
+ self.USESHEAR = bool(useShear)
671
+ self.USE7DOF = bool(use7Dof)
672
+
673
+
674
+ self.OUTER_POLYGON = _poly_dir(OuterPolygon)
675
+ self.INNER_POLYGON = []
676
+ self.N_INNER_POLYGON = 0
677
+
678
+ temp_arr = []
679
+
680
+ # Finding no. of internal polygons
681
+ if InnerPolygon != []:
682
+ if not isinstance(InnerPolygon[0][0],(int,float)):
683
+ self.N_INNER_POLYGON = len(InnerPolygon)
684
+ temp_arr = InnerPolygon
685
+
686
+ else:
687
+ temp_arr.append(InnerPolygon) #Convert to list
688
+ self.N_INNER_POLYGON = 1
689
+
690
+ for i in range(len(temp_arr)):
691
+ self.INNER_POLYGON.append(_poly_dir(temp_arr[i],'CW'))
692
+
693
+
694
+ _SectionADD(self)
695
+
696
+
576
697
  class Composite:
577
698
  class PSCI(_common):
578
699
 
@@ -860,6 +860,12 @@ class Tendon:
860
860
  def get(cls):
861
861
  return MidasAPI('GET','/db/TDNA')
862
862
 
863
+ @classmethod
864
+ def delete(cls):
865
+ cls.profiles=[]
866
+ cls.ids=[]
867
+ return MidasAPI('DELETE','/db/TDNA')
868
+
863
869
  @classmethod
864
870
  def sync(cls):
865
871
  a = cls.get()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: midas_civil
3
- Version: 0.1.8
3
+ Version: 0.2.0
4
4
  Summary: Python library for MIDAS Civil NX
5
5
  Author: Sumit Shekhar
6
6
  Author-email: sumit.midasit@gmail.com
@@ -5,7 +5,7 @@ with open('README.md','r') as f:
5
5
 
6
6
 
7
7
  setup(name='midas_civil',
8
- version='0.1.8',
8
+ version='0.2.0',
9
9
  description='Python library for MIDAS Civil NX',
10
10
  author='Sumit Shekhar',
11
11
  author_email='sumit.midasit@gmail.com',
File without changes
File without changes
File without changes