Skip to content

Commit 5428924

Browse files
Update coordinateSystem.py
1 parent ae91013 commit 5428924

File tree

4 files changed

+39
-26
lines changed

4 files changed

+39
-26
lines changed
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
class CoordinateSystem():
55
def __init__(self,
66
no: int = 1,
7-
type = CoordinateSystemType.TYPE_OFFSET_XYZ,
87
origin_coordinate_x: float = 0.0,
98
origin_coordinate_y: float = 0.0,
109
origin_coordinate_z: float = 0.0,
@@ -16,7 +15,6 @@ def __init__(self,
1615
'''
1716
Args:
1817
no (int): Coordinate System Tag
19-
type (enum): Coordinate System Type
2018
origin_coordinate_x (float): X-Coordinate
2119
origin_coordinate_y (float): Y-Coordinate
2220
origin_coordinate_z (float): Z-Coordinate
@@ -35,7 +33,7 @@ def __init__(self,
3533
clientObject.no = no
3634

3735
# Coordinate System Type
38-
clientObject.type = type.name
36+
clientObject.type = CoordinateSystemType.TYPE_OFFSET_XYZ.name
3937

4038
# Coordinates
4139
clientObject.origin_coordinate_x = origin_coordinate_x

RFEM/Tools/GetObjectNumbersByType.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def __new__(cls,
6161
# For each of these steps individual record is made (4 total).
6262

6363
# Vector of all function
64-
func_vec = [[ObjectTypes.E_OBJECT_TYPE_COORDINATE_SYSTEM, lambda i: model.clientModel.service.get_coordinate_system(i), 'from RFEM.BasicObjects.coordinateSystem import CoordinateSystem\n', 'CoordinateSystem'],
64+
func_vec = [[ObjectTypes.E_OBJECT_TYPE_COORDINATE_SYSTEM, lambda i: model.clientModel.service.get_coordinate_system(i), 'from RFEM.GuideObjects.coordinateSystem import CoordinateSystem\n', 'CoordinateSystem'],
6565
[ObjectTypes.E_OBJECT_TYPE_MATERIAL, lambda i: model.clientModel.service.get_material(i), 'from RFEM.BasicObjects.material import Material\n', 'Material'],
6666
[ObjectTypes.E_OBJECT_TYPE_SECTION, lambda i: model.clientModel.service.get_section(i), 'from RFEM.BasicObjects.section import Section\n', 'Section'],
6767
[ObjectTypes.E_OBJECT_TYPE_THICKNESS, lambda i: model.clientModel.service.get_thickness(i), 'from RFEM.BasicObjects.thickness import Thickness\n', 'Thickness'],

UnitTests/test_basic_objects.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from RFEM.BasicObjects.memberSet import MemberSet
2121
from RFEM.BasicObjects.solid import Solid
2222
from RFEM.BasicObjects.solidSet import SolidSet
23-
from RFEM.BasicObjects.coordinateSystem import CoordinateSystem
2423

2524
if Model.clientModel is None:
2625
Model()
@@ -947,24 +946,3 @@ def test_get_thickness():
947946

948947
assert thickness['type'] == "TYPE_UNIFORM"
949948
assert thickness['uniform_thickness'] == 0.02
950-
951-
def test_coordinate_system():
952-
953-
Model.clientModel.service.delete_all()
954-
Model.clientModel.service.begin_modification()
955-
956-
Material(1, 'S235')
957-
958-
Node(1, 0, 0, 0)
959-
960-
CoordinateSystem()
961-
CoordinateSystem.OffsetXYZ(2)
962-
CoordinateSystem.ThreePoints(3)
963-
CoordinateSystem.TwoPointsAndAngle(4)
964-
CoordinateSystem.PointAndThreeAngles(5)
965-
966-
Model.clientModel.service.finish_modification()
967-
968-
coord = Model.clientModel.service.get_coordinate_system(2)
969-
970-
assert coord.type == 'TYPE_OFFSET_XYZ'
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from RFEM.BasicObjects.member import Member
1717
from RFEM.BasicObjects.surface import Surface
1818
from RFEM.GuideObjects.note import Note
19+
from RFEM.GuideObjects.coordinateSystem import CoordinateSystem
1920

2021
if Model.clientModel is None:
2122
Model()
@@ -69,3 +70,39 @@ def test_note():
6970
note5 = Model.clientModel.service.get_note(5)
7071
assert note5.surface_first_coordinate == 5
7172
assert note5.offset_coordinate_y == 2
73+
74+
def test_coordinate_system():
75+
76+
Model.clientModel.service.delete_all()
77+
Model.clientModel.service.begin_modification()
78+
79+
Material(1, 'S235')
80+
81+
Node(1, 0, 0, 0)
82+
83+
CoordinateSystem()
84+
CoordinateSystem.OffsetXYZ(2, 1, 0, 0)
85+
CoordinateSystem.ThreePoints(3, 2, 0, 0, 0, 1, 0, 0, 0, 3)
86+
CoordinateSystem.TwoPointsAndAngle(4, 1.5, 0, 0, 0, 0, 0, 5.5)
87+
CoordinateSystem.PointAndThreeAngles(5)
88+
89+
Model.clientModel.service.finish_modification()
90+
91+
coord2 = Model.clientModel.service.get_coordinate_system(2)
92+
93+
assert coord2.type == 'TYPE_OFFSET_XYZ'
94+
assert coord2.origin_coordinate_x == 1
95+
96+
coord3 = Model.clientModel.service.get_coordinate_system(3)
97+
98+
assert coord3.type == 'TYPE_3_POINTS'
99+
assert coord3.u_axis_point_coordinate_y == 1
100+
101+
coord4 = Model.clientModel.service.get_coordinate_system(4)
102+
103+
assert coord4.type == 'TYPE_2_POINTS_AND_ANGLE'
104+
assert coord4.origin_coordinate_x == 1.5
105+
106+
coord5 = Model.clientModel.service.get_coordinate_system(5)
107+
108+
assert coord5.type == 'TYPE_POINT_AND_3_ANGLES'

0 commit comments

Comments
 (0)