Cubit Python API 16.12
|
This document explains how to access Cubit mesh data from C++ or python. More...
Functions |
|
void | clear_window () |
clear the graphics window |
|
std::vector< int > | create_free_nodes (std::vector< double > &coords) |
create free nodes in cubit |
|
std::vector< int > | create_free_tris (std::vector< int > &tri_nodes) |
create free tris in cubit |
|
void | draw_line (double x0, double y0, double z0, double x1, double y1, double z1, int color) |
void | draw_point (double x, double y, double z, int color) |
void | flush () |
void | graphics_transforms () |
if a cubit graphics window is currently active, allows for interactive transformations of the model with the mouse |
|
void | init () |
Use init to initialize cubit modify access. |
|
void | notify_mesh_modified () |
int | set_node_coordinates (int num_nodes, int *nodes, double *coords) |
set the coordinate values for nodes |
|
bool | transfer_mesh (const std::string &geom_type, int from_entity_id, int to_entity_id, bool snap_to) |
transfer the ownership of all owned mesh entities from one geometry entity to another. transfers onlh mesh entities owned exclusively by the geometry entity. For example only nodes on the interior of a volume will be transferred to a new volume. Use a bottom up approach to successively transfer mesh from vertices, curves, surfaces and then volumes. If not performed completely, can leave the mesh in an invalid state |
|
This document explains how to access Cubit mesh data from C++ or python.
The purpose of CubitMeshInterface is to provide developers with a query interface for Cubit mesh data.
Most function prototypes are easy to understand. A few are more ambiguous and for those some examples are provided. Note that input parameters that require entity types, such as "volume", "quad", "curve", and so forth, expect lower case spellings of those entity types.
Examples are provided for C++ and python developers.
void clear_window | ( | ) |
clear the graphics window
std::vector< int > create_free_nodes | ( | std::vector< double > & | coords | ) |
create free nodes in cubit
coords | vector of node locations, ordered x,y,z for each node |
std::vector< int > create_free_tris | ( | std::vector< int > & | tri_nodes | ) |
create free tris in cubit
tri_nodes | vector of node ids, ordered ccw for each tri |
void draw_line | ( | double | x0, |
double | y0, | ||
double | z0, | ||
double | x1, | ||
double | y1, | ||
double | z1, | ||
int | color | ||
) |
brief draw a line in space in the graphics window
void draw_point | ( | double | x, |
double | y, | ||
double | z, | ||
int | color | ||
) |
brief draw a point in space in the graphics window
void flush | ( | ) |
brief flush the graphics pipeline
void graphics_transforms | ( | ) |
if a cubit graphics window is currently active, allows for interactive transformations of the model with the mouse
void init | ( | ) |
Use init to initialize cubit modify access.
void notify_mesh_modified | ( | ) |
brief updates all entities in cubit DB (including graphics) after the mesh has been modified
int set_node_coordinates | ( | int | num_nodes, |
int * | nodes, | ||
double * | coords | ||
) |
set the coordinate values for nodes
num_nodes | number of nodes we are passing in |
nodes | array of node ids (array size = num_nodes) |
coords | array of x-y-z coordinates (array size = 3*num_nodes) |
bool transfer_mesh | ( | const std::string & | geom_type, |
int | from_entity_id, | ||
int | to_entity_id, | ||
bool | snap_to | ||
) |
transfer the ownership of all owned mesh entities from one geometry entity to another. transfers onlh mesh entities owned exclusively by the geometry entity. For example only nodes on the interior of a volume will be transferred to a new volume. Use a bottom up approach to successively transfer mesh from vertices, curves, surfaces and then volumes. If not performed completely, can leave the mesh in an invalid state
geom_type | Specifies the geometry type of the entity |
from_entity_id | id of an existing cubit entity of type geom_type that currently contains mesh entities. entity will no longer me "meshed" following this operation |
to_entity_id | id of an existing cubit entity of type geom_type that does not currently meshed. entity will be meshed following this operation. |
snap_to | project any nodes to the gometry entity with id to_entity_id |