mirror of
https://github.com/IllusionMan1212/3dobs.git
synced 2026-10-24 10:12:35 +00:00
28 lines
366 B
Rust
28 lines
366 B
Rust
struct STLHeader {
|
|||
|
|
header: [u8; 80],
|
||
|
|
num_triangles: u32,
|
||
|
|
}
|
||
|
|
|
||
|
|
struct Vertex {
|
||
|
|
x: f32,
|
||
|
|
y: f32,
|
||
|
|
z: f32,
|
||
|
|
}
|
||
|
|
|
||
|
|
struct Triangle {
|
||
|
|
normal: [f32; 3],
|
||
|
|
vertices: [Vertex; 3],
|
||
|
|
attribute_byte_count: u16,
|
||
|
|
}
|
||
|
|
|
||
|
|
struct STL {
|
||
|
|
header: STLHeader,
|
||
|
|
triangles: Vec<Triangle>,
|
||
|
|
}
|
||
|
|
|
||
|
|
impl STL {
|
||
|
|
pub fn new(stl: Vec<u8>) -> () {
|
||
|
|
// TODO:
|
||
|
|
}
|
||
|
|
}
|