/* SPDX-License-Identifier: GPL-2.0-or-later */ /** \file * \ingroup stl */ #pragma once #include #include "BKE_mesh.h" /* Binary STL spec.: * UINT8[80] – Header - 80 bytes * UINT32 – Number of triangles - 4 bytes * For each triangle - 50 bytes: * REAL32[3] – Normal vector - 12 bytes * REAL32[3] – Vertex 1 - 12 bytes * REAL32[3] – Vertex 2 - 12 bytes * REAL32[3] – Vertex 3 - 12 bytes * UINT16 – Attribute byte count - 2 bytes */ namespace blender::io::stl { const size_t BINARY_HEADER_SIZE = 80; const size_t BINARY_STRIDE = 12 * 4 + 2; Mesh *read_stl_binary(FILE *file, Main *bmain, char *mesh_name, bool use_custom_normals); } // namespace blender::io::stl