4 #define MSURF_GREATER 1
8 #define MSURF_NORMALIZE 2
16 struct metasurface *msurf_create(void);
17 void msurf_free(struct metasurface *ms);
19 void msurf_enable(struct metasurface *ms, unsigned int opt);
20 void msurf_disable(struct metasurface *ms, unsigned int opt);
21 int msurf_is_enabled(struct metasurface *ms, unsigned int opt);
23 /* which is inside above or below the threshold */
24 void msurf_set_inside(struct metasurface *ms, int inside);
25 int msurf_get_inside(struct metasurface *ms);
27 /* set the bounding box (default: -1, -1, -1, 1, 1, 1)
28 * keep this as tight as possible to avoid wasting grid resolution
30 void msurf_set_bounds(struct metasurface *ms, float xmin, float ymin, float zmin, float xmax, float ymax, float zmax);
31 void msurf_get_bounds(struct metasurface *ms, float *xmin, float *ymin, float *zmin, float *xmax, float *ymax, float *zmax);
33 /* resolution of the 3D evaluation grid, the bigger, the better, the slower
34 * (default: 40, 40, 40)
36 void msurf_set_resolution(struct metasurface *ms, int xres, int yres, int zres);
37 void msurf_get_resolution(struct metasurface *ms, int *xres, int *yres, int *zres);
39 /* isosurface threshold value (default: 0) */
40 void msurf_set_threshold(struct metasurface *ms, float thres);
41 float msurf_get_threshold(struct metasurface *ms);
43 /* get pointer to the scalar field */
44 float *msurf_voxels(struct metasurface *ms);
45 float *msurf_slice(struct metasurface *ms, int idx);
47 /* finally call this to perform the polygonization */
48 int msurf_polygonize(struct metasurface *ms);
50 int msurf_vertex_count(struct metasurface *ms);
51 float *msurf_vertices(struct metasurface *ms);
52 float *msurf_normals(struct metasurface *ms);
58 #endif /* METASURF_H_ */