Reference
This section describes the API in detail.
Main Struct
DegenGeom
VSPGeom.VSPComponent — TypeVSPComponent(name::String)Parameters defining the VSPComponent object.
Arguments
name::String: Nametype::String: TypeGeomID::String: Geometry IDSurfNdx::Int: Surface indexMainSurfNdx::Int: Main surface indexSymCopyNdx::Int: Symmetry copy indexsurface_node::DataFrame: Surface node DegenGeomsurface_face::DataFrame: Surface face DegenGeomplate::DataFrame: Plate DegenGeomstick_node::DataFrame: Stick node DegenGeomstick_face::DataFrame: Stick face DegenGeompoint::DataFrame: Point DegenGeom
VSPGeom.readDegenGeom — FunctionreadDegenGeom(filename::String; verbose::Bool=false)Read DegenGeom CSV file written out by OpenVSP to obtain geometry and components.
Arguments
filename::String: DegenGeom filenameverbose::Bool: Set totrueto print status messages during file read operation
Returns
comp: Vector ofVSPComponentobjects
VSPGeom.degenGeomSize — FunctiondegenGeomSize(degenGeom::DataFrame)Get size of the 2d mesh data structure that describes the degenerate geometry. This is different from the DataFrame size obtained using size(degenGeom) which is the number of variables and total number of points in the DataFrame.
Arguments
degenGeom::DataFrame: One of the degenGeom inside theVSPComponentobject
Returns
nx::Int: Usually represents the number of cross-sections, referred to as Xsecs in OpenVSPny::Int: Usually represents the number of points in each cross-section in OpenVSP
STL
VSPGeom.TriMesh — TypeTriMesh(name::String)name::String: Namencells::Int: No. of cellsnormals::Vector{Vector{Float64}}: Vector of normals for each cellzeroBased::Vector{Bool}: If true, indices in connectivity information have zero-based indexing. A vector to make it mutable.points::Vector{Vector{Float64}}: Vector of unique pointscells::Vector{Vector{Int}}: Vector of vertices for each cell as indices ofpoints
VSPGeom.readSTL — FunctionreadSTL(filename::String; verbose::Bool=false, tol::Float64=eps(Float64), zeroBased::Bool=false)Read STL file to obtain geometry. This function can also handle the non-standard Tagged Multi Solid file type that OpenVSP writes out. Connectivity information for the mesh is not available at present.
Arguments
filename::String: STL filenameverbose::Bool: Set totrueto print status messages during file read operationtol::Float64: Set absolute tolerance when comparing points to obtain connectivityzeroBased::Bool: Set true to use zero-based numbering for indices in connectivity information
Returns
geom: Vector ofGeometryBasics.Meshobjects from the 'Geometrybasics.jl' package
VSPGeom.getVertices — FunctiongetVertices(mesh::TriMesh, icell::Int)Obtain vertices of a cell from a mesh
Arguments
mesh::TriMesh:TriMeshobjecticell::Int: Index of queried cell
Returns
vtxs: Vector containing the 3 vertices of the queried cell
VSPGeom.setZeroBased! — FunctionsetZeroBased!(mesh::TriMesh; value::Bool=true)Set connectivity information to be 0 or 1 based numbering.
Arguments
mesh::TriMesh:TriMeshobjectvalue::Bool: Value of the variable zeroBased. Settrueto use zero-based numbering
VSPGeom.getVTKElements — FunctiongetVTKElements(mesh::TriMesh)Convenience function that returns the datastructures points and cells required to write to a VTK file using the WriteVTK package. The user may write out a VTK file using,
WriteVTK.vtk_grid(filename, points, cells) do vtk
endArguments
mesh::TriMesh:TriMeshobject
Returns
points::Array{Float64}: Array of coordinates in the STL meshmesh::Array{meshCell}: Array of MeshCell objects that WriteVTK uses