Cubit Python API 16.16
Public Member Functions
Surface

Defines a surface object that mostly parallels Cubit's RefFace class. More...

#include <CubitInterfaceEx.hpp>

Inheritance diagram for Surface:
GeomEntity Entity

Public Member Functions

  Surface ()
 
  Surface (const Surface &other)
 
  Surface (CubitEntity *entity_ptr)
 
  ~Surface ()
 
double  area ()
  Get area of the Surface.
 
std::array< double, 3 >  closest_point_along_vector (std::array< double, 3 > location, std::array< double, 3 > along_vector)
  Get the nearest point on the Surface to point specified along the specified vector.
 
std::array< double, 3 >  closest_point_trimmed (CubitInterface::Loc location)
  Get the nearest point on the Surface to point specified.
 
std::array< double, 3 >  closest_point_trimmed (std::array< double, 3 > location)
  Get the nearest point on the Surface to point specified.
 
std::array< double, 4 >  color ()
  Get the color of the surface.
 
std::array< double, 2 >  get_param_range_U ()
  Get range of u for the Surface.
 
std::array< double, 2 >  get_param_range_V ()
  Get range of v for the Surface.
 
bool  is_cylindrical ()
  Get whether the Surface is cylindrical or not.
 
bool  is_planar ()
  Get whether the Surface is planar or not.
 
std::array< double, 3 >  normal_at (std::array< double, 3 > location)
  Get the normal at a particular point on the Surface.
 
std::vector< std::vector< Curve > >  ordered_loops ()
  Get the ordered loops of the Surface.
 
int  point_containment (std::array< double, 3 > point_in)
  Get whether a point is on or off of the Surface.
 
std::array< double, 3 >  position_from_u_v (double u, double v)
  Get the Cartesian coordinates from the uv coordinates on the Surface.
 
std::array< double, 2 >  principal_curvatures (std::array< double, 3 > point)
  Get the principal curvatures of the Surface.
 
void  set_color (std::array< double, 4 > value)
  Set the color of the surface.
 
std::array< double, 2 >  u_v_from_position (std::array< double, 3 > location)
  Get the uv coordinates from the supplied Cartesian coordinates on the Surface.
 
- Public Member Functions inherited from GeomEntity
std::vector< Body bodies ()
  Get the bodies in the GeomEntity.
 
std::vector< Curve curves ()
  Get the curves in the GeomEntity.
 
int  dimension ()
  Get the dimensions of the GeomEntity.
 
std::string  entity_name ()
  Return the first name of the GeomEntity.
 
void  entity_name (std::string name)
  Assign a name to the GeomEntity.
 
std::vector< std::string >  entity_names ()
  Return the all the names of the GeomEntity.
 
bool  is_meshed ()
  Return the current mesh state of the GeomEntity.
 
int  is_transparent ()
  Get the tranparency state of the Entity.
 
void  is_transparent (int transparency_flag)
  Set the tranparency state of the Entity.
 
int  is_visible ()
  Get the visibility state of the Entity.
 
void  is_visible (bool visibility_flag)
  Set the visibility state of the Entity.
 
void  mesh ()
  Mesh the GeomEntity.
 
int  num_names ()
  Return the number of names for the GeomEntity.
 
void  remove_entity_name (std::string name)
  Remove a specific name from the list of names assigned to the GeomEntity.
 
void  remove_entity_names ()
  Remove all the names assigned to the GeomEntity.
 
void  remove_mesh ()
  Removes the mesh on the GeomEntity.
 
void  set_entity_name (std::string name)
  Assign a name to the GeomEntity.
 
void  set_transparent (int transparency_flag)
  Set the tranparency state of the Entity.
 
void  set_visible (bool visibility_flag)
  Set the visibility state of the Entity.
 
void  smooth ()
  Smooths the mesh on the GeomEntity.
 
std::vector< Surface surfaces ()
  Get the surfaces in the GeomEntity.
 
std::vector< Vertex vertices ()
  Get the vertices in the GeomEntity.
 
std::vector< Volume volumes ()
  Get the volumes in the GeomEntity.
 
- Public Member Functions inherited from Entity
  Entity ()
 
  Entity (CubitEntity *entity_ptr)
 
  Entity (Entity const &copy_from)
 
  ~Entity ()
 
std::array< double, 6 >  bounding_box ()
  Get the bounding box of the Entity.
 
std::array< double, 3 >  center_point ()
  Get the center point of the Entity.
 
void  destroy_cubit_entity ()
 
CubitEntity *  entity_ptr ()
 
int  id ()
  Get the id of the Entity.
 
Entity operator= (const Entity &rhs)
 

Additional Inherited Members

- Protected Member Functions inherited from GeomEntity
  GeomEntity (const GeomEntity &other)
 
  GeomEntity (CubitEntity *entity_ptr)
 
- Protected Attributes inherited from Entity
CubObserver *  cubitWatcher
 
CubitEntity *  mEntityPtr
 

Detailed Description

Defines a surface object that mostly parallels Cubit's RefFace class.

Constructor & Destructor Documentation

◆ Surface() [1/3]

Surface ( )
inline

◆ ~Surface()

~Surface ( )
inline

◆ Surface() [2/3]

Surface ( const Surface other )
inline

◆ Surface() [3/3]

Surface ( CubitEntity *  entity_ptr )
inline

Member Function Documentation

◆ area()

double area ( )

Get area of the Surface .

doublearea = surface ->area ();
double area()
Get area of the Surface.
CubitInterface::Surface surface(int id_in)
Gets the surface object from an ID.
Returns
The area of the Surface

◆ closest_point_along_vector()

std::array< double, 3 > closest_point_along_vector ( std::array< double, 3 >  location,
std::array< double, 3 >  along_vector 
)

Get the nearest point on the Surface to point specified along the specified vector.

std::array<double,3> point(3, 0);
std::array<double,3> along_vector{1,1,1};
std::array<double,3> nearest = surface ->closest_point_trimmed (point);
std::array< double, 3 > closest_point_trimmed(std::array< double, 3 > location)
Get the nearest point on the Surface to point specified.
nearest = surface .closest_point_along_vector ([0,0,0], [1,1,1])
std::array< double, 3 > closest_point_along_vector(std::array< double, 3 > location, std::array< double, 3 > along_vector)
Get the nearest point on the Surface to point specified along the specified vector.
Parameters
[in] location A vector containing three values that are the coordinates of a point
Returns
A vector (or list) of doubles representing values of nearest point as follows:
0 - x coordinate
1 - y coordinate
2 - z coordinate

◆ closest_point_trimmed() [1/2]

std::array< double, 3 > closest_point_trimmed ( CubitInterface::Loc  location )

Get the nearest point on the Surface to point specified.

std::array<double,3> point(3, 0);
std::array<double,3> nearest = surface ->closest_point_trimmed (point);
nearest = surface .closest_point_trimmed ([0,0,0])
Parameters
[in] location A vector containing three values that are the coordinates of a point
Returns
A vector (or list) of doubles representing values of nearest point as follows:
0 - x coordinate
1 - y coordinate
2 - z coordinate

◆ closest_point_trimmed() [2/2]

std::array< double, 3 > closest_point_trimmed ( std::array< double, 3 >  location )

Get the nearest point on the Surface to point specified.

std::array<double,3> point(3, 0);
std::array<double,3> nearest = surface ->closest_point_trimmed (point);
nearest = surface .closest_point_trimmed ([0,0,0])
Parameters
[in] location A vector containing three values that are the coordinates of a point
Returns
A vector (or list) of doubles representing values of nearest point as follows:
0 - x coordinate
1 - y coordinate
2 - z coordinate

◆ color()

std::array< double, 4 > color ( )

Get the color of the surface.

int col = surface ->color ();
std::array< double, 4 > color()
Get the color of the surface.
col = surface .color ()
Returns
The color value associated with the surface's current color

◆ get_param_range_U()

std::array< double, 2 > get_param_range_U ( )

Get range of u for the Surface .

std::vector<double> bounds = surface ->get_param_range_U ();
std::array< double, 2 > get_param_range_U()
Get range of u for the Surface.
bounds = surface .get_param_range_U ()
Returns
The curvature values:
0 - The lowest value in the u direction
1 - The highest value in the u direction

◆ get_param_range_V()

std::array< double, 2 > get_param_range_V ( )

Get range of v for the Surface .

std::vector<double> bounds = surface ->get_param_range_V ();
std::array< double, 2 > get_param_range_V()
Get range of v for the Surface.
lower_bound, upper_bound = surface .get_param_range_V ()
Returns
The curvature values:
0 - The lowest value in the v direction
1 - The highest value in the v direction

◆ is_cylindrical()

bool is_cylindrical ( )

Get whether the Surface is cylindrical or not.

bool cyl = surface ->is_cylindrical ();
bool is_cylindrical()
Get whether the Surface is cylindrical or not.
Returns
Whether the Surface is cylindrical or not

◆ is_planar()

bool is_planar ( )

Get whether the Surface is planar or not.

bool planar = surface ->is_planar ();
bool is_planar()
Get whether the Surface is planar or not.
planar = surface .is_planar ()
Returns
Whether the Surface is planar or not

◆ normal_at()

std::array< double, 3 > normal_at ( std::array< double, 3 >  location )

Get the normal at a particular point on the Surface .

std::array<double,3> point(3, 0);
std::array<double,3> norm = surface ->normal_at (point);
std::array< double, 3 > normal_at(std::array< double, 3 > location)
Get the normal at a particular point on the Surface.
norm = surface .normal_at ([0,0,0])
Parameters
[in] location A vector containing three values that are the coordinates of a point
Returns
A vector (or list) of doubles representing values of normal vector as follows:
0 - x value
1 - y value
2 - z value

◆ ordered_loops()

std::vector< std::vector< Curve > > ordered_loops ( )

Get the ordered loops of the Surface .

std::vector<std::vector<Curve> > loops = surface ->ordered_loops ();
std::vector< std::vector< Curve > > ordered_loops()
Get the ordered loops of the Surface.
loops = surface .ordered_loops ()
Returns
A vector of vectors (or list of lists) of Curves in loops:
0, 0 - loop 1 curve 1
0, 1 - loop 1 curve 2
1, 0 - loop 2 curve 1
etc...

◆ point_containment()

int point_containment ( std::array< double, 3 >  point_in )

Get whether a point is on or off of the Surface .

std::array<double,3> point(3, 0);
int on_off = surface ->point_containment (point);
int point_containment(std::array< double, 3 > point_in)
Get whether a point is on or off of the Surface.
on_off = surface .point_containment ([0,0,0])
Parameters
[in] point_in A vector containing three values that are the coordinates of a point
Returns
A python boolean representing whether the point is off (0) or on (1) the Surface

◆ position_from_u_v()

std::array< double, 3 > position_from_u_v ( double  u,
double  v 
)

Get the Cartesian coordinates from the uv coordinates on the Surface .

std::vector<double> pos = surface ->position_from_u_v (0, 0);
std::array< double, 3 > position_from_u_v(double u, double v)
Get the Cartesian coordinates from the uv coordinates on the Surface.
pos = surface .position_from_u_v (0, 0)
Parameters
[in] u The u parameter
[in] v The v parameter
Returns
The Cartesian coordinates of the supplied uv coordinates as a vector:
0 - x coordinate
1 - y coordinate
2 - z coordinate

◆ principal_curvatures()

std::array< double, 2 > principal_curvatures ( std::array< double, 3 >  point )

Get the principal curvatures of the Surface .

std::vector<double> point(3, 0);
std::vector<double> curvatures = surface ->principal_curvatures (point);
std::array< double, 2 > principal_curvatures(std::array< double, 3 > point)
Get the principal curvatures of the Surface.
curvatures = surface .principal_curvatures ([0,0,0])
Parameters
[in] point A vector containing three values that are the coordinates of a point
Returns
A list of two floats representing the curvatures
0 - curvature 1
1 - curvature 2

◆ set_color()

void set_color ( std::array< double, 4 >  value )

Set the color of the surface.

void set_color(std::array< double, 4 > value)
Set the color of the surface.
Parameters
[in] value The color value that the surface will have

◆ u_v_from_position()

std::array< double, 2 > u_v_from_position ( std::array< double, 3 >  location )

Get the uv coordinates from the supplied Cartesian coordinates on the Surface .

std::vector<double> location(3, 0);
std::vector<double> uv = surface ->u_v_from_position (location);
std::array< double, 2 > u_v_from_position(std::array< double, 3 > location)
Get the uv coordinates from the supplied Cartesian coordinates on the Surface.
uv = surface .position_from_u_v ([0,0,0])
Parameters
[in] location A vector containing the Cartesian coordinates
Returns
The curvature values:
0 - The u parameter
1 - The v parameter