|
pyCAPS
pyCAPS: A Python Extension Module for CAPS
|
Defines Problem Geometry Object. More...
Inherits object.
Inherited by capsGeometry.
Public Member Functions | |
| build (self) | |
| Exlicitly build geometry. | |
| save (self, filename="myGeometry", directory=os.getcwd(), extension=".egads") | |
| Save the current geometry to a file. | |
| view (self, **kwargs) | |
| View or take a screen shot of the geometry configuration. | |
| attrList (self, attributeName, **kwargs) | |
| Retrieve a list of attribute values of a given name ("attributeName") for the bodies in the current geometry. | |
| attrMap (self, getInternal=False, **kwargs) | |
| Create attribution map (embeded dictionaries) of each body in the current geometry. | |
| createTree (self, filename="myGeometry", **kwargs) | |
| Create a HTML dendrogram/tree of the current state of the geometry. | |
| bodies (self) | |
| Get dict of geometric bodies. | |
| lengthUnit (self) | |
| Get the lenght Unit of geometric bodies. | |
| writeParameters (self, filename) | |
| Write an OpenCSM Design Parameter file to disk. | |
| readParameters (self, filename) | |
| Read an OpenCSM Design Parameter file from disk and and overwrites (makes dirty) the current state of the geometry. | |
Defines Problem Geometry Object.
| ProblemGeometry.despmtr | ValueInSequence of ValueIn CSM design parameters |
| ProblemGeometry.cfgpmtr | ValueInSequence of ValueIn CSM configuration parameters |
| ProblemGeometry.conpmtr | ValueInSequence of ValueIn CSM constant parameters |
| ProblemGeometry.outpmtr | ValueOutSequence of ValueOut CSM outputs |
| attrList | ( | self, | |
| attributeName, | |||
| ** | kwargs | ||
| ) |
Retrieve a list of attribute values of a given name ("attributeName") for the bodies in the current geometry.
Level in which to search the bodies is determined by the attrLevel keyword argument.
| attributeName | Name of attribute to retrieve values for. |
| **kwargs | See below. |
Valid keywords:
| bodyIndex | Specific body in which to retrieve attribute information from. |
| attrLevel | Level to which to search the body(ies). Options: 0 (or "Body") - search just body attributes 1 (or "Face") - search the body and all the faces [default] 2 (or "Edge") - search the body, faces, and all the edges 3 (or "Node") - search the body, faces, edges, and all the nodes |
| attrMap | ( | self, | |
getInternal = False, |
|||
| ** | kwargs | ||
| ) |
Create attribution map (embeded dictionaries) of each body in the current geometry.
Dictionary layout:
Dictionary layout (reverseMap = True):
| **kwargs | See below. |
| reverseMap | Reverse the attribute map (default - False). See above table for details. |
| bodies | ( | self | ) |
Get dict of geometric bodies.
| createTree | ( | self, | |
filename = "myGeometry", |
|||
| ** | kwargs | ||
| ) |
Create a HTML dendrogram/tree of the current state of the geometry.
The HTML file relies on the open-source JavaScript library, D3, to visualize the data. This library is freely available from https://d3js.org/ and is dynamically loaded within the HTML file. If running on a machine without internet access a (miniaturized) copy of the library may be written to a file alongside the generated HTML file by setting the internetAccess keyword to False. If set to True, internet access will be necessary to view the tree.
| filename | Filename to use when saving the tree (default - "myGeometry"). Note an ".html" is automatically appended to the name (same with ".json" if embedJSON = False). |
| **kwargs | See below. |
Valid keywords:
| embedJSON | Embed the JSON tree data in the HTML file itself (default - True). If set to False a seperate file is generated for the JSON tree data. |
| internetAccess | Is internet access available (default - True)? If set to True internet access will be necessary to view the tree. |
| internalGeomAttr | Show the internal attributes (denoted by starting with an underscore, for example "_AttrName") that exist on the geometry (default - False). |
| reverseMap | Reverse the attribute map (default - False). See attrMap for details. |
| lengthUnit | ( | self | ) |
Get the lenght Unit of geometric bodies.
| readParameters | ( | self, | |
| filename | |||
| ) |
Read an OpenCSM Design Parameter file from disk and and overwrites (makes dirty) the current state of the geometry.
| filename | Filename of the OpenCSM Design Parameter file |
| save | ( | self, | |
filename = "myGeometry", |
|||
directory = os.getcwd(), |
|||
extension = ".egads" |
|||
| ) |
Save the current geometry to a file.
| filename | File name to use when saving geometry file. |
| directory | Directory where to save file. Default current working directory. |
| extension | Extension type for file if filename does not contain an extension. |
| view | ( | self, | |
| ** | kwargs | ||
| ) |
View or take a screen shot of the geometry configuration.
The use of this function to save geometry requires the matplotlib module. Important: If both showImage = True and filename is not None, any manual view changes made by the user in the displayed image will be reflected in the saved image.
| **kwargs | See below. |
Valid keywords:
| viewerType | What viewer should be used (default - "capsViewer"). Options: "capsViewer" or "matplotlib" (options are case insensitive). Important: if $filename is not None, the viewer is changed to matplotlib. |
| portNumber | Port number to start the server listening on (default - 7681). |
| title | Title to add to each figure (default - None). |
| filename | Save image(s) to file specified (default - None). Note filename should not contain '.' other than to indicate file type extension (default type = *.png). 'file' - OK, 'file2.0Test' - BAD, 'file2_0Test.png' - OK, 'file2.0Test.jpg' - BAD. |
| directory | Directory path were to save file. If the directory doesn't exist it will be made. (default - current directory). |
| viewType | Type of view for the image(s). Options: "isometric" (default), "fourview", "top" (or "-zaxis"), "bottom" (or "+zaxis"), "right" (or "+yaxis"), "left" (or "-yaxis"), "front" (or "+xaxis"), "back" (or "-xaxis"). |
| combineBodies | Combine all bodies into a single image (default - False). |
| ignoreBndBox | Ignore the largest body (default - False). |
| showImage | Show image(s) (default - False). |
| showAxes | Show the xyz axes in the image(s) (default - False). |
| showTess | Show the edges of the tessellation (default - False). |
| dpi | Resolution in dots-per-inch for the figure (default - None). |
| tessParam | Custom tessellation paremeters, see EGADS documentation for makeTessBody function. values will be scaled by the norm of the bounding box for the body (default - [0.0250, 0.0010, 15.0]). |
| writeParameters | ( | self, | |
| filename | |||
| ) |
Write an OpenCSM Design Parameter file to disk.
| filename | Filename of the OpenCSM Design Parameter file |