Blender V4.3
stl_import_binary_reader.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
11#include <cstdio>
12
13struct Mesh;
14
15/* Binary STL spec.:
16 * UINT8[80] - Header - 80 bytes
17 * UINT32 - Number of triangles - 4 bytes
18 * For each triangle - 50 bytes:
19 * REAL32[3] - Normal vector - 12 bytes
20 * REAL32[3] - Vertex 1 - 12 bytes
21 * REAL32[3] - Vertex 2 - 12 bytes
22 * REAL32[3] - Vertex 3 - 12 bytes
23 * UINT16 - Attribute byte count - 2 bytes
24 */
25
26namespace blender::io::stl {
27
28Mesh *read_stl_binary(FILE *file, bool use_custom_normals);
29
30} // namespace blender::io::stl
Mesh * read_stl_binary(FILE *file, const bool use_custom_normals)