This repository has been archived by the owner on Mar 4, 2023. It is now read-only.
/
ViewCut.py
273 lines (243 loc) · 12.9 KB
/
ViewCut.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
import typing
from abaqusConstants import *
class ViewCut:
"""The ViewCut object is used to store values and attributes associate with ViewCut type
objects. ViewCut objects can be created using the methods described below. The methods
accessed via the OdbDisplay object cause the ViewCut object to be added to the
session.viewports[name].odbDisplay.viewCuts repository.
Attributes
----------
angle: float
A Float specifying the rotation angle of the cut defined with a **shape** set to PLANE.
motion: SymbolicConstant
A SymbolicConstant specifying the type of motion for the cut defined with a **shape** set
to PLANE. Possible values are TRANSLATE and ROTATE. The default value is TRANSLATE.
position: float
A Float specifying the position of the cut defined with a **shape** set to PLANE.
radius: float
A Float specifying the radius of the cut defined with a **shape** set to CYLINDER or
SPHERE.
rotationAxis: SymbolicConstant
A SymbolicConstant specifying the rotation axis for the cut defined with a **shape** set
to PLANE. Possible values are AXIS_1, AXIS_2, and AXIS_3. The default value is AXIS_2.
value: float
A Float specifying the value of the cut defined with a **shape** set to ISOSURFACE.
showModelAboveCut: Boolean
A Boolean specifying whether to display the model above the cut. The default value is
OFF.
showModelOnCut: Boolean
A Boolean specifying whether to display the model on the cut. The default value is ON.
showModelBelowCut: Boolean
A Boolean specifying whether to display the model below the cut. The default value is
ON.
showFreeBodyCut: Boolean
A Boolean specifying whether to display the free body cut. The default value is OFF.
active: Boolean
A Boolean specifying whether the cut is displayed.
cutRange: tuple[float]
A pair of Floats specifying the acceptable range for positioning the cut.
crossSectionalArea: float
A Float returning the cross-sectional area of the cut when **showFreeBodyCut** is set to
ON.
Notes
-----
This object can be accessed by:
.. code-block:: python
import visualization
session.viewports[name].layers[name].odbDisplay.viewCuts[name]
session.viewports[name].odbDisplay.viewCuts[name]
"""
# A Float specifying the rotation angle of the cut defined with a *shape* set to PLANE.
angle: float = None
# A SymbolicConstant specifying the type of motion for the cut defined with a *shape* set
# to PLANE. Possible values are TRANSLATE and ROTATE. The default value is TRANSLATE.
motion: SymbolicConstant = TRANSLATE
# A Float specifying the position of the cut defined with a *shape* set to PLANE.
position: float = None
# A Float specifying the radius of the cut defined with a *shape* set to CYLINDER or
# SPHERE.
radius: float = None
# A SymbolicConstant specifying the rotation axis for the cut defined with a *shape* set
# to PLANE. Possible values are AXIS_1, AXIS_2, and AXIS_3. The default value is AXIS_2.
rotationAxis: SymbolicConstant = AXIS_2
# A Float specifying the value of the cut defined with a *shape* set to ISOSURFACE.
value: float = None
# A Boolean specifying whether to display the model above the cut. The default value is
# OFF.
showModelAboveCut: Boolean = OFF
# A Boolean specifying whether to display the model on the cut. The default value is ON.
showModelOnCut: Boolean = ON
# A Boolean specifying whether to display the model below the cut. The default value is
# ON.
showModelBelowCut: Boolean = ON
# A Boolean specifying whether to display the free body cut. The default value is OFF.
showFreeBodyCut: Boolean = OFF
# A Boolean specifying whether the cut is displayed.
active: Boolean = OFF
# A pair of Floats specifying the acceptable range for positioning the cut.
cutRange: tuple[float] = ()
# A Float returning the cross-sectional area of the cut when *showFreeBodyCut* is set to
# ON.
crossSectionalArea: float = None
def __init__(
self,
name: str,
shape: SymbolicConstant,
origin: tuple,
normal: typing.Union[SymbolicConstant, float],
axis2: typing.Union[SymbolicConstant, float],
csysName: str,
cylinderAxis: typing.Union[SymbolicConstant, float],
followDeformation: Boolean = OFF,
overrideAveraging: Boolean = ON,
referenceFrame: SymbolicConstant = FIRST_FRAME,
):
"""This method creates a ViewCut object.
Notes
-----
This function can be accessed by:
.. code-block:: python
session.viewports[name].layers[name].odbDisplay.ViewCut
session.viewports[name].odbDisplay.ViewCut
Parameters
----------
name
A String specifying the repository key.
shape
A SymbolicConstant specifying the shape of the ViewCut object. Possible values are
PLANE, CYLINDER, SPHERE, and ISOSURFACE.
origin
A sequence of three Floats specifying the X-, Y-, and Z-coordinates of the origin of the
plane, cylinder or sphere cut. This origin is not required if the cut shape is
ISOSURFACE or if the cut is defined by the *csysName* argument.
normal
A sequence of Floats specifying the X-, Y-, and Z-coordinates of the normal axis to the
plane defining the cut, when the plane is defined using the *origin* argument or a
SymbolicConstant defining this normal axis, when the cut is defined by the *csysName*
argument. Possible values are AXIS_1, AXIS_2, AXIS_3. This axis is not required if the
cut *shape* is CYLINDER, SPHERE or ISOSURFACE.
axis2
A sequence of three Floats specifying the X-, Y-, and Z-coordinates of the second axis
of the plane defining the cut, when the plane is defined using the *origin* argument or
a SymbolicConstant defining this second axis, when the cut is defined by the *csysName*
argument. Possible values are AXIS_1, AXIS_2, AXIS_3. This axis is used to rotate the
plane cut. It is not required if the cut *shape* is CYLINDER, SPHERE or ISOSURFACE.
csysName
A String specifying the name of the DatumCsys object to be used to define the cut. This
name is not required if the cut *shape* is ISOSURFACE or if the cut is defined by the
*origin* argument.
cylinderAxis
A sequence of Floats specifying the X-, Y-, and Z-coordinates of the cylinder axis
defining the cut, when the cut is defined using the *origin* argument or a
SymbolicConstant defining this cylinder axis, when the cut is defined by the *csysName*
argument. Possible values are AXIS_1, AXIS_2, AXIS_3. This axis is not required if the
cut *shape* is PLANE, SPHERE, or ISOSURFACE.
followDeformation
A Boolean specifying whether the cut will follow the deformation or be static. The
default value is OFF.
overrideAveraging
A Boolean specifying averaging for element based fields associated with isosurface cuts
will be set to compute-average with a threshold of 100% when true. The current field
options will be used when false. The default value is ON.
referenceFrame
A SymbolicConstant specifying which reference frame will be used when the cut follows
the deformation. Possible values are FIRST_FRAME, LAST_FRAME, and CURRENT_FRAME. The
default value is FIRST_FRAME.
Returns
-------
A ViewCut object.
"""
pass
def setValues(
self,
angle: float = None,
motion: SymbolicConstant = TRANSLATE,
position: float = None,
radius: float = None,
rotationAxis: SymbolicConstant = AXIS_2,
value: float = None,
showModelAboveCut: Boolean = OFF,
showModelOnCut: Boolean = ON,
showModelBelowCut: Boolean = ON,
showFreeBodyCut: Boolean = OFF,
csysName: str = "",
origin: tuple = (),
normal: typing.Union[SymbolicConstant, float] = AXIS_1,
axis2: typing.Union[SymbolicConstant, float] = AXIS_2,
cylinderAxis: typing.Union[SymbolicConstant, float] = AXIS_3,
followDeformation: Boolean = OFF,
overrideAveraging: Boolean = ON,
referenceFrame: SymbolicConstant = FIRST_FRAME,
):
"""This method modifies the ViewCut object.
Parameters
----------
angle
A Float specifying the rotation angle of the cut defined with a *shape* set to PLANE.
motion
A SymbolicConstant specifying the type of motion for the cut defined with a *shape* set
to PLANE. Possible values are TRANSLATE and ROTATE. The default value is TRANSLATE.
position
A Float specifying the position of the cut defined with a *shape* set to PLANE.
radius
A Float specifying the radius of the cut defined with a *shape* set to CYLINDER or
SPHERE.
rotationAxis
A SymbolicConstant specifying the rotation axis for the cut defined with a *shape* set
to PLANE. Possible values are AXIS_1, AXIS_2, and AXIS_3. The default value is AXIS_2.
value
A Float specifying the value of the cut defined with a *shape* set to ISOSURFACE.
showModelAboveCut
A Boolean specifying whether to display the model above the cut. The default value is
OFF.
showModelOnCut
A Boolean specifying whether to display the model on the cut. The default value is ON.
showModelBelowCut
A Boolean specifying whether to display the model below the cut. The default value is
ON.
showFreeBodyCut
A Boolean specifying whether to display the free body cut. The default value is OFF.
csysName
A String specifying the name of the DatumCsys object to be used to define the cut. This
name is not required if the cut *shape* is ISOSURFACE or if the cut is defined by the
*origin* argument.
origin
A sequence of three Floats specifying the X-, Y-, and Z-coordinates of the origin of the
plane, cylinder or sphere cut. This origin is not required if the cut shape is
ISOSURFACE or if the cut is defined by the *csysName* argument.
normal
A sequence of Floats specifying the X-, Y-, and Z-coordinates of the normal axis to the
plane defining the cut, when the plane is defined using the *origin* argument or a
SymbolicConstant defining this normal axis, when the cut is defined by the *csysName*
argument. Possible values are AXIS_1, AXIS_2, AXIS_3. This axis is not required if the
cut *shape* is CYLINDER, SPHERE or ISOSURFACE.
axis2
A sequence of three Floats specifying the X-, Y-, and Z-coordinates of the second axis
of the plane defining the cut, when the plane is defined using the *origin* argument or
a SymbolicConstant defining this second axis, when the cut is defined by the *csysName*
argument. Possible values are AXIS_1, AXIS_2, AXIS_3. This axis is used to rotate the
plane cut. It is not required if the cut *shape* is CYLINDER, SPHERE or ISOSURFACE.
cylinderAxis
A sequence of Floats specifying the X-, Y-, and Z-coordinates of the cylinder axis
defining the cut, when the cut is defined using the *origin* argument or a
SymbolicConstant defining this cylinder axis, when the cut is defined by the *csysName*
argument. Possible values are AXIS_1, AXIS_2, AXIS_3. This axis is not required if the
cut *shape* is PLANE, SPHERE, or ISOSURFACE.
followDeformation
A Boolean specifying whether the cut will follow the deformation or be static. The
default value is OFF.
overrideAveraging
A Boolean specifying averaging for element based fields associated with isosurface cuts
will be set to compute-average with a threshold of 100% when true. The current field
options will be used when false. The default value is ON.
referenceFrame
A SymbolicConstant specifying which reference frame will be used when the cut follows
the deformation. Possible values are FIRST_FRAME, LAST_FRAME, and CURRENT_FRAME. The
default value is FIRST_FRAME.
"""
pass
def updateVariable(self):
"""This method updates the field associated with an isosurface cut to be consistent with
the current primary variable.
"""
pass