{"id":16126920,"url":"https://github.com/mikolalysenko/rle-mesh","last_synced_at":"2025-04-06T13:18:43.973Z","repository":{"id":6373399,"uuid":"7610812","full_name":"mikolalysenko/rle-mesh","owner":"mikolalysenko","description":"Mesh and surface extraction routines for narrow band level sets","archived":false,"fork":false,"pushed_at":"2013-08-14T15:40:08.000Z","size":716,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T08:35:17.036Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikolalysenko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-14T19:14:26.000Z","updated_at":"2020-10-18T04:45:40.000Z","dependencies_parsed_at":"2022-09-14T19:11:46.926Z","dependency_job_id":null,"html_url":"https://github.com/mikolalysenko/rle-mesh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikolalysenko%2Frle-mesh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikolalysenko%2Frle-mesh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikolalysenko%2Frle-mesh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikolalysenko%2Frle-mesh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikolalysenko","download_url":"https://codeload.github.com/mikolalysenko/rle-mesh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247485298,"owners_count":20946399,"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","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":[],"created_at":"2024-10-09T21:40:58.649Z","updated_at":"2025-04-06T13:18:43.955Z","avatar_url":"https://github.com/mikolalysenko.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"rle-mesh\n========\nMesh and surface extraction routines for narrow band level sets.  It is part of the [rle family of modules](https://github.com/mikolalysenko/rle-core).\n\nInstallation\n============\nVia npm:\n\n    npm install rle-mesh\n\nExample\n=======\nHere is how you can create a mesh for a solid object:\n\n    var volume = require(\"rle-sample\").solid.dense([-6,-6,-6], [7,7,7], function(x) {\n      return Math.sqrt(x[0]*x[0]+x[1]*x[1]+x[2]*x[2]) - 5.0;\n    });\n    var mesh = require(\"rle-mesh\")(volume);\n\nThis creates a mesh that looks like this:\n\n\u003cimg src=\"https://raw.github.com/mikolalysenko/rle-mesh/master/images/solid.png\" width=40%\u003e\n\n[You can also view the demo in your browser here](http://mikolalysenko.github.com/rle-mesh/examples/simple/www/index.html)\n\nrle-mesh can also handle multiphase level sets too.  Here is a more complicated example:\n\n    function sphere_dist(x) {\n      return Math.sqrt(x[0]*x[0]+x[1]*x[1]+x[2]*x[2]) - 5.0;\n    }\n    var volume = require(\"rle-sample\").dense([-6,-6,-6], [7,7,7], function(x) {\n      if(sphere_dist(x) \u003c 0) {\n        if(x[0] \u003c 0) {\n          return 1;\n        }\n        return 2;\n      }\n      return 0;\n    }, sphere_dist);\n    var mesh = require(\"rle-mesh\")(volume);\n\nThis creates a sphere with two distinct phases:\n\n![](https://raw.github.com/mikolalysenko/rle-mesh/master/images/multi.png)\n\n[Again, you can also look at the result in 3D using your web browser.](http://mikolalysenko.github.com/rle-mesh/examples/simpleMultiphase/www/index.html)\n\n`require(\"rle-mesh\")(volume[, lo, hi, solid_func])`\n===================================================\nThe main meshing method takes the following parameters:\n\n* `volume`: An RLE volume\n* `lo`: (Optional) Lower bounds on the volume to extract\n* `hi`: (Optional) Upper bounds on the volume to extract\n* `solid_func`: (Optional) A predicate that determines whether or not to display a voxel phase\n\nReturns: An object with the following properties\n* `positions`: An array of length 3 arrays representing the position of each vertex.\n* `faces`: An array of length 3 arrays representing the indexed faces of the mesh\n* `phases`: An array of length 2 arrays the same length as `faces` that has the phase on the front and back of each face.\n\nCredits\n=======\n(c) 2013 Mikola Lysenko\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikolalysenko%2Frle-mesh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikolalysenko%2Frle-mesh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikolalysenko%2Frle-mesh/lists"}