2026-07-23 05:27:51 +00:00
|
|
|
#pragma once
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include "vde/foundation/math_types.h"
|
|
|
|
|
|
|
|
|
|
namespace vde::foundation {
|
|
|
|
|
|
|
|
|
|
struct StlTriangle {
|
|
|
|
|
Vector3D normal;
|
|
|
|
|
Point3D v0, v1, v2;
|
|
|
|
|
};
|
|
|
|
|
|
2026-07-23 12:36:39 +00:00
|
|
|
/// Auto-detect format (binary or ASCII) and read.
|
2026-07-23 05:27:51 +00:00
|
|
|
std::vector<StlTriangle> read_stl(const std::string& filepath);
|
2026-07-23 12:36:39 +00:00
|
|
|
|
|
|
|
|
/// Always write binary STL.
|
2026-07-23 05:27:51 +00:00
|
|
|
void write_stl(const std::string& filepath, const std::vector<StlTriangle>& tris);
|
|
|
|
|
|
2026-07-23 12:36:39 +00:00
|
|
|
/// Write ASCII STL (human-readable).
|
|
|
|
|
void write_stl_ascii(const std::string& filepath, const std::vector<StlTriangle>& tris);
|
|
|
|
|
|
2026-07-23 05:27:51 +00:00
|
|
|
} // namespace vde::foundation
|