6.2
general documentation
cs_stl.h File Reference
#include "cs_defs.h"
+ Include dependency graph for cs_stl.h:

Go to the source code of this file.

Data Structures

struct  cs_stl_mesh_t
 
struct  cs_stl_mesh_info_t
 

Functions

cs_stl_mesh_tcs_stl_mesh_add (const char *path)
 Add a new STL mesh structure. More...
 
cs_stl_mesh_tcs_stl_mesh_get_by_name (const char *name)
 Return a pointer to a STL mesh based on its name if present. More...
 
void cs_stl_mesh_destroy_all (void)
 Free all allocated STL mesh structures. More...
 
void cs_stl_file_read (cs_stl_mesh_t *stl_mesh, const char *path)
 Read a binary STL file and store its content in a STL mesh structure. More...
 
void cs_stl_file_write (cs_stl_mesh_t *stl_mesh, const char *path)
 Write a binary STL file according to a given STL mesh structure. More...
 

Variables

cs_stl_mesh_info_tcs_glob_stl_meshes
 

Function Documentation

◆ cs_stl_file_read()

void cs_stl_file_read ( cs_stl_mesh_t stl_mesh,
const char *  path 
)

Read a binary STL file and store its content in a STL mesh structure.

Each STL file composed of the following header:

uint8[80] – Header uint32 – Number of triangles

followed by 50 byte blocks for each triangle:

  • real32[3] – Normal vector
  • real32[3] – Vertex 1 coordinates
  • real32[3] – Vertex 2 coordinates
  • real32[3] – Vertex 3 coordiantes
  • uint16 – Attribute (any other information, usually void)
Parameters
[in]pathpath to the STL file
[in]stl_meshpointer to the associated STL mesh structure

◆ cs_stl_file_write()

void cs_stl_file_write ( cs_stl_mesh_t stl_mesh,
const char *  path 
)

Write a binary STL file according to a given STL mesh structure.

Parameters
[in]stl_meshpointer to the associated STL mesh structure
[in]pathpath to the STL file

◆ cs_stl_mesh_add()

cs_stl_mesh_t* cs_stl_mesh_add ( const char *  name)

Add a new STL mesh structure.

Parameters
[in]namename of the STL mesh
Returns
pointer to the new STL mesh structure

◆ cs_stl_mesh_destroy_all()

void cs_stl_mesh_destroy_all ( void  )

Free all allocated STL mesh structures.

◆ cs_stl_mesh_get_by_name()

cs_stl_mesh_t* cs_stl_mesh_get_by_name ( const char *  name)

Return a pointer to a STL mesh based on its name if present.

Parameters
[in]namename of the STL mesh

If no STL mesh of the given name is defined, NULL is returned.

Returns
pointer to the STL mesh structure, or NULL

Variable Documentation

◆ cs_glob_stl_meshes

cs_stl_mesh_info_t* cs_glob_stl_meshes