star-3dut

Generate meshes of simple geometric shapes
git clone git://git.meso-star.fr/star-3dut.git
Log | Files | Refs | README | LICENSE

s3dut_mesh.h (1467B)


      1 /* Copyright (C) 2016, 2017, 2020, 2021, 2023 |Méso|Star> (contact@meso-star.com)
      2  *
      3  * This program is free software: you can redistribute it and/or modify
      4  * it under the terms of the GNU General Public License as published by
      5  * the Free Software Foundation, either version 3 of the License, or
      6  * (at your option) any later version.
      7  *
      8  * This program is distributed in the hope that it will be useful,
      9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     11  * GNU General Public License for more details.
     12  *
     13  * You should have received a copy of the GNU General Public License
     14  * along with this program. If not, see <http://www.gnu.org/licenses/>. */
     15 
     16 #ifndef S3DUT_MESH_H
     17 #define S3DUT_MESH_H
     18 
     19 #include <rsys/dynamic_array_double.h>
     20 #include <rsys/dynamic_array_size_t.h>
     21 #include <rsys/ref_count.h>
     22 
     23 enum s3dut_mesh_type {
     24   S3DUT_MESH_CUBOID,
     25   S3DUT_MESH_CYLINDER,
     26   S3DUT_MESH_THICK_CYLINDER,
     27   S3DUT_MESH_HEMISPHERE,
     28   S3DUT_MESH_SPHERE,
     29   S3DUT_MESH_THICK_SPHERE,
     30   S3DUT_MESH_SUPER_SHAPE
     31 };
     32 
     33 struct s3dut_mesh {
     34   enum s3dut_mesh_type type;
     35   struct darray_double coords;
     36   struct darray_size_t ids;
     37 
     38   ref_T ref;
     39   struct mem_allocator* allocator;
     40 };
     41 
     42 extern LOCAL_SYM res_T
     43 mesh_create
     44   (struct mem_allocator* allocator,
     45    const enum s3dut_mesh_type type,
     46    const size_t nvertices,
     47    const size_t ntriangles,
     48    struct s3dut_mesh** out_mesh);
     49 
     50 #endif /* S3DUT_MESH_H */
     51