{"id":30446968,"url":"https://github.com/nickscha/mvx","last_synced_at":"2025-08-23T11:20:32.739Z","repository":{"id":310680857,"uuid":"1040809284","full_name":"nickscha/mvx","owner":"nickscha","description":"C89, single header, nostdlib mesh voxelizer","archived":false,"fork":false,"pushed_at":"2025-08-19T14:58:33.000Z","size":1113,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-19T16:42:03.432Z","etag":null,"topics":["c89","mesh-voxelization","nostdlib","single-header","voxelizer"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nickscha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-19T14:36:41.000Z","updated_at":"2025-08-19T14:58:36.000Z","dependencies_parsed_at":"2025-08-19T16:42:05.416Z","dependency_job_id":"2006238d-0f50-484e-89ed-0c3e8684a324","html_url":"https://github.com/nickscha/mvx","commit_stats":null,"previous_names":["nickscha/mvx"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/nickscha/mvx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickscha%2Fmvx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickscha%2Fmvx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickscha%2Fmvx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickscha%2Fmvx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nickscha","download_url":"https://codeload.github.com/nickscha/mvx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickscha%2Fmvx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271746793,"owners_count":24813586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c89","mesh-voxelization","nostdlib","single-header","voxelizer"],"created_at":"2025-08-23T11:20:31.101Z","updated_at":"2025-08-23T11:20:32.716Z","avatar_url":"https://github.com/nickscha.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mvx\nA C89 standard compliant, single header, nostdlib (no C Standard Library) mesh voxelizer (MVX).\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/nickscha/mvx\"\u003e\u003cimg src=\"assets/mvx.png\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nFor more information please look at the \"mvx.h\" file or take a look at the \"examples\" or \"tests\" folder.\n\n\u003e [!WARNING]\n\u003e THIS PROJECT IS A WORK IN PROGRESS! ANYTHING CAN CHANGE AT ANY MOMENT WITHOUT ANY NOTICE! USE THIS PROJECT AT YOUR OWN RISK!\n\nThis is an example of a voxelized teddy .obj file (grid 100x100x100).\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/nickscha/mvx\"\u003e\u003cimg src=\"assets/teddy_voxel.gif\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Quick Start\n\nDownload or clone mvx.h and include it in your project.\n\n```C\n#include \"mvx.h\" /* Mesh Voxelizer */\n\nint main() {\n    /* Example: A unit cube mesh */\n    float vertices[] = {\n        0.0f, 0.0f, 0.0f,\n        1.0f, 0.0f, 0.0f,\n        1.0f, 1.0f, 0.0f,\n        0.0f, 1.0f, 0.0f,\n        0.0f, 0.0f, 1.0f,\n        1.0f, 0.0f, 1.0f,\n        1.0f, 1.0f, 1.0f,\n        0.0f, 1.0f, 1.0f};\n\n    unsigned long vertices_size = sizeof(vertices) / sizeof(vertices[0]);\n\n    /* Example: A unit cube mesh indices (two per face) */\n    int indices[] = {\n        0, 1, 2, 0, 2, 3, /* bottom */\n        4, 5, 6, 4, 6, 7, /* top    */\n        0, 1, 5, 0, 5, 4, /* front  */\n        1, 2, 6, 1, 6, 5, /* right  */\n        2, 3, 7, 2, 7, 6, /* back   */\n        3, 0, 4, 3, 4, 7  /* left   */\n    };\n\n    unsigned long indices_size = sizeof(indices) / sizeof(indices[0]);\n\n    /* Define a grid size where the voxelized mesh should fit into */\n    #define grid_x 20\n    #define grid_y 10\n    #define grid_z 10\n    unsigned char voxels[grid_x * grid_y * grid_z];\n\n    /* Voxelize the mesh with 1 cell padding */\n    if(!mvx_voxelize_mesh(\n        vertices, vertices_size, /* Mesh Vertices     */\n        indices, indices_size,   /* Mesh Indices      */\n        grid_x, grid_y, grid_z,  /* Grid Size         */\n        1, 1, 1,                 /* Grid Cell Padding */\n        voxels                   /* Output Voxels     */\n    )) {\n        return 1;\n    }\n\n    /* Afterwards you can access the voxels data  (x,y,z) like this */\n    {\n        int z, y, x;\n        for (z = 0; z \u003c grid_z; ++z)\n        {\n          for (y = grid_y - 1; y \u003e= 0; --y)\n          {\n            for (x = 0; x \u003c grid_x; ++x)\n            {\n              long idx = x + y * grid_x + z * grid_x * grid_y;\n              \n              if (voxels[idx]) {\n                /* Voxel is set */\n              }\n            }\n          }\n        }\n    }\n\n    return 0;\n}\n```\n\n## Run Example: nostdlib, freestsanding\n\nIn this repo you will find the \"examples/mvx_win32_nostdlib.c\" with the corresponding \"build.bat\" file which\ncreates an executable only linked to \"kernel32\" and is not using the C standard library and executes the program afterwards.\n\n## \"nostdlib\" Motivation \u0026 Purpose\n\nnostdlib is a lightweight, minimalistic approach to C development that removes dependencies on the standard library. The motivation behind this project is to provide developers with greater control over their code by eliminating unnecessary overhead, reducing binary size, and enabling deployment in resource-constrained environments.\n\nMany modern development environments rely heavily on the standard library, which, while convenient, introduces unnecessary bloat, security risks, and unpredictable dependencies. nostdlib aims to give developers fine-grained control over memory management, execution flow, and system calls by working directly with the underlying platform.\n\n### Benefits\n\n#### Minimal overhead\nBy removing the standard library, nostdlib significantly reduces runtime overhead, allowing for faster execution and smaller binary sizes.\n\n#### Increased security\nStandard libraries often include unnecessary functions that increase the attack surface of an application. nostdlib mitigates security risks by removing unused and potentially vulnerable components.\n\n#### Reduced binary size\nWithout linking to the standard library, binaries are smaller, making them ideal for embedded systems, bootloaders, and operating systems where storage is limited.\n\n#### Enhanced performance\nDirect control over system calls and memory management leads to performance gains by eliminating abstraction layers imposed by standard libraries.\n\n#### Better portability\nBy relying only on fundamental system interfaces, nostdlib allows for easier porting across different platforms without worrying about standard library availability.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickscha%2Fmvx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnickscha%2Fmvx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickscha%2Fmvx/lists"}