forked from dlubal-software/RFEM_Python_Client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_StandardSurface_Test.py
102 lines (82 loc) · 3.02 KB
/
test_StandardSurface_Test.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
PROJECT_ROOT = os.path.abspath(os.path.join(
os.path.dirname(__file__),
os.pardir)
)
sys.path.append(PROJECT_ROOT)
# Import the relevant Libraries
from RFEM.enums import SurfaceGeometry
from RFEM.initModel import Model
from RFEM.BasicObjects.material import Material
from RFEM.BasicObjects.thickness import Thickness
from RFEM.BasicObjects.node import Node
from RFEM.BasicObjects.line import Line
from RFEM.BasicObjects.surface import Surface
if Model.clientModel is None:
Model()
def test_standard_surface():
Model.clientModel.service.delete_all()
Model.clientModel.service.begin_modification()
# Testing the standard surface function
Node(1, 0, -30, 0), Node(2, 10, -30, 0), Node(3, 10, -20, 0), Node(4, 0, -20, 0)
Line(1, '1 2'), Line(2, '2 3'), Line(3, '3 4'), Line(4, '4 1')
Material(name='C30/37')
Thickness()
Surface()
# Standard planar Surface
Node(5, 0, -15, 0), Node(6, 10, -15, 0), Node(7, 10, -5, 0), Node(8, 0, -5, 0)
Line(5, '5 6'), Line(6, '6 7'), Line(7, '7 8'), Line(8, '8 5')
Surface.Standard(2, SurfaceGeometry.GEOMETRY_PLANE, boundary_lines_no= '5 6 7 8')
# Standard NURBS Surface
# Define Nodes
Node(9, 0.0, 0.0, 0.0)
Node(10, 5.0, 0.0, -2.5)
Node(11, 10.0, 0.0, 0.0)
Node(12, 0.0, 10.0, 0.0)
Node(13, 5.0, 10.0, -2.5)
Node(14, 10.0, 10.0, 0.0)
Node(15, 0.0, 5.0, -2.5)
Node(16, 10.0, 5.0, -2.5)
# NURBS-Curve Definition
Line.NURBS(9, '9 10 11')
Line.NURBS(10, '12 13 14')
Line.NURBS(11, '9 15 12')
Line.NURBS(12, '11 16 14')
# Surfaces Definition
Surface.Standard(3, SurfaceGeometry.GEOMETRY_NURBS, [3,3,3,3], '9 10 11 12')
# Standard Quadrangle
# Define Nodes
Node(17, 0, 15, 0)
Node(18, 10, 15, 0)
Node(19, 0, 20, 0)
Node(20, 10, 20, 0)
# Boundary Lines
Line.Arc(13, [17, 18], [5, 15, -2])
Line.Arc(14, [19, 20], [5, 20, -2])
Line(15, '17 19')
Line(16, '18 20')
# Quadrangle Defintion
Surface.Standard(4, SurfaceGeometry.GEOMETRY_QUADRANGLE, [17, 18, 19, 20], '13 14 15 16')
Model.clientModel.service.finish_modification()
# Testing the standard surface function
sur = Model.clientModel.service.get_surface(1)
assert sur.geometry == 'GEOMETRY_PLANE'
assert sur.type == 'TYPE_STANDARD'
assert sur.boundary_lines == '1 2 3 4'
# Standard planar Surface
sur = Model.clientModel.service.get_surface(2)
assert sur.geometry == 'GEOMETRY_PLANE'
assert sur.type == 'TYPE_STANDARD'
assert sur.boundary_lines == '5 6 7 8'
# Standard NURBS Surface
sur = Model.clientModel.service.get_surface(3)
assert sur.geometry == 'GEOMETRY_NURBS'
assert sur.nurbs_control_point_count_in_direction_u == 3
assert sur.nurbs_order_in_direction_v == 3
# Quadrangle Defintion
sur = Model.clientModel.service.get_surface(4)
assert sur.geometry == 'GEOMETRY_QUADRANGLE'
assert sur.quadrangle_corner_nodes == '17 18 19 20'