shapeΒΆ

class shape

The Lua to the internal Guerilla shape storage

Members

Methods:

number count getpolygoncount ( ) Return the number of polygons in the shape
number|nil index getpolygonvertex ( number polygon , number vertex ) Return the index of the nth vertex in a polygon of the shape
number count getpolygonvertexcount ( number polygon ) Return the number of vertices in a polygon of the shape
number,... indices getpolygonvertices ( number polygon ) Return the indices of the vertices in a polygon of the shape as a n-uple of integer numbers, as in LUAINLINE{local indices = { shape:getpolygonvertices (poly) }}
number,... data getvar ( string variable , number polygon , number vertex ) Return the data associated to a polygon vertex for a given variable, as a n-uple of floating point numbers.
{string} variables getvariables ( ) Return the list of avaiable variables in the shape

Documentation

number count getpolygoncount ( )

Return the number of polygons in the shape

Return:

  • count the number of polygons in the shape


number|nil index getpolygonvertex ( number polygon , number vertex )

Return the index of the nth vertex in a polygon of the shape

Arguments:

  • polygon the 1-based index of the polygon
  • vertex the 1-based index of the vertex in the polygon

Return:

  • index the index of the vertex in the polygon, or nil if the polygon or vertex is invalid


number count getpolygonvertexcount ( number polygon )

Return the number of vertices in a polygon of the shape

Arguments:

  • polygon the 1-based index of the polygon

Return:

  • count the number of vertices in a polygon of the shape


number,... indices getpolygonvertices ( number polygon )

Return the indices of the vertices in a polygon of the shape as a n-uple of integer numbers, as in LUAINLINE{local indices = { shape:getpolygonvertices (poly) }}

Arguments:

  • polygon the 1-based index of the polygon

Return:

  • indices the indices of the vertices in the polygon, or nil if the polygon is invalid


number,... data getvar ( string variable , number polygon , number vertex )

Return the data associated to a polygon vertex for a given variable, as a n-uple of floating point numbers.

This method reads the value of a shape variable, indexed by its polygon and vertex indices. polygon parameter is the index of the polygon (from 1 to shape:getpolygoncount()), and vertex is the index of the vertex in the polygon (from 1 to shape:getpolygonvertexcount (polygon)). Returned data are a n-uple of numbers, as in local x,y,z = shape:getvar ("P",poly,vertex)
Arguments:

  • variable the variable name, such as "P", "N", "st"...
  • polygon the 0-based index of the polygon to get data from
  • vertex the 0-based index of the vertex in the polygon to get data from

Return:

  • data the data associated to the vertex polygon in the requested variable, or nil if no data are associated.


{string} variables getvariables ( )

Return the list of avaiable variables in the shape

Return:

  • variables the list of available variables