/* * ez3d.h -- shared types for ez3d: grayscale PNG -> printable STL heightmap. * * Conventions (see README.md): * - 1 pixel = 1 unit of X/Y extent (STL is unitless; slicers treat it as mm). * - A WxH image yields an object exactly W x H units in footprint: the * vertex grid is (W+1) x (H+1), sitting on pixel corners. * - Height: z = base + (gray/255) * height_scale, optionally inverted. * - Image row 0 (top) maps to max Y so the model reads upright in a * Y-up viewer. */ #ifndef EZ3D_H #define EZ3D_H #include #include /* * See README.md for more details of options. */ typedef struct { const char *in_path; // input PNG const char *out_path; // output STL double height; // world units for gray 255 (default 10) double base; // solid base thickness under gray 0 (default 0) double edge; // height of edge-of-world cells & transparent alpha double tolerance; // Allowance for flatness and borderline zero checks. int alpha_thresh; // alpha >= thresh is solid; 256 = never cut int fold; // folding style, only two options: 0, 1 int decimate; // decimation level, 0=off, 1..5 controls error int simplify; // Simplification: 0=none, 1=light .. 5=aggressive int ascii; // write ASCII STL instead of binary int verify; // re-read STL and check manifoldness int max_groups; // Arbitrary upper limit on grouping phase int test_dump_cells; // Test mode only - dump table after cell calc int test_dump_groups; // Test mode only - dump table after grouping } ez3d_config_t; #endif /* EZ3D_H */