Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
unite tests: 125 passed, 9 skipped in 163.23s
  • Loading branch information
MichalO committed Apr 6, 2022
1 parent a017acd commit b153ea9
Show file tree
Hide file tree
Showing 87 changed files with 1,131 additions and 1,064 deletions.
9 changes: 6 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"files.trimTrailingWhitespace": true,
"editor.tabSize": 4,
"editor.insertSpaces": true,
"python.linting.pylintEnabled": true,
"python.linting.pylintEnabled": false,
"python.linting.pylintArgs": [],
"python.linting.enabled": false,
"python.linting.pydocstyleEnabled": false,
Expand All @@ -19,9 +19,12 @@
"comments": false,
"strings": false
},
"editor.formatOnSave": true,
"python.analysis.completeFunctionParens": true,
"python.disableInstallationCheck": true,
"python.linting.banditEnabled": true,
"python.languageServer": "Pylance"
"python.languageServer": "Pylance",
"python.analysis.diagnosticSeverityOverrides": {
"reportOptionalMemberAccess": "none",
"reportGeneralTypeIssues": "none",
}
}
3 changes: 2 additions & 1 deletion Examples/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
)
sys.path.append(PROJECT_ROOT)
from RFEM.enums import NodalSupportType, StaticAnalysisType, LoadDirectionType, MemberLoadDistribution, MemberLoadDirection, MemberRotationSpecificationType
from RFEM.window import window
from Examples.window import window
from RFEM.dataTypes import inf
from RFEM.initModel import Model, Calculate_all, insertSpaces, modelLst
from RFEM.BasicObjects.material import Material
Expand Down Expand Up @@ -287,6 +287,7 @@ def main(hall_width_L, hall_height_h_o, hall_height_h_m, number_frames, frame_sp
# -------------------------------------------------------------
# Calculate all
Calculate_all()

print("Done")

if __name__ == '__main__':
Expand Down
18 changes: 9 additions & 9 deletions RFEM/BasicObjects/bracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# start_section_no: int = 1,
# end_section_no: int = 1,
# comment: str = '',
# params: dict = None):
# params: dict = None, model = Model):

# '''
# Args:
Expand All @@ -27,7 +27,7 @@
# '''

# # Client model | Bracing
# clientObject = Model.clientModel.factory.create('ns0:bracing')
# clientObject = model.clientModel.factory.create('ns0:bracing')

# # Clears object atributes | Sets all atributes to None
# clearAtributes(clientObject)
Expand Down Expand Up @@ -67,7 +67,7 @@
# clientObject[key] = params[key]

# # Add Member to client model
# Model.clientModel.service.set_bracing(clientObject)
# model.clientModel.service.set_bracing(clientObject)

# def Horizontal(self,
# no: int = 1,
Expand All @@ -80,7 +80,7 @@
# start_bracing_hinge_no: int = 0,
# end_bracing_hinge_no: int = 0,
# comment: str = '',
# params: dict = None):
# params: dict = None, model = Model):

# '''
# Args:
Expand All @@ -98,7 +98,7 @@
# '''

# # Client model | Bracing
# clientObject = Model.clientModel.factory.create('ns0:bracing')
# clientObject = model.clientModel.factory.create('ns0:bracing')

# # Clears object atributes | Sets all atributes to None
# clearAtributes(clientObject)
Expand Down Expand Up @@ -138,7 +138,7 @@
# clientObject[key] = params[key]

# # Add Bracing to client model
# Model.clientModel.service.set_bracing(clientObject)
# model.clientModel.service.set_bracing(clientObject)

# def Vertical(self,
# no: int = 1,
Expand All @@ -151,7 +151,7 @@
# start_bracing_hinge_no: int = 0,
# end_bracing_hinge_no: int = 0,
# comment: str = '',
# params: dict = None):
# params: dict = None, model = Model):

# '''
# Args:
Expand All @@ -169,7 +169,7 @@
# '''

# # Client model | Bracing
# clientObject = Model.clientModel.factory.create('ns0:bracing')
# clientObject = model.clientModel.factory.create('ns0:bracing')

# # Clears object atributes | Sets all atributes to None
# clearAtributes(clientObject)
Expand Down Expand Up @@ -209,5 +209,5 @@
# clientObject[key] = params[key]

# # Add Bracing to client model
# Model.clientModel.service.set_bracing(clientObject)
# model.clientModel.service.set_bracing(clientObject)

2 changes: 1 addition & 1 deletion RFEM/BasicObjects/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# insertion_point_y: int = 4,
# insertion_point_z: int = 3,
# comment: str = '',
# params: dict = None):
# params: dict = None, model = Model):

# '''
# Args:
Expand Down
61 changes: 32 additions & 29 deletions RFEM/BasicObjects/line.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ def __init__(self,
no: int = 1,
nodes_no: str = '1 2',
comment: str = '',
params: dict = None):
params: dict = None,
model = Model):

'''
Args:
Expand All @@ -17,7 +18,7 @@ def __init__(self,
'''

# Client model | Line
clientObject = Model.clientModel.factory.create('ns0:line')
clientObject = model.clientModel.factory.create('ns0:line')

# Clears object atributes | Sets all atributes to None
clearAtributes(clientObject)
Expand All @@ -37,14 +38,15 @@ def __init__(self,
clientObject[key] = params[key]

# Add Line to client model
Model.clientModel.service.set_line(clientObject)
model.clientModel.service.set_line(clientObject)

@staticmethod
def Polyline(
no: int = 1,
nodes_no: str = '1 2',
comment: str = '',
params: dict = None):
params: dict = None,
model = Model):

'''
Args:
Expand All @@ -55,7 +57,7 @@ def Polyline(
'''

# Client model | Line
clientObject = Model.clientModel.factory.create('ns0:line')
clientObject = model.clientModel.factory.create('ns0:line')

# Clears object atributes | Sets all atributes to None
clearAtributes(clientObject)
Expand All @@ -78,7 +80,7 @@ def Polyline(
clientObject[key] = params[key]

# Add Line to client model
Model.clientModel.service.set_line(clientObject)
model.clientModel.service.set_line(clientObject)

@staticmethod
def Arc(
Expand All @@ -87,7 +89,8 @@ def Arc(
control_point: list,
alpha_adjustment_target = LineArcAlphaAdjustmentTarget.ALPHA_ADJUSTMENT_TARGET_BEGINNING_OF_ARC,
comment: str = '',
params: dict = None):
params: dict = None,
model = Model):

'''
Args:
Expand All @@ -100,7 +103,7 @@ def Arc(
'''

# Client model | Line
clientObject = Model.clientModel.factory.create('ns0:line')
clientObject = model.clientModel.factory.create('ns0:line')

# Clears object atributes | Sets all atributes to None
clearAtributes(clientObject)
Expand Down Expand Up @@ -129,7 +132,7 @@ def Arc(
clientObject[key] = params[key]

# Add Line to client model
Model.clientModel.service.set_line(clientObject)
model.clientModel.service.set_line(clientObject)

@staticmethod
def Circle(
Expand All @@ -138,7 +141,7 @@ def Circle(
circle_radius: float = 1.0,
point_of_normal_to_circle_plane: list = [1,0,0],
comment: str = '',
params: dict = None):
params: dict = None, model = Model):

'''
Args:
Expand All @@ -152,7 +155,7 @@ def Circle(
'''

# Client model | Line
clientObject = Model.clientModel.factory.create('ns0:line')
clientObject = model.clientModel.factory.create('ns0:line')

# Clears object atributes | Sets all atributes to None
clearAtributes(clientObject)
Expand Down Expand Up @@ -184,7 +187,7 @@ def Circle(
clientObject[key] = params[key]

# Add Line to client model
Model.clientModel.service.set_line(clientObject)
model.clientModel.service.set_line(clientObject)

@staticmethod
def EllipticalArc(
Expand All @@ -195,7 +198,7 @@ def EllipticalArc(
arc_angle_alpha: float = 0,
arc_angle_beta: float = 3.141592653589793,
comment: str = '',
params: dict = None):
params: dict = None, model = Model):

'''
Args:
Expand All @@ -210,7 +213,7 @@ def EllipticalArc(
'''

# Client model | Line
clientObject = Model.clientModel.factory.create('ns0:line')
clientObject = model.clientModel.factory.create('ns0:line')

# Clears object atributes | Sets all atributes to None
clearAtributes(clientObject)
Expand Down Expand Up @@ -246,15 +249,15 @@ def EllipticalArc(
clientObject[key] = params[key]

# Add Line to client model
Model.clientModel.service.set_line(clientObject)
model.clientModel.service.set_line(clientObject)

@staticmethod
def Ellipse(
no: int = 1,
nodes_no: list = [5,10],
ellipse_control_point: list = [18,-4.8,0],
comment: str = '',
params: dict = None):
params: dict = None, model = Model):

'''
Args:
Expand All @@ -266,7 +269,7 @@ def Ellipse(
'''

# Client model | Line
clientObject = Model.clientModel.factory.create('ns0:line')
clientObject = model.clientModel.factory.create('ns0:line')

# Clears object atributes | Sets all atributes to None
clearAtributes(clientObject)
Expand Down Expand Up @@ -296,7 +299,7 @@ def Ellipse(
clientObject[key] = params[key]

# Add Line to client model
Model.clientModel.service.set_line(clientObject)
model.clientModel.service.set_line(clientObject)

@staticmethod
def Parabola(
Expand All @@ -305,7 +308,7 @@ def Parabola(
parabola_control_point: list = [10,-3,0],
parabola_alpha: float = 0,
comment: str = '',
params: dict = None):
params: dict = None, model = Model):

'''
Args:
Expand All @@ -318,7 +321,7 @@ def Parabola(
'''

# Client model | Line
clientObject = Model.clientModel.factory.create('ns0:line')
clientObject = model.clientModel.factory.create('ns0:line')

# Clears object atributes | Sets all atributes to None
clearAtributes(clientObject)
Expand Down Expand Up @@ -350,14 +353,14 @@ def Parabola(
clientObject[key] = params[key]

# Add Line to client model
Model.clientModel.service.set_line(clientObject)
model.clientModel.service.set_line(clientObject)

@staticmethod
def Spline(
no: int = 1,
nodes_no: str = '1 3 5',
comment: str = '',
params: dict = None):
params: dict = None, model = Model):

'''
Args:
Expand All @@ -368,7 +371,7 @@ def Spline(
'''

# Client model | Line
clientObject = Model.clientModel.factory.create('ns0:line')
clientObject = model.clientModel.factory.create('ns0:line')

# Clears object atributes | Sets all atributes to None
clearAtributes(clientObject)
Expand All @@ -391,7 +394,7 @@ def Spline(
clientObject[key] = params[key]

# Add Line to client model
Model.clientModel.service.set_line(clientObject)
model.clientModel.service.set_line(clientObject)

@staticmethod
def NURBS(
Expand All @@ -401,7 +404,7 @@ def NURBS(
weights: list = None,
order: int = 0,
comment: str = '',
params: dict = None):
params: dict = None, model = Model):

'''
Args:
Expand All @@ -415,7 +418,7 @@ def NURBS(
'''

# Client model | Line
clientObject = Model.clientModel.factory.create('ns0:line')
clientObject = model.clientModel.factory.create('ns0:line')

# Clears object atributes | Sets all atributes to None
clearAtributes(clientObject)
Expand All @@ -438,14 +441,14 @@ def NURBS(
# TODO: bug 24721
nurbs_control_points = []
for i,j in enumerate(control_points):
point = Model.clientModel.factory.create('ns0:line_nurbs_control_points_by_components')
point = model.clientModel.factory.create('ns0:line_nurbs_control_points_by_components')
point.no = i+1
point.global_coordinate_x = control_points[i][0]
point.global_coordinate_y = control_points[i][1]
point.global_coordinate_z = control_points[i][2]
point.weight = 1 if not weights else weights[i]
nurbs_control_points.append(point)
clientObject.nurbs_control_points_by_components = Model.clientModel.factory.create('ns0:line_nurbs_control_points_by_components')
clientObject.nurbs_control_points_by_components = model.clientModel.factory.create('ns0:line_nurbs_control_points_by_components')

# Comment
clientObject.comment = comment
Expand All @@ -456,4 +459,4 @@ def NURBS(
clientObject[key] = params[key]

# Add Line to client model
Model.clientModel.service.set_line(clientObject)
model.clientModel.service.set_line(clientObject)
Loading

0 comments on commit b153ea9

Please sign in to comment.