-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmesh.h
More file actions
46 lines (35 loc) · 1.1 KB
/
mesh.h
File metadata and controls
46 lines (35 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#pragma once
//TODO: Smooth Slices
//TODO: Chunking
//TODO: fix voxelization
//TODO: Speedup Meshing (still) -> by obviously redoing at_or_make
typedef struct Mesh* Mesh;
#include "mesh_internal.h"
typedef struct Vertex Trig[3];
#include "volume.h"
Mesh Mesh_create();
bool Mesh_from_volume(Mesh mesh, Volume volume);
void Mesh_face_add(Mesh mesh, struct Vertex a,
struct Vertex b,
struct Vertex c,
struct Vertex d
);
bool Mesh_save_obj(Mesh mesh, const char *path);
bool Mesh_save_stl(Mesh mesh, const char *path);
void Mesh_free(Mesh mesh);
typedef struct Vertex Vector;
union coord{
struct Vertex v;
float a[3];
};
struct Dimensions
{
union coord min, max;
};
List Mesh_read_stl(const char *path);
List Mesh_to_chunks(List trigs, size_t res[3]);
float Coord_remap(float a, struct Dimensions size, size_t d);
bool Mesh_to_slices(List trigs, size_t res[3]);
List Mesh_intersects(List trigs, Vector pos, Vector direction);
float Coord_remap(float a, struct Dimensions size, size_t d);
struct Dimensions Mesh_dimensions(List trigs);