Skip to content

Commit

Permalink
Adding new commands (#2432)
Browse files Browse the repository at this point in the history
* Adding slashline

* Adding /LARC

* Adding dscale

* adding /type

* Adding missing kwargs

* Setting navigation with keys to False

---------

Co-authored-by: Camille <78221213+clatapie@users.noreply.github.com>
  • Loading branch information
germa89 and clatapie authored Oct 27, 2023
1 parent bc762fe commit 320cb6d
Show file tree
Hide file tree
Showing 3 changed files with 247 additions and 0 deletions.
72 changes: 72 additions & 0 deletions src/ansys/mapdl/core/_commands/graphics_/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,78 @@ def anum(self, num="", type_="", xhot="", yhot="", **kwargs):
command = f"/ANUM,{num},{type_},{xhot},{yhot}"
return self.run(command, **kwargs)

def slashlarc(self, xcentr="", ycentr="", xlrad="", angle1="", angle2="", **kwargs):
"""Creates annotation arcs (GUI).
APDL Command: /LARC
Parameters
----------
xcentr
Arc X center location (-1.0 < X < 1.0).
ycentr
Arc Y center location (-1.0 < Y < 1.0).
xlrad
Arc radius length.
angle1
Starting angle of arc.
angle2
Ending angle of arc. The arc is drawn counterclockwise from the
starting angle, `angle1`, to the ending angle, `angle2`.
Notes
-----
This command defines annotation arcs to be written directly onto the
display at a specified location. The command is generated by the Graphical
User Interface (GUI) and will appear in the log file (`Jobname.LOG`) if
annotation is used. It is not intended to be typed in directly in a
Mechanical APDL session (although it can be included in an input file
for batch input or for use with the `/INPUT` command).
All arcs are shown on subsequent displays unless the annotation is
turned off or deleted. Issueu `/LSPEC` to set the attributes
of the arc.
This command is valid in any processor.
"""
command = f"/LARC, {xcentr}, {ycentr}, {xlrad}, {angle1}, {angle2}"
return self.run(command, **kwargs)

def slashline(self, x1="", y1="", x2="", y2="", **kwargs):
"""Creates annotation lines (GUI).
APDL Command: /LINE
Parameters
----------
X1
Line X starting location (-1.0 < X < 2.0).
Y1
Line Y starting location (-1.0 < Y < 1.0).
X2
Line X ending location (-1.0 < X < 2.0).
Y2
Line Y ending location (-1.0 < Y < 1.0).
Notes
-----
This command defines annotation lines to be written directly onto the
display at a specified location. The command is generated by the Graphical
User Interface (GUI) and appears in the log file (`Job-name.LOG`) if
annotation is used. It is not intended to be typed in directly in a
Mechanical APDL session (although it can be included in an input file
for batch input or for use with the `/INPUT` command). All lines are
shown on subsequent displays unless the annotation is turned off or
deleted. Issue `/LSPEC` to set the attributes of the line.
This command is valid in any processor.
"""
command = f"/LINE, {x1}, {y1}, {x2}, {y2}"
return self.run(command, **kwargs)

def lspec(self, lcolor="", linstl="", xlnwid="", **kwargs):
"""Specifies annotation line attributes (GUI).
Expand Down
65 changes: 65 additions & 0 deletions src/ansys/mapdl/core/_commands/graphics_/scaling.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,69 @@
class Scaling:
def slashdscale(self, wn="", dmult="", **kwargs):
"""Sets the displacement multiplier for displacement displays.
APDL Command: /DSCALE
Parameters
----------
wn
Window number (or ALL) to which command applies (defaults to 1).
dmult
AUTO or 0
Scale displacements automatically so that maximum displacement
(vector amplitude) displays as 5 percent of the maximum model
length, as measured in the global Cartesian X, Y, or Z
directions.
1
Do not scale displacements (that is, scale displacements by 1.0,
true to geometry). Often used with large deflection results.
FACTOR
Scale displacements by numerical value input for `FACTOR`.
OFF
Remove displacement scaling (that is, scale displacements by 0.0,
no distortion).
USER
Set `dmult` to that used for last display (useful when last `dmult`
value was automatically calculated).
Notes
-----
**Command Default**
The default value is AUTO or 0 except when:
* Large deflection effects are included (`NLGEOM,ON`) and it is not a
modal analysis; then the default is 1.
* It is a spectrum analysis (`ANTYPE,SPECTR`); then the default is `OFF`.
* The amplitude of a time-harmonic solution is computed using the `HRCPLX`
command (`OMEGAT ≥ 360°`); then the default is `OFF`.
* The amplitude of a complex modal or harmonic solution is stored into
the database using the `SET` command (`KIMG = AMPL`); then the default
is `OFF`.
If Multi-Plots are not being displayed, and the current device is a 3D
device (`/SHOW,3D`), then the displacement scale in all active windows
will be the same, even if separate `/DSCALE` commands are issued for
each active window. For efficiency, the program maintains a single data
structure (segment) containing only one displacement scale. The program
displays the same segment (displacement scale) in all windows. Only the
view settings will be different in each of the active windows.
This command is valid in any processor.
"""
command = f"/DSCALE, {wn}, {dmult}"
return self.run(command, **kwargs)

def iclwid(self, factor="", **kwargs):
"""Scales the line width of circuit builder icons.
Expand Down
110 changes: 110 additions & 0 deletions src/ansys/mapdl/core/_commands/graphics_/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,116 @@ def shade(self, wn="", type_="", **kwargs):
command = f"/SHADE,{wn},{type_}"
return self.run(command, **kwargs)

def slashtype(self, wn="", type_="", **kwargs):
"""Defines the type of display.
APDL Command: /TYPE
Parameters
----------
wn
Window number (or ALL) to which command applies (defaults to 1).
type_
Display type. Defaults to `ZBUF` for raster mode displays or `BASIC`
for vector mode displays:
BASIC or 0
Basic display (no hidden or section operations).
SECT or 1
Section display (plane view). Use the `/CPLANE` command to
define the cutting plane.
HIDC or 2
Centroid hidden display (based on item centroid sort).
HIDD or 3
Face hidden display (based on face centroid sort).
HIDP or 4
Precise hidden display (like `HIDD` but with more precise checking).
Because all facets are sorted, this mode can be extremely slow,
especially for large models.
CAP or 5
Capped hidden display (same as combined `SECT` and `HIDD` with
model in front of section plane removed).
ZBUF or 6
Z-buffered display (like `HIDD` but using software Z-buffering).
ZCAP or 7
Capped Z-buffered display (same as combined `SECT` and `ZBUF`
with model in front of section plane removed).
ZQSL or 8
`QSLICE` Z-buffered display (same as `SECT` but the edge lines
of the remaining 3D model are shown).
HQSL or 9
`QSLICE` precise hidden display (like `ZQSL` but using precise hidden).
Notes
-----
**Command Default:** `ZBUF` for raster mode displays; `BASIC` for vector
mode displays.
Defines the type of display, such as section display or hidden-line
display. Use the `/DEVICE` command to specify either raster or
vector mode.
The `SECT`, `CAP`, `ZCAP`, `ZQSL`, and `HQSL` options produce section
displays. The section or "cutting" plane is specified on the `/CPLANE `
command as either normal to the viewing vector at the focus point
(default), or as the working plane.
When you use PowerGraphics, the section display options (`Section`,
`Slice`, and `Capped`) use different averaging techniques for the
interior and exterior results. Because of the different averaging
schemes, anomalies may appear at the transition areas. In many cases,
the automatically computed `MIN` and `MAX` values will differ from the
full range of interior values. You can lessen the effect of these
anomalies by issuing` AVRES,,FULL` (Main Menu> General Post Proc>
Options for Outp). This command sets your legend's automatic contour
interval range according to the minimum and maximum results found
throughout the entire model.
With PowerGraphics active (`/GRAPHICS,POWER`), the averaging scheme for
surface data with interior element data included (`AVRES,,FULL`) and
multiple facets per edge (`/EFACET,2` or `/EFACET,4`) will yield
differing minimum and maximum contour values depending on the Z-
Buffering options (`/TYPE,,6` or `/TYPE,,7`). When the Section data is
not included in the averaging schemes (`/TYPE,,7`), the resulting
absolute value for the midside node is significantly smaller.
The `HIDC`, `HIDD`, `HIDP`, `ZBUF`, `ZQSL`, and `HQSL` options produce
displays with "hidden" lines removed. Hidden lines are lines obscured
from view by another element, area, etc. The choice of non-Z-buffered
hidden-line procedure types is available only for raster mode
(`/DEVICE`) displays. For vector mode displays, all non-Z-buffered
"hidden-line" options use the same procedure (which is slightly
different from the raster procedures). Both geometry and postprocessing
displays may be of the hidden- line type. Interior stress contour lines
within solid elements can also be removed as hidden lines, leaving only
the stress contour lines and element outlines on the visible surfaces.
Midside nodes of elements are ignored on postprocessing displays.
Overlapping elements will not be displayed.
The `ZBUF`, `ZCAP`, and `ZQSL` options use a specific hidden-line
technique called software Z-buffering. This technique allows a more
accurate display of overlapping surfaces (common when using Boolean
operations or `/ESHAPE` on element displays), and allows smooth shaded
displays on all interactive graphics displays. Z-buffered displays can
be performed faster than `HIDP` and `CAP` type displays for large
models. See also the `/LIGHT`, `/SHADE`, and `/GFILE` commands for
additional options when Z-buffering is used.
This command is valid in any processor.
"""
command = f"/TYPE,{wn},{type_}"
return self.run(command, **kwargs)

def trlcy(self, lab="", tlevel="", n1="", n2="", ninc="", **kwargs):
"""Specifies the level of translucency.
Expand Down

0 comments on commit 320cb6d

Please sign in to comment.