Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ctreffs/swiftassimp
Swift wrapper around Open Asset Import Library (aka assimp) for macOS and Linux
https://github.com/ctreffs/swiftassimp
assimp bsd-3-clause library spm swift swift-package-manager
Last synced: 8 days ago
JSON representation
Swift wrapper around Open Asset Import Library (aka assimp) for macOS and Linux
- Host: GitHub
- URL: https://github.com/ctreffs/swiftassimp
- Owner: ctreffs
- License: bsd-3-clause
- Created: 2019-10-30T17:57:29.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-23T17:37:49.000Z (16 days ago)
- Last Synced: 2024-10-24T01:36:05.730Z (16 days ago)
- Topics: assimp, bsd-3-clause, library, spm, swift, swift-package-manager
- Language: Swift
- Homepage: https://www.assimp.org
- Size: 18.6 MB
- Stars: 30
- Watchers: 3
- Forks: 5
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Swift Assimp
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fctreffs%2FSwiftAssimp%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/ctreffs/SwiftAssimp)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fctreffs%2FSwiftAssimp%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/ctreffs/SwiftAssimp)
[![macOS](https://github.com/ctreffs/SwiftAssimp/actions/workflows/ci-macos.yml/badge.svg)](https://github.com/ctreffs/SwiftAssimp/actions/workflows/ci-macos.yml)
[![Linux](https://github.com/ctreffs/SwiftAssimp/actions/workflows/ci-linux.yml/badge.svg)](https://github.com/ctreffs/SwiftAssimp/actions/workflows/ci-linux.yml)
[![license](https://img.shields.io/badge/license-BSD3-brightgreen.svg)](LICENSE)This is a **thin** Swift wrapper around the popular and excellent [**Open Asset Import Library**](https://github.com/assimp/assimp) library.
It provides a **swifty** and **typesafe** API.> Open Asset Import Library (short name: Assimp) is a portable Open Source library to import various well-known 3D model formats in a uniform manner. The most recent version also knows how to export 3d files and is therefore suitable as a general-purpose 3D model converter.
> Loads 40+ 3D file formats into one unified and clean data structure.
> ~ [www.assimp.org](https://github.com/assimp/assimp)## 🚀 Getting Started
These instructions will get your copy of the project up and running on your local machine and provide a code example.
### 📋 Prerequisites
* [Swift Package Manager (SPM)](https://github.com/apple/swift-package-manager)
* [Open Asset Import Library (Assimp)](https://github.com/assimp/assimp)
* [SwiftEnv](https://swiftenv.fuller.li/) for Swift version management - (optional)
* [Swiftlint](https://github.com/realm/SwiftLint) for linting - (optional)### 💻 Installing
Swift Assimp is available for all platforms that support [Swift 5.3](https://swift.org/) and higher and the [Swift Package Manager (SPM)](https://github.com/apple/swift-package-manager).
Extend your `Package.swift` file with the following lines or use it to create a new project.
For package manifests using the Swift 5.3+ toolchain use:
```swift
// swift-tools-version:5.3
import PackageDescriptionlet package = Package(
name: "YourPackageName",
dependencies: [
.package(name: "Assimp", url: "https://github.com/ctreffs/SwiftAssimp.git", from: "2.1.0")
],
targets: [
.target(
name: "YourTargetName",
dependencies: ["Assimp"])
]
)```
Since it's a system library wrapper you need to install the assimp library (>=5.0.0) either via
```sh
brew install assimp
```or
```sh
apt-get install libassimp-dev
```depending on you platform.
## 📝 Code Example
```swift
import Assimplet scene: AiScene = try AiScene(file: ,
flags: [.removeRedundantMaterials, .genSmoothNormals]))// get meshes
let meshes: [AiMesh] = scene.meshes// get materials
let matrials: [AiMaterial] = scene.materials// get the root node of the scene graph
let rootNode: [AiNode] = scene.rootNode```
See the unit tests for more examples.
## 💁 Help needed
This project is in an early stage and needs a lot of love.
If you are interested in contributing, please feel free to do so!Things that need to be done are, among others:
- [ ] Wrap more assimp functions and types
- [ ] Support for [Cocoapods](https://cocoapods.org) packaging
- [ ] Support for [Carthage](https://github.com/Carthage/Carthage) packaging
- [ ] Write some additional tests to improve coverage## 🏷️ Versioning
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/ctreffs/SwiftAssimp/tags).
## ✍️ Authors
* [Christian Treffs](https://github.com/ctreffs)
See also the list of [contributors](https://github.com/ctreffs/SwiftAssimp/contributors) who participated in this project.
## 🔏 Licenses
This project is licensed under the 3-Clause BSD License - see the [LICENSE](LICENSE) file for details.
* assimp licensed under [3-clause BSD license](https://github.com/assimp/assimp/blob/master/LICENSE)
## 🙏 Original code
Since Swift Assimp is merely a wrapper around [**assimp**](https://github.com/assimp/assimp) it obviously depends on it.
Support them if you can!### Open Asset Import Library (assimp)
##### From [assimp/assimp/Readme.md](https://github.com/assimp/assimp/blob/master/Readme.md):
A library to import and export various 3d-model-formats including scene-post-processing to generate missing render data.
One-off donations via PayPal:
[![PayPal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4JRJVPXC4QJM4)## ☮️ Alternatives
* [dmsurti/AssimpKit](https://github.com/dmsurti/AssimpKit)
* [eugenebokhan/AssetImportKit](https://github.com/eugenebokhan/AssetImportKit)
* [troughton/CAssimp](https://github.com/troughton/CAssimp)