{"id":48682703,"url":"https://github.com/dragonfly-ai/mesh","last_synced_at":"2026-04-11T02:57:38.494Z","repository":{"id":125524392,"uuid":"577996311","full_name":"dragonfly-ai/mesh","owner":"dragonfly-ai","description":"A cross compiled Scala 3 library that provides accessible functionality to generate, manipulate, and export 3D mesh objects.  Currently supports .PLY, and .OBJ/.MTL file formats.","archived":false,"fork":false,"pushed_at":"2026-04-11T00:12:31.000Z","size":1272,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-04-11T02:20:09.652Z","etag":null,"topics":["3d-mesh","3d-mesh-generation","3d-mesh-models","3d-models","bolt","cube","cylinder","drum","jvm","mtl","obj","ply","scala-3","scala-js","scala-native","scalajs","screw"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dragonfly-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"dragonfly-ai"}},"created_at":"2022-12-14T02:18:33.000Z","updated_at":"2026-04-10T23:33:54.000Z","dependencies_parsed_at":"2025-12-30T08:02:43.167Z","dependency_job_id":null,"html_url":"https://github.com/dragonfly-ai/mesh","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/dragonfly-ai/mesh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragonfly-ai%2Fmesh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragonfly-ai%2Fmesh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragonfly-ai%2Fmesh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragonfly-ai%2Fmesh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dragonfly-ai","download_url":"https://codeload.github.com/dragonfly-ai/mesh/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragonfly-ai%2Fmesh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31667034,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"online","status_checked_at":"2026-04-11T02:00:05.776Z","response_time":54,"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":["3d-mesh","3d-mesh-generation","3d-mesh-models","3d-models","bolt","cube","cylinder","drum","jvm","mtl","obj","ply","scala-3","scala-js","scala-native","scalajs","screw"],"created_at":"2026-04-11T02:57:37.554Z","updated_at":"2026-04-11T02:57:38.487Z","avatar_url":"https://github.com/dragonfly-ai.png","language":"Scala","funding_links":["https://github.com/sponsors/dragonfly-ai"],"categories":[],"sub_categories":[],"readme":"# mesh\n\u0026nbsp;\u0026nbsp;\u0026nbsp;A cross compiled Scala 3 library that provides accessible functionality to generate, manipulate, and export triangular 3D mesh objects.  Currently supports .PLY, and .OBJ/.MTL file formats.\n\n\u003ch3\u003esbt\u003c/h3\u003e\n\n```scala\nlibraryDependencies += \"ai.dragonfly\" %%% \"mesh\" % \"\u003cLATEST_VERSION\u003e\"\n```\n\n\u003ch3\u003eFeatures:\u003c/h3\u003e\n\n- Fast, lightweight mesh generation for:\n    - Plane\n    - Cube\n    - Cylinder\n    - Drum\n    - Threaded Bolt\n    - Threaded Screw\n- Mesh file export to formats:\n    - PLY\n    - OBJ + MTL\n- Compiles to Scala JVM, Native, and JavaScript environments.\n\n\u003ch3\u003eExamples:\u003c/h3\u003e\n\n```scala\n// include these imports for all examples\nimport slash.vector.*\nimport slash.vector.Vec.*\nimport ai.dragonfly.mesh.shape.*\n```\n\u003ch4\u003ePlane\u003c/h4\u003e\n\n```scala\n// Plane\nPlane(\n  Vec[3](0, 0, 1),  // first corner\n  Vec[3](4, 0, 2),  // second corner\n  Vec[3](0, 4, 3),  // third corner\n  9,                // vertical segment count\n  12                // horizontal segment count\n)\n```\n\u003ch4\u003eCube\u003c/h4\u003e\n\n```scala\nCube.minimal( 1.0 /* side length */ )  // minimal\n\nCube()  // default parameters\n\nCube(\n  l = 1.0,         // side length\n  n = 64,          // number of segments\n  name = \"Cube\"    // mesh name\n)\n```\n\u003ch4\u003eCylinder\u003c/h4\u003e\n\n```scala\nCylinder() // default parameters\n\nCylinder(\n  angularSegments = 36,\n  sideSegments = 1,\n  baseSegments = 1,\n  capSegments = 1,\n  radius = 1.0,\n  height = 1.0\n)\n```\n\u003ch4\u003eDrum\u003c/h4\u003e\n\n```scala\nDrum() // default parameters\n\nDrum(\n  angularSegments = 12,\n  sideSegments = 1,\n  baseSegments = 1,\n  capSegments = 1,\n  baseRadius = 2.0,\n  capRadius = 1.0,\n  height = 1.0,\n  name = \"Drum\"\n)\n```\n\u003ch4\u003eThreaded Bolt\u003c/h4\u003e\n\n```scala\nBolt() // default parameters\n\nBolt(\n  length = 10.0,\n  threadsPerUnit = 3.0,\n  threadThickness = 0.1,\n  shankLength = 3.5,\n  angularSegments = 12,\n  threadRadius = 1.0,\n  coreRadius = 0.85,\n  name = \"Bolt\"\n)\n```\n\u003ch4\u003eThreaded Screw\u003c/h4\u003e\n\n```scala\nScrew() // default parameters\n\nScrew(\n  length = 7.0,\n  threadsPerUnit = 2.0,\n  threadThickness = 0.05,\n  shankLength = 1.5,\n  pointLength = 0.5,\n  angularSegments = 12,\n  threadRadius = 0.375,\n  coreRadius = 0.25,\n  name = \"Screw\"\n)\n```\n\n\u003ch3\u003eExporting to File Formats:\u003c/h3\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;The examples below demonstrate how to convert a mesh to a string that represents a PLY, MTL, or OBJ file, or how to write the mesh directly to an OutputStream.\n\n\u003ch3\u003ePLY:\u003c/h3\u003e\n\n```scala\nimport ai.dragonfly.mesh.shape.*\nimport ai.dragonfly.mesh.io.PLY\n\nval ply:String = PLY.fromMesh(  // generate a PLY file as a String\n  Cube(),                       // a mesh\n  vertexColorMapper = PLY.randomVertexColorMapper // a way to color the vertices.\n)\n\nval os:java.io.OutputStream = ...\n\nPLY.writeMesh(     // write directly to an output Stream\n  mesh = Cube(),   // a mesh\n  out = os,        // an output stream\n  vertexColorMapper = PLY.randomVertexColorMapper // a way to color the vertices.\n)\n```\n\n\n\u003ch3\u003eMTL:\u003c/h3\u003e\n\n```scala\nimport ai.dragonfly.mesh.io.MTL\n\nval material = MTL(\n  name,\n  diffuse,\n  ambient = gray,\n  specular = Specular(),\n  dissolve = 1f\n)\n\nval mtl:String = material.mtl   // generate an MTL file as a String\n\n\nval os:java.io.OutputStream = ...\n\nMTL.writeMTL(material, os)      // write directly to an output Stream\n```\n\n\u003ch3\u003eOBJ:\u003c/h3\u003e\n\n```scala\nimport ai.dragonfly.mesh.shape.*\nimport ai.dragonfly.mesh.io.OBJ\n\nval cube:Mesh = Cube()\n\nval obj:String = OBJ.fromMesh(  // generate an OBJ file as a String\n  mesh = cube,\n  name = cube.name,\n  comment = \"cube\",\n  materialLibraryFile = \"default.MTL\",\n  material = material,\n  smooth = true\n)\n\nval os:java.io.OutputStream = ...\n\nOBJ.writeMesh(   // write directly to an output Stream\n  mesh = cube,\n  out = os,\n  name = cube.name,\n  comment = \"cube\",\n  materialLibraryFileName = \"default.MTL\",\n  material = material\n)\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdragonfly-ai%2Fmesh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdragonfly-ai%2Fmesh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdragonfly-ai%2Fmesh/lists"}