This group of functions is available for adding, deleting, and modifying OpenVSP Geoms through the API. Click here to return to the main page. More...
Functions | |
| void | vsp::SetGeomMaterialName (const std::string &geom_id, const std::string &name) |
| std::vector< std::string > | vsp::GetGeomTypes () |
| std::string | vsp::AddGeom (const std::string &type, const std::string &parent=std::string()) |
| void | vsp::UpdateGeom (const std::string &geom_id) |
| void | vsp::DeleteGeom (const std::string &geom_id, int clone_delete=CLONE_DELETE_LEAVE_EMPTY) |
| void | vsp::DeleteGeomVec (const std::vector< std::string > &del_vec, int clone_delete=CLONE_DELETE_LEAVE_EMPTY) |
| void | vsp::CutGeomToClipboard (const std::string &geom_id, int clone_delete=CLONE_DELETE_LEAVE_EMPTY) |
| void | vsp::CopyGeomToClipboard (const std::string &geom_id) |
| std::vector< std::string > | vsp::PasteGeomClipboard (const std::string &parent=std::string()) |
| std::string | vsp::ConvertFuselageToStack (const std::string &geom_id) |
| std::vector< std::string > | vsp::FindGeoms () |
| std::vector< std::string > | vsp::FindGeomsWithName (const std::string &name) |
| std::string | vsp::FindGeom (const std::string &name, int index) |
| void | vsp::SetGeomName (const std::string &geom_id, const std::string &name) |
| std::string | vsp::GetGeomName (const std::string &geom_id) |
| void | vsp::SetGeomCloneOriginal (const std::string &clone_id, const std::string &original_id) |
| std::string | vsp::GetGeomCloneOriginal (const std::string &clone_id) |
| std::vector< std::string > | vsp::CloneGeomVec (const std::vector< std::string > &geom_id_vec, const std::string &name_suffix="_Clone") |
| void | vsp::SetGeomCloneNameSuffix (const std::string &clone_id, const std::string &name_suffix) |
| std::string | vsp::GetGeomCloneNameSuffix (const std::string &clone_id) |
| std::string | vsp::ReplaceCloneGeom (const std::string &clone_id) |
| std::vector< std::string > | vsp::FindGeomClones (const std::vector< std::string > &geom_id_vec) |
| std::vector< std::string > | vsp::GetGeomParmIDs (const std::string &geom_id) |
| std::string | vsp::GetGeomTypeName (const std::string &geom_id) |
| void | vsp::SetGeomParent (const std::string &geom_id, const std::string &parent_id) |
| void | vsp::ReorderGeom (const std::string &geom_id, int reorder_type) |
| std::string | vsp::AttachGeomTexture (const std::string &geom_id, const std::string &file_name) |
| void | vsp::RemoveGeomTexture (const std::string &geom_id, const std::string &texture_id) |
| std::vector< std::string > | vsp::GetGeomTextureIDVec (const std::string &geom_id) |
| std::string | vsp::GetGeomTextureFileName (const std::string &geom_id, const std::string &texture_id) |
| std::string | vsp::GetGeomParent (const std::string &geom_id) |
| std::string | vsp::GetGeomSymAncestorID (const std::string &geom_id) |
| std::string | vsp::GetGeomIncorporatedAncestorID (const std::string &geom_id) |
| void | vsp::SetGeomSymAncestorID (const std::string &geom_id, const std::string &ancestor_id) |
| void | vsp::SetGeomIncorporatedAncestorID (const std::string &geom_id, const std::string &ancestor_id) |
| std::vector< std::string > | vsp::GetGeomChildren (const std::string &geom_id) |
| int | vsp::GetNumMainSurfs (const std::string &geom_id) |
| int | vsp::GetTotalNumSurfs (const std::string &geom_id) |
| int | vsp::GetGeomVSPSurfType (const std::string &geom_id, int main_surf_ind=0) |
| int | vsp::GetGeomVSPSurfCfdType (const std::string &geom_id, int main_surf_ind=0) |
| vec3d | vsp::GetGeomBBoxMax (const std::string &geom_id, int main_surf_ind=0, bool ref_frame_is_absolute=true) |
| vec3d | vsp::GetGeomBBoxMin (const std::string &geom_id, int main_surf_ind=0, bool ref_frame_is_absolute=true) |
| void | vsp::SplitWingXSec (const std::string &wing_id, int section_index) |
| std::vector< int > | vsp::GetDriverGroup (const std::string &geom_id, int section_index) |
| void | vsp::ResetPropellerThickness (const std::string &geom_id) |
| void | vsp::CopyAirfoil (const std::string &geom_id, int index) |
| void | vsp::PasteAirfoil (const std::string &geom_id, int index) |
| void | vsp::ClearSkinning (const std::string &geom_id, int index=-1) |
| void | vsp::ResetGeomScale (const std::string &geom_id) |
| void | vsp::AcceptGeomScale (const std::string &geom_id) |
| std::vector< vec3d > | vsp::GetPtCloudPnts (const std::string &geom_id) |
| std::string | vsp::CreateNGonMeshGeom (const std::string &geom_id) |
| std::string | vsp::CreateConvexHull (const std::string &geom_id) |
| void | vsp::ProjectPtCloudPts (const std::string &geom_id, const std::string &target_geom_id, int surf_index, int dir_index) |
|
extern |
Turn a MeshGeom into a Point Cloud Geom made of its mesh nodes. This is the Mesh screen's Convert to Point Cloud button.
| [in] | geom_id | string MeshGeom ID |
Keep a Geom's scaled size and reset the scale factor to one, folding the scaling into the Geom's own dimensions. This is the Scale tab's Accept button.
| [in] | geom_id | string Geom ID |
|
extern |
Add a new Geom of given type as a child of the specified parent. If no parent or an invalid parent is given, the Geom is placed at the top level
| [in] | type | string Geom type (i.e FUSELAGE, POD, etc.) |
| [in] | parent | string Parent Geom ID |
|
extern |
Attach a texture image to a Geom, the way the Add button on the Texture screen does. A texture is drawn on the Geom's surface at a placement given by its Parms; the returned ID is a ParmContainer ID, so U, W, U_Scale, W_Scale, Transparency, U_Flip and W_Flip in the "Texture_Parm" group are reached the usual way.
| [in] | geom_id | string Geom ID |
| [in] | file_name | string Name of the texture image file |
|
extern |
Clear the skinning of one cross section, or of every cross section when the index is left at -1. This is the Skinning tab's Clear and Clear All buttons. A Geom whose cross sections are not skinned, or an index past the last cross section, is an error.
| [in] | geom_id | string Geom ID |
| [in] | index | int Cross section index, or -1 for every section |
|
extern |
Make a Clone Geom of each Geom in a group, keeping the hierarchy among them. The top Clone of each hierarchy is a sibling of its original, starts at the original's placement, and has CloneXForm off so it can be moved. The Clones below it have CloneXForm on, so they keep their originals' relative placement. The Clones are returned in model hierarchy order, not the order passed in; use GetGeomCloneOriginal to match them up.
| [in] | geom_id_vec | vector<string> Vector of Geom IDs to clone |
| [in] | name_suffix | string Suffix automatic naming appends to each original's name |
|
extern |
Replace a Fuselage with a Stack of the same shape. Each cross section is placed where the Fuselage put it, and its skinning is carried across, so the surface is unchanged. The Stack goes in the Fuselage's place in the model, under its name, with its children, subsurfaces, structures, mesh sources, textures and attributes.
The Stack takes over the Fuselage's identity: its Geom ID, the IDs of the Parms the two have in common, and the IDs of each cross section and its Parms. A link, a design variable or an advanced link on one of those Parms goes on naming the same thing, and the ID this returns is the ID that was passed in. Some Parms are paired with a counterpart that means something different: a cross section's rotation, which in a Stack is relative to the section before it, and its location fractions, which become the Stack's X, Y and Z deltas – lengths, and relative ones. Only the Fuselage's length has no counterpart at all; attributes on it, or on a cross section's copy of it, move to the Stack itself. Attributes elsewhere – on the Geom, a cross section, a subsurface, a Parm – stay with the ID they were on.
CompareGeomSurfaces measures how closely the Stack's surfaces match a copy of the Fuselage kept for the purpose.
| [in] | geom_id | string Fuselage Geom ID |
|
extern |
Link two Parms so that changing the first drives the second. This is the simple Parm Link the Link screen builds, not an Advanced Link. The link is created with its offset active and set to the difference between the two Parms, so B follows A while holding its current separation.
| [in] | parm_a_id | string Parm ID of the driving Parm |
| [in] | parm_b_id | string Parm ID of the driven Parm |
Copy the airfoil of a wing section to the airfoil clipboard. This is a separate clipboard from the one CopyXSec uses, so an airfoil can be moved without carrying the section geometry with it.
| [in] | geom_id | string Wing Geom ID |
| [in] | index | int Wing section index |
|
extern |
Copy Geom from current location and store on clipboard
| [in] | geom_id | string Geom ID |
|
extern |
Build the convex hull of a Point Cloud Geom. The hull arrives as a new MeshGeom; the point cloud itself is left alone. This is the Point Cloud screen's Convex Hull button.
| [in] | geom_id | string Point Cloud Geom ID |
|
extern |
Turn a MeshGeom into an NGon Mesh Geom. This is the Mesh screen's Convert to NGon Mesh button.
| [in] | geom_id | string MeshGeom ID |
|
extern |
Cut Geom from current location and store on clipboard. A pasted Geom is a new Geom, so clone_delete applies to each Clone of the cut Geom, as for DeleteGeom. A Clone cut along with it is pasted as a Clone of the pasted Geom.
| [in] | geom_id | string Geom ID |
| [in] | clone_delete | int What becomes of each Clone of the Geom (CLONE_DELETE_TYPE) |
|
extern |
Delete a particular Geom. clone_delete says what becomes of each Clone of it. By default each is left empty and VSP_CLONE_ORIGINAL_LOST is reported for it. FindGeomClones lists them beforehand.
| [in] | geom_id | string Geom ID |
| [in] | clone_delete | int What becomes of each Clone of the Geom (CLONE_DELETE_TYPE) |
|
extern |
Delete multiple Geoms. clone_delete applies to each Clone of them that is not itself being deleted, as for DeleteGeom.
| [in] | del_vec | vector<string> Vector of Geom IDs |
| [in] | clone_delete | int What becomes of each Clone of those Geoms (CLONE_DELETE_TYPE) |
|
extern |
Find and return the Geom ID with the specified name at given index. Equivalent to FindGeomsWithName( name )[index].
| [in] | name | string Geom name |
| [in] | index |
|
extern |
Find the Clones of a group of Geoms that are not in the group themselves – the ones a delete or cut of the group would leave empty. Clones of these Clones are not returned, though CLONE_DELETE_WITH_ORIGINAL deletes them too.
| [in] | geom_id_vec | vector<string> Vector of Geom IDs |
|
extern |
Find and return all Geom IDs in the model
|
extern |
Find and return all Geom IDs with the specified name
| [in] | name | string Geom name |
|
extern |
Set the driver group for a wing section or a XSecCurve. Care has to be taken when setting these driver groups to ensure a valid combination.
| [in] | geom_id | string Geom ID |
| [in] | section_index | int Wing section index |
| [in] | driver_0 | int First driver enum (i.e. SPAN_WSECT_DRIVER) |
| [in] | driver_1 | int Second driver enum (i.e. ROOTC_WSECT_DRIVER) |
| [in] | driver_2 | int Third driver enum (i.e. TIPC_WSECT_DRIVER) |
Get the driver group for a wing section or an XSec. A wing section reports three drivers; an XSecCurve reports the drivers of its own driver group.
| [in] | geom_id | string Geom ID |
| [in] | section_index | int Wing section or XSec index |
|
extern |
Get the maximum coordinate of the bounding box of a Geom with given surface index. The Geom bounding box may be specified in absolute or body reference frame.
A Geom with no surfaces – a mesh, a point cloud, a wireframe – answers out of its own bounding box, and main_surf_ind does not apply. That box is built in absolute coordinates, so the body reference frame answer is the absolute box turned back through the model matrix, which contains the geometry but is not as tight as the box a surface gives.
| [in] | geom_id | string Geom ID |
| [in] | main_surf_ind | int Index of the surface of that Geom, counting symmetric copies, from 0 to GetTotalNumSurfs() - 1 (the name is kept for scripts that pass it by keyword) |
| [in] | ref_frame_is_absolute | bool Flag to specify absolute or body reference frame |
|
extern |
Get the minimum coordinate of the bounding box of a Geom with given surface index. The Geom bounding box may be specified in absolute or body reference frame.
A Geom with no surfaces – a mesh, a point cloud, a wireframe – answers out of its own bounding box, and main_surf_ind does not apply. That box is built in absolute coordinates, so the body reference frame answer is the absolute box turned back through the model matrix, which contains the geometry but is not as tight as the box a surface gives.
| [in] | geom_id | string Geom ID |
| [in] | main_surf_ind | int Index of the surface of that Geom, counting symmetric copies, from 0 to GetTotalNumSurfs() - 1 (the name is kept for scripts that pass it by keyword) |
| [in] | ref_frame_is_absolute | bool Flag to specify absolute or body reference frame |
|
extern |
Get the IDs for each child of the input parent Geom.
| [in] | geom_id | string Geom ID |
|
extern |
Get the suffix automatic naming appends to the original's name. A new Clone starts with "_Clone".
| [in] | clone_id | string Clone Geom ID |
|
extern |
Get the Geom a Clone Geom is a Clone of. An empty string means the Clone has not been given one, or has been cleared.
| [in] | clone_id | string Clone Geom ID |
|
extern |
Get the ID of the Geom whose Parasite Drag row a Geom is incorporated into, which its IncorporatedGen Parm names by generation.
| [in] | geom_id | string Geom ID |
|
extern |
Get the name of a specific Geom
| [in] | geom_id | string Geom ID |
|
extern |
Get the parent Geom ID for the input child Geom. "NONE" is returned if the Geom has no parent.
| [in] | geom_id | string Geom ID |
|
extern |
Get all Parm IDs associated with this Geom Parm container
| [in] | geom_id | string Geom ID |
|
extern |
Get the ID of the Geom whose frame a Geom's symmetry is about, which its Sym_Ancestor Parm names by generation. An empty string means the global origin.
| [in] | geom_id | string Geom ID |
|
extern |
Get the image file a texture was attached from.
| [in] | geom_id | string Geom ID |
| [in] | texture_id | string Texture ParmContainer ID |
|
extern |
Get the ParmContainer IDs of all the textures attached to a Geom, in the order they are drawn.
| [in] | geom_id | string Geom ID |
|
extern |
Get the type name of specified Geom (i.e. FUSELAGE)
| [in] | geom_id | string Geom ID |
|
extern |
Get an array of all Geom types (i.e FUSELAGE, POD, etc.)
|
extern |
Get the VSP surface CFD type of the specified Geom
| [in] | geom_id | string Geom ID |
| [in] | main_surf_ind | int Main surface index |
|
extern |
Get the VSP surface type of the specified Geom
| [in] | geom_id | string Geom ID |
| [in] | main_surf_ind | int Main surface index |
|
extern |
Get the number of main surfaces for the specified Geom. Multiple main surfaces may exist for CustoGeoms, propellors, etc., but does not include surfaces created due to symmetry.
| [in] | geom_id | string Geom ID |
|
extern |
Get the points of a Point Cloud Geom
| [in] | geom_id | string Point Cloud Geom ID |
|
extern |
Get the total number of surfaces for the specified Geom. This is equivalent to the number of main surface multiplied by the number of symmetric copies.
| [in] | geom_id | string Geom ID |
|
extern |
Paste the airfoil clipboard onto a wing section
| [in] | geom_id | string Wing Geom ID |
| [in] | index | int Wing section index |
|
extern |
Paste Geom from clipboard into the model. The Geom is pasted as a child of the specified parent, but will be placed at top level if no parent or an invalid one is provided.
| [in] | parent | string Parent Geom ID |
|
extern |
Project the points of a point cloud onto a surface of another Geom, the way the Project button on the Point Cloud screen does. Each point is moved along the chosen axis until it lands on the target surface; a point that does not hit the surface is left where it is.
| [in] | geom_id | string Point cloud Geom ID |
| [in] | target_geom_id | string Geom ID of the Geom to project onto |
| [in] | surf_index | int Surface index on the target Geom |
| [in] | dir_index | int Direction to project along, X_DIR, Y_DIR or Z_DIR (see DIR_INDEX) |
|
extern |
Remove a texture from a Geom, the way the Delete button on the Texture screen does.
| [in] | geom_id | string Geom ID |
| [in] | texture_id | string Texture ParmContainer ID |
|
extern |
Move a Geom within the list of its siblings, the way the move buttons beside the Geom browser do. A Geom's position among its siblings sets the order it is written, exported and drawn in; it does not change the Geom's parent or its geometry.
| [in] | geom_id | string Geom ID |
| [in] | reorder_type | int Reorder type enum (see REORDER_TYPE) |
|
extern |
Replace a Clone with a full copy of the Geom it shows. The copy takes the Clone's place, name and children, the Clone's own Parm values (any whose Copy From Original switch is off) are written onto it, and the Clone is deleted.
The replacement takes the Clone's Geom ID, the IDs of the Parms they share, and its subsurfaces with their IDs, so attached Geoms, design variables, links and VSPAERO control surface groups keep working. The returned ID is the one passed in.
The replacement's Flip_Flag holds every plane the Clone showed its shape reflected about.
A Clone of a polygon mesh is not replaced, because a polygon mesh cannot be copied.
| [in] | clone_id | string Clone Geom ID |
|
extern |
Discard a Geom's pending scale and return it to its unscaled size. This is the Scale tab's Reset button. Use AcceptGeomScale to keep the scaled size instead.
| [in] | geom_id | string Geom ID |
|
extern |
Rebuild a propeller's thickness curve from the airfoils actually on its cross sections, the way the Reset Thickness button on the Prop screen does. The thickness curve normally drives the sections; this runs the relationship the other way once, so a blade built up section by section gets a thickness curve that matches what it already is.
| [in] | geom_id | string Propeller Geom ID |
|
extern |
Set the suffix automatic naming appends to the original's name. With AutoName on, the Clone is renamed on the next update. The suffix is saved with the model.
| [in] | clone_id | string Clone Geom ID |
| [in] | name_suffix | string Suffix to append to the original's name |
|
extern |
Set which Geom a Clone Geom is a Clone of. A Clone shows the original's surfaces while keeping its own place in the model. What else it takes from the original – symmetry, Set membership, placement, attachment, colour, subsurfaces and the rest – is controlled by the Parms in its Behavior group. Passing an empty original_id leaves the Clone showing nothing and turns its AutoName off, so its name is the user's.
A Clone's Flip_Flag (group Sym) is its own. With CloneSym on, the Clone also shows its original's flip: the planes are combined, and a plane set on both cancels.
| [in] | clone_id | string Clone Geom ID |
| [in] | original_id | string ID of the Geom to be cloned |
|
extern |
Set the Geom whose Parasite Drag row a Geom is incorporated into, by ID, which sets its IncorporatedGen Parm. The Geom must be the Geom itself or one of its ancestors.
| [in] | geom_id | string Geom ID |
| [in] | ancestor_id | string ID of the Geom or one of its ancestors |
|
extern |
Set the material a Geom is drawn with, by name. The name must be one of the materials in the material library.
| [in] | geom_id | string Geom ID |
| [in] | name | string Material name |
|
extern |
Set the name of the specified Geom. A Geom that names itself, such as a Clone with its AutoName Parm (group Behavior) on, refuses the name with an error; turn AutoName off first.
| [in] | geom_id | string Geom ID |
| [in] | name | string Geom name |
|
extern |
Get the parent Geom ID for the input child Geom. "NONE" is returned if the Geom has no parent.
| [in] | geom_id | string Geom ID |
| [in] | parent_id | string Parent Geom ID |
|
extern |
Set the Geom whose frame a Geom's symmetry is about, by ID, which sets its Sym_Ancestor Parm. The Geom must be the Geom itself or one of its ancestors; an empty string means the global origin.
| [in] | geom_id | string Geom ID |
| [in] | ancestor_id | string ID of the Geom or one of its ancestors, or an empty string |
|
extern |
Split a given wing section.
| [in] | wing_id | string Geom ID |
| [in] | section_index | int Wing section index |
|
extern |
Perform an update for the specified Geom.
Update() rebuilds the model from the top of the tree down and places each child Geom from its relative location, so a child stays attached when its parent moves. A child Geom in absolute mode ( Abs_Or_Relitive_flag set to ABS ) therefore loses an X_Location, Y_Location, Z_Location or X/Y/Z_Rotation set with SetParmVal when Update() runs. Call UpdateGeom on that Geom before Update(): it updates the Geom by itself and works out the relative location from the new absolute one. SetParmValUpdate does both in one call.
| [in] | geom_id | string Geom ID |