Oasys.D3PLOT.CutSection class

Properties

property CutSection.centralPlane(read only): CutSection object

When multiple cuts are on with either uniform or custom spacing, for any offset plane this property will be the CutSection object for the central cut plane in that direction. Note that if cs is already the central plane or there are no multiple cuts at all, cs.centralPlane will point to the same plane as cs itself

property CutSection.definition(read only): constant

The definition method for this cut section. Can be Constant.CONST_X, Constant.CONST_Y, Constant.CONST_Z, Constant.LS_DYNA, Constant.N3 or Constant.OR_AND_V. To change the definition method, see the function CutSection.SetDefinition

property CutSection.directionID(read only): integer

Direction index for this cut plane, 1 for D1, 2 for D2 and 3 for D3. When there are multiple cut planes in the same direction, either with uniform spacing or with custom spacing, they will all have the same direction index

property CutSection.multiCustomCut: boolean

true for multiple cuts with custom spacing, false for multiple cuts with uniform spacing. Note that this has an effect only when multiCut is true. If this is changed, CutSection objects for parallel cuts should no longer be referenced except for the local cut origin

property CutSection.multiCut: boolean

Whether or not multiple parallel cuts are on. If this is turned off, CutSection objects for parallel cuts should no longer be referenced except for the local cut origin

property CutSection.negativeAction: integer

Negative action for the cut plane. Can be Constant.OMIT, Constant.OUTLINE, Constant.NORMAL or Constant.TRANSPARENT

property CutSection.nneg: integer

Number of parallel planes in negative direction for uniform spacing. If this is changed, CutSection objects for parallel cuts should no longer be referenced except for the local cut origin

property CutSection.nodes(read only): list of Node objects

List of Node objects when cut section defined by 3 nodes or constant X/Y/Z with one node. For multiple parallel cuts this is only defined for the central plane at offset 0.0. To change the nodes, use the function CutSection.SetDefinition

property CutSection.npos: integer

Number of parallel planes in positive direction for uniform spacing. If this is changed, CutSection objects for parallel cuts should no longer be referenced except for the local cut origin

property CutSection.offset(read only): float

Offset of a parallel plane. This will be 0.0 when multiple cuts are off or when this is the central plane, otherwise positive or negative depending on the location of this plane. To change offsets, use the uniformSpacing property on the central plane for uniform spacing or CutSection.ClearOffsetPlanes and CutSection.AddOffsetPlane for custom spacing

property CutSection.origin(read only): list of floats

Origin coordinates for this cut plane. For multiple parallel cuts this is only defined for the central plane at offset 0.0. To change the origin, use the function CutSection.SetDefinition

property CutSection.positiveAction: integer

Positive action for the cut plane. Can be Constant.OMIT, Constant.OUTLINE, Constant.NORMAL or Constant.TRANSPARENT

property CutSection.thickCut: boolean

Whether or not thick cut is on

property CutSection.thickness: float

Thickness for thick cuts. Note that this affects drawing only when thickCut is set to true

property CutSection.uniformSpacing: float

Spacing value for parallel cuts with uniform spacing

property CutSection.visible: boolean

whether or not this cut direction is active. For it to be visible, in addition to this visible property also the cutSwitch property on the underlying GraphicsWindow object needs to be on

property CutSection.window(read only): GraphicsWindow object

Window where this cut section is defined

property CutSection.xAxis(read only): list of 3 floats

X axis vector when the cut plane is defined with Origin and Vectors. For multiple parallel cuts this is only defined for the central plane at offset 0.0. To change the X axis vector, use the function CutSection.SetDefinition

property CutSection.yAxis(read only): list of 3 floats

Local Y axis vector (normalised). For multiple parallel cuts this is only defined for the central plane at offset 0.0

property CutSection.zAxis(read only): list of 3 floats

Local Z axis vector (normalised). For multiple parallel cuts this is only defined for the central plane at offset 0.0

Constructor

classmethod CutSection(definition, options)

Creates a new cut section in D3PLOT. If there is already a cut section defined at the specified ‘directionID’ D1, D2 or D3, this will be replaced by the new one with all properties reset to their defaults except for those specified here

Parameters:
Returns:

CutSection object

Return type:

CutSection

Example

To define a cut section with constant X coordinate 100.0 in GraphicsWindow gw:

cs = Oasys.D3PLOT.CutSection(Oasys.D3PLOT.Constant.CONST_X, { "origin": [100.0, 0.0, 0.0], "window": gw })

To create a new cut direction with origin 100.0 200.0 300.0, X axis vector 0.0 0.8 0.6 and XY plane vector 1.0 0.0 0.0 in window gw:

dir = Oasys.D3PLOT.CutSection.FirstFreeDirection(gw)
cs = Oasys.D3PLOT.CutSection(Oasys.D3PLOT.Constant.OR_AND_V, { "origin": [100.0, 200.0, 300.0], "xAxis": [0.0, 0.8, 0.6], "xyPlane": [1.0, 0.0, 0.0], "window": gw, "directionID": dir })

Static methods

classmethod CutSection.First(window)

Returns the first cut section in the window or None if all cut directions D1, D2, D3 are turned off. If for the first active direction there are multiple parallel cuts, this function will return that with the most negative offset. In particular, in the default setup with just one direction D1 and no multiple cuts this function will return ‘the’ cut section of the graphics window. The main cutting switch has no effect on this function

Parameters:

window (GraphicsWindow object) – Graphics window to return the CutSection object for

Returns:

CutSection object

Return type:

CutSection

Example

To get the first cut section in graphics window gw:

cut_section = Oasys.D3PLOT.CutSection.First(gw)
classmethod CutSection.FirstFreeDirection(window=Oasys.gRPC.defaultArg)

Returns the index of the first inactive cut plane direction, i.e. 1 if D1 is not active, 2 if D1 is active but D2 is not, 3 if D1 and D2 are active but D3 is not. If all available directions D1, D2 and D3 are used, this will return 4 although not a valid direction ID

Parameters:

window (GraphicsWindow object) – Optional. Graphics window to return the direction index for. If omitted, the index will be returned based on cut sections in the first graphics window

Returns:

integer

Return type:

int

Example

To get the first free direction index in graphics window gw:

directionID = Oasys.D3PLOT.CutSection.FirstFreeDirection(gw)
classmethod CutSection.GetAll(window)

Returns a list of CutSection objects for all active directions in the window specified or all windows

Parameters:

window (GraphicsWindow object) – Graphics window to return the CutSection objects for. If omitted, CutSection objects for all graphics windows will be returned

Returns:

List of CutSection objects

Return type:

list

Example

To get a list of all CutSection objects for all graphics windows in the D3PLOT session:

cut_sections = Oasys.D3PLOT.CutSection.GetAll()

Note that this would return a list of length 1 with ‘the’ CutSection object in the most common case of just one graphics window with just one cut plane

classmethod CutSection.Last(window)

Returns the last cut section in the window or None if all cut directions D1, D2, D3 are turned off. If for the last active direction there are multiple parallel cuts, this function will return that with the most positive offset. The main cutting switch has no effect on this function

Parameters:

window (GraphicsWindow object) – Graphics window to return the CutSection object for

Returns:

CutSection object

Return type:

CutSection

Example

To get the last cut section in graphics window gw:

cut_section = Oasys.D3PLOT.CutSection.Last(gw)
classmethod CutSection.Propagate(options)

Propagates the definition of all cut sections to the target window specified

Parameters:

options (dict) –

source:

(GraphicsWindow object) Window where the cut section(s) should be propagated from

target (optional):

(GraphicsWindow object) Window where the cut section(s) should be propagated to. If omitted, the cut section(s) will be propagated to all windows in the D3PLOT session

Returns:

?

Return type:

?

Example

To propagate the cut section(s) from graphics window gw1 to graphics window gw2:

Oasys.D3PLOT.CutSection.Propagate({ "source": gw1, "target": gw2 })

Instance methods

CutSection.AddOffsetPlane(offset)

Adds another plane with given offset to custom spacing for multiple cuts. This is available only for the central plane. Note that this affects drawing only if multiCut and multiCustomCut are both true

Parameters:

offset (real) – Offset for the new parallel cut plane

Returns:

CutSection object

Return type:

CutSection

Example

To add a parallel plane to cut section central_cs with offset 10.0 and return a CutSection object for it in offset_cs:

offset_cs = central_cs.AddOffsetPlane(10.0)
CutSection.ClearOffsetPlanes()

Removes all offset planes except 0.0 from custom spacing for multiple cuts. This is available only for the central plane. Note that this affects drawing only if multiCut and multiCustomCut are both true

Returns:

No return value

Return type:

None

Example

To clear all offset planes from a cut section central_cs:

central_cs.ClearOffsetPlanes()
CutSection.GetCutCoords(item, options=Oasys.gRPC.defaultArg)

Returns the coordinates where the cut-section cuts through element <type/item>

Parameters:
  • item (object) – Beam, Shell, Solid or Tshell object

  • options (dict) –

    Optional.

    stateID (optional):

    (integer) State number to be used. If omitted, the current state of the graphics window of the CutSection object will be used

Returns:

2-dimensional list of reals or null if no intersection points. The length of the list returned is the number of intersection points, where each list entry is itself an list of 3 reals for the X, Y and Z coordinates.

Return type:

list

Example

To get the cut coordinates of Shell object s in state 10 with the cut plane represented by the cut section object cs:

coords = cs.GetCutCoords(s, { "stateID": 10 })
if coords:
    for i in range(len(coords)):
        Oasys.D3PLOT.Message(f"Intersection point {i+1}: X = {coords[i][0]}, Y = {coords[i][1]}, Z = {coords[i][2]}")
else:
    Oasys.D3PLOT.Message("No intersection points")
CutSection.GetForces(options)

Returns the forces, moments, centroid and area of the cut section in its window. The coordinate system of these results depends upon the cut section’s space system as follows: BASIC space: Forces are moments are always returned in the global axis system, about the geometrical centre of the cut elements at the given state. Therefore the effective origin is likely to change as the model deforms. (This is the method used by LS-DYNA) DEFORMED space: Forces and moments are returned in the plane local axis system, about the current section origin. The origin and axes will remain fixed as the model deforms unless one of the “section follows node(s)” options has been used. WARNING #1: Cut-sections in D3PLOT are a “per window” attribute, cutting all models in a window at the current “frame”. If the optional <stateID> argument is not supplied the forces and moments returned will be at the state of the current “frame” of the window, and while this will normally be the same as the current “state” this is not necessarily the case, since the user may have interpolated results by time Likewise if the optional <model> argument is not supplied then the model used will be the first in the window (that at index 0 from function GraphicsWindow.GetModelInfo), which may not be the same as the “current model” of the JavaScript interface. Therefore to avoid ambiguity when extracting cut-section forces and moments it is recommended that: The window being used should only contain a single model The window should be set up to display all states without interpolation, thus <state id> == <frame id>. (This is the default for windows.) This “single model in a window” approach is strongly recommended in this context since visual feedback will then match computed values. WARNING #2: By default computed forces do NOT include blanked elements. Since cut section display is primarily intended to be used interactively the default behaviour is to omit blanked elements from the forceand moment calculation, since in this way the reported values match what is visible on the screen. This behaviour is not ideal for batch processing since the user can, by manipulating blanking, change the results which are computed. Therefore the optional argument <includeBlanked> may be used to override this behaviour and to force blanked elements to be considered. If omitted, or set to false, then the default behaviour of omitting blanked elements will continue. WARNING #3: Cutting a model exactly at mesh lines can result in ill-conditioned force and moment calculation. It is tempting to define cut planes at nodes since this is easy to do, however this can give rise to ill-conditioning in a rectilinear mesh since the cut may lie exactly on the border between two adjacent elements and therefore won’t “know” which one’s results to use. Since LS-DYNA elements are constant stress there can be a step change in data values at element borders, and moving the cut plane by a tiny amount can result in a correspondingly large change in cut force and moment values. It is strongly recommended that cut section definitions used for force and moment extraction should be located away from mesh lines so that they cut elements near their centres, thus avoiding any ambiguity about which elements to use. WARNING #4: Any element types or parts excluded from the cut section are still included in the force and moment calculation.

Parameters:

options (dict) –

includeBlanked (optional):

(logical) false to omit blanked elements (default), true to include them

model (optional):

(Model object) Model that exists in the window of this cut section. If omitted the first model in the window will be used

part (optional):

(Part object) If defined, only forces in the specified part are computed

stateID (optional):

(integer) State number to be used. If omitted the state of the window’s current frame will be used

Returns:

Dict with properties

area:

(real) Cut section area

centroid:

(list of reals) Cut section centroid, [Cx, Cy, Cz]

force:

(list of reals) 3 Forces, [Fx, Fy, Fz]

moment:

(list of reals) 3 Moments, [Mxx, Myy, Mzz]

Return type:

dict

Example

To get the forces of CutSection object cs:

a = cs.GetForces()
if a:
    fx = a.force[Oasys.D3PLOT.Constant.X]
    myy = a.moment[Oasys.D3PLOT.Constant.Y]
    area = a.area
CutSection.GetPlanesForDirection()

Returns a list of CutSection objects for all cut planes in the same direction D1, D2 or D3. When there are multiple cuts in either uniform or custom spacing, the list will have one entry for each parallel plane in ascending order of offsets including the central plane itself at offset 0.0. Without multiple cuts the list will just have the plane itself as entry

Returns:

List of CutSection objects

Return type:

list

Example

To get a list of all planes in the same direction as cs:

cut_sections = cs.GetPlanesForDirection()
CutSection.Next()

Returns the next cut section in the window or None if called for the last one in the graphics window

Returns:

CutSection object

Return type:

CutSection

Example

To loop over all cut sections in graphics window gw:

cs = Oasys.D3PLOT.CutSection.First(gw)
while cs:
    # do something
    cs = cs.Next()
CutSection.Previous()

Returns the previous cut section in the window or None if called for the first one in the graphics window

Returns:

CutSection object

Return type:

CutSection

Example

To set CutSection object cs to the previous cut section:

cs = cs.Previous
CutSection.SetDefinition(definition, options)

Changes the definition method for the cut plane. When there are multiple parallel cuts, this can only be called for the plane at the local cut origin

Parameters:
Returns:

No return value

Return type:

None

Example

To set the definition method for cut section object cs to constant X with coordinate 100.0:

cs.SetDefinition({ "definition": Oasys.D3PLOT.Constant.CONST_X, "origin": [100.0, 0.0, 0.0]})