{"id":25000065,"url":"https://github.com/tomasf/manifold-swift","last_synced_at":"2025-03-29T18:43:13.629Z","repository":{"id":272429856,"uuid":"898921376","full_name":"tomasf/manifold-swift","owner":"tomasf","description":"Swift interface to the Manifold solid mesh geometry library","archived":false,"fork":false,"pushed_at":"2025-01-14T14:50:09.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-07T12:17:44.773Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","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/tomasf.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}},"created_at":"2024-12-05T09:39:59.000Z","updated_at":"2025-01-14T14:50:14.000Z","dependencies_parsed_at":"2025-01-14T11:53:29.369Z","dependency_job_id":"5037409a-d367-4a87-abf2-7f8fd7faecc6","html_url":"https://github.com/tomasf/manifold-swift","commit_stats":null,"previous_names":["tomasf/manifold-swift"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasf%2Fmanifold-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasf%2Fmanifold-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasf%2Fmanifold-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomasf%2Fmanifold-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomasf","download_url":"https://codeload.github.com/tomasf/manifold-swift/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246230500,"owners_count":20744346,"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":"2025-02-04T19:31:10.739Z","updated_at":"2025-03-29T18:43:13.611Z","avatar_url":"https://github.com/tomasf.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Manifold-Swift\n\nA Swift interface to the [Manifold geometry library](https://github.com/elalish/manifold), for manipulation of solid 3D meshes. \n\n![CI status](https://github.com/tomasf/manifold-swift/actions/workflows/swift.yml/badge.svg) ![Platforms](https://img.shields.io/badge/Platforms-macOS_%7C_iOS_%7C_tvOS_%7C_watchOS_%7C_visionOS_%7C_Linux_%7C_Windows-47D?logo=swift\u0026logoColor=white)\n\nThis SPM package includes Manifold, as well as its dependencies Clipper2 and oneTBB as Git submodules, so no additional dependencies are needed beyond the C++ standard library. Manifold-Swift covers most of the Manifold API, and naming is similar but using Swift conventions. It works on all Apple platforms as well as Linux and Windows. \n\nDue to a bug in Swift that isn't fixed in the latest release (as of 2025-01-13, version 6.0.3), the library requires a recent development snapshot of Swift to build on Windows.\n\n## Usage\n\nAdd the package as a dependency in your Package.swift (or Xcode project). Because the library interfaces with C++, you need to enable C++ interoperability.\n\n```swift\nlet package = Package(\n    name: \"manifold-swift-example\",\n    dependencies: [\n        .package(url: \"https://github.com/tomasf/manifold-swift.git\", .upToNextMinor(from: \"0.1.0\"))\n    ],\n    targets: [\n        .executableTarget(\n            name: \"manifold-swift-example\",\n            dependencies: [.product(name: \"Manifold\", package: \"manifold-swift\")],\n            swiftSettings: [.interoperabilityMode(.Cxx)]\n        )\n    ]\n)\n```\n\n## Example\n\nThe library uses protocols for vectors and matrices, so you can add conformance to your own types and send them in without conversion.\n\n```swift\nimport Manifold3D\n\nstruct V: Vector3 {\n    let x: Double\n    let y: Double\n    let z: Double\n}\n\nlet sphere = Manifold.sphere(radius: 10, segmentCount: 25)\nlet box = Manifold.cube(size: V(x: 12, y: 20, z: 20))\n    .rotate(V(x: 20, y: 25, z: 0))\nlet difference = sphere.boolean(.difference, with: box)\n\nlet meshGL = difference.meshGL()\n// Render or save meshGL.vertices, meshGL.triangles, etc.\n```\n\nRead the [Manifold documentation](https://manifoldcad.org/docs/html) for more information.\n\n## Contributions\n\nContributions are welcome! Submit pull requests or open issues to discuss improvements or report bugs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasf%2Fmanifold-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomasf%2Fmanifold-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomasf%2Fmanifold-swift/lists"}