2015-03-03 00:38:33 +08:00
|
|
|
/****************************************************************************
|
2015-05-28 15:40:24 +08:00
|
|
|
** gmio
|
2015-05-01 00:19:45 +08:00
|
|
|
** Copyright Fougue (2 Mar. 2015)
|
2015-07-13 17:42:03 +08:00
|
|
|
** contact@fougue.pro
|
2015-03-03 00:38:33 +08:00
|
|
|
**
|
|
|
|
** This software is a reusable library whose purpose is to provide complete
|
|
|
|
** I/O support for various CAD file formats (eg. STL)
|
|
|
|
**
|
|
|
|
** This software is governed by the CeCILL-B license under French law and
|
|
|
|
** abiding by the rules of distribution of free software. You can use,
|
|
|
|
** modify and/ or redistribute the software under the terms of the CeCILL-B
|
|
|
|
** license as circulated by CEA, CNRS and INRIA at the following URL
|
2015-03-30 15:05:25 +08:00
|
|
|
** "http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html".
|
2015-03-03 00:38:33 +08:00
|
|
|
****************************************************************************/
|
|
|
|
|
2015-03-05 01:25:51 +08:00
|
|
|
/*! \file stl_triangle.h
|
|
|
|
* Declaration of gmio_stl_coords and gmio_stl_triangle
|
2015-09-09 17:44:34 +08:00
|
|
|
*
|
|
|
|
* \addtogroup gmio_stl
|
|
|
|
* @{
|
2015-03-05 01:25:51 +08:00
|
|
|
*/
|
|
|
|
|
2015-04-02 16:41:41 +08:00
|
|
|
#ifndef GMIO_STL_TRIANGLE_H
|
|
|
|
#define GMIO_STL_TRIANGLE_H
|
2014-03-28 23:33:35 +08:00
|
|
|
|
|
|
|
#include "stl_global.h"
|
|
|
|
|
2015-03-03 18:35:15 +08:00
|
|
|
/*! Cartesian coordinate entity in 3D space, specifically tailored for
|
|
|
|
* STL needs (single-float) */
|
2014-03-28 23:33:35 +08:00
|
|
|
struct gmio_stl_coords
|
|
|
|
{
|
2015-03-03 17:44:45 +08:00
|
|
|
gmio_float32_t x;
|
|
|
|
gmio_float32_t y;
|
|
|
|
gmio_float32_t z;
|
2014-03-28 23:33:35 +08:00
|
|
|
};
|
|
|
|
|
2015-03-03 18:35:15 +08:00
|
|
|
/*! STL mesh triangle defined three geometric vertices and an
|
|
|
|
* orientation(normal) */
|
2014-03-28 23:33:35 +08:00
|
|
|
struct gmio_stl_triangle
|
|
|
|
{
|
2015-12-04 01:00:25 +08:00
|
|
|
struct gmio_stl_coords normal; /*!< Normal vector */
|
|
|
|
struct gmio_stl_coords v1; /*!< Vertex 1 */
|
|
|
|
struct gmio_stl_coords v2; /*!< Vertex 2 */
|
|
|
|
struct gmio_stl_coords v3; /*!< Vertex 3 */
|
2015-03-03 17:35:36 +08:00
|
|
|
uint16_t attribute_byte_count; /*!< Useful only for STL binary format */
|
2014-03-28 23:33:35 +08:00
|
|
|
};
|
|
|
|
|
2015-03-13 19:19:19 +08:00
|
|
|
/*! Constants for STL triangles */
|
|
|
|
enum {
|
2015-12-04 01:00:25 +08:00
|
|
|
/*! Compact size of a struct gmio_stl_coords object */
|
2015-03-13 19:19:19 +08:00
|
|
|
GMIO_STL_COORDS_RAWSIZE = (3 * sizeof(gmio_float32_t)),
|
2014-03-28 23:33:35 +08:00
|
|
|
|
2015-12-04 01:00:25 +08:00
|
|
|
/*! Compact size of a struct gmio_stl_triangle object for STL ascii format */
|
2015-03-13 19:19:19 +08:00
|
|
|
GMIO_STLA_TRIANGLE_RAWSIZE = (4 * GMIO_STL_COORDS_RAWSIZE),
|
2014-03-28 23:33:35 +08:00
|
|
|
|
2015-12-04 01:00:25 +08:00
|
|
|
/*! Compact size of a struct gmio_stl_triangle object for STL binary format */
|
2015-03-13 19:19:19 +08:00
|
|
|
GMIO_STLB_TRIANGLE_RAWSIZE = (GMIO_STLA_TRIANGLE_RAWSIZE + sizeof(uint16_t))
|
|
|
|
};
|
2014-03-28 23:33:35 +08:00
|
|
|
|
2015-04-02 16:41:41 +08:00
|
|
|
#endif /* GMIO_STL_TRIANGLE_H */
|
2015-09-09 17:44:34 +08:00
|
|
|
/*! @} */
|