Blender V5.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
8
9#pragma once
10
11#include <cstdio>
12
13namespace blender {
14
15struct Mesh;
16
17/* Binary STL spec.:
18 * - UINT8[80] - Header - 80 bytes
19 * - UINT32 - Number of triangles - 4 bytes
20 * For each triangle - 50 bytes:
21 * - REAL32[3] - Normal vector - 12 bytes
22 * - REAL32[3] - Vertex 1 - 12 bytes
23 * - REAL32[3] - Vertex 2 - 12 bytes
24 * - REAL32[3] - Vertex 3 - 12 bytes
25 * - UINT16 - Attribute byte count - 2 bytes
26 */
27
28namespace io::stl {
29
30Mesh *read_stl_binary(FILE *file, bool use_custom_normals);
31
32} // namespace io::stl
33} // namespace blender
Mesh * read_stl_binary(FILE *file, const bool use_custom_normals)
BMesh Iterators.