Poly is an unofficial Google Poly SDK, written in Swift

Overview

Poly

Poly is an unofficial Google Poly SDK, written in Swift.

This library makes it easy to integrate with Google Poly while providing a few additional client-side features.

Build Status Pod Version Swift Version GitHub license

Features
🔍 3D model search
3D model download management
📦 advanced 3D data caching
📡 Poly reachability support
🐦 Swift 5.0

Need a different version of Swift?

  • 5.0 - Target your Podfile to the latest release or master (will push when Cache updates)
  • 4.2 - Target your Podfile to the swift4.2 branch

Important

Before you begin, ensure that you have read Google’s Poly documentation, understand best practices for attribution, and have generated your API key.

Quick Start

The sample project provides several examples for integration.

You can install the dependencies with the command pod install or by running the makefile commands make setup && make pods.

0.4.0" # Carthage github "piemonte/Poly" ~> 0.4.0 # Swift PM let package = Package( dependencies: [ .Package(url: "https://github.com/piemonte/Poly", majorVersion: 0) ] ) ">
# CocoaPods

pod "Poly", "~> 0.4.0"

# Carthage

github "piemonte/Poly" ~> 0.4.0

# Swift PM

let package = Package(
    dependencies: [
        .Package(url: "https://github.com/piemonte/Poly", majorVersion: 0)
    ]
)

Alternatively, drop the source files into your Xcode project.

Examples

Import the library.

import Poly

Setup your API key.

Poly.shared.apiKey = "REPLACE_WITH_API_KEY"

List assets using keywords.

Poly.shared.list(assetsWithKeywords: ["fox"]) { (assets, totalCount, nextPage, error) in
	// assets array provides objects with information such as URLs for thumbnail images
}

// you may also query for the data directly for your own model creation

Poly.shared.list(assetsWithKeywords: ["fox", "cat"]) { (data, error) in
}

Get independent asset information.

Poly.shared.get(assetWithIdentifier: "10u8FYPC5Br") { (asset, count, page, error) in
	// asset object provides information such as URLs for thumbnail images
}

// you may also query for the data directly for your own model creation

Poly.shared.get(assetWithIdentifier: "10u8FYPC5Br") { (data, error) in
}

Download a 3D asset and its resources for rendering, either using the asset identifier or the asset model object itself.

Poly.shared.download(assetWithIdentifier: "10u8FYPC5Br", progressHandler: { (progress) in
}) { (rootFileUrl, resourceFileUrls, error) in
    if let rootFileUrl = rootFileUrl {
        let node = SCNNode.createNode(withLocalUrl: rootFileUrl)
        self._arView?.scene.rootNode.addChildNode(node)
    }
}

The API also provides private object loading but additional endpoints may need to be added. Auth support is setup and available via the authToken property.

Documentation

You can find the docs here. Documentation is generated with jazzy and hosted on GitHub-Pages.

Resources

License

Poly is available under the MIT license, see the LICENSE file for more information.

You might also like...
Unofficial Notion API SDK for iOS & macOS
Unofficial Notion API SDK for iOS & macOS

NotionSwift Unofficial Notion SDK for iOS & macOS. This is still work in progress version, the module interface might change. API Documentation This l

The unofficial Instagram iOS SDK

InstagramKit An extensive Objective C wrapper for the Instagram API, completely compatible with Swift. Here's a quick example to retrieve trending med

Px-mobile-sdk-demo-app - PerimeterX Mobile SDK - Demo App
Px-mobile-sdk-demo-app - PerimeterX Mobile SDK - Demo App

About PerimeterX PerimeterX is the leading provider of application security solu

Alter SDK is a cross-platform SDK consisting of a real-time 3D avatar system, facial motion capture, and an Avatar Designer component built from scratch for web3 interoperability and the open metaverse.
Alter SDK is a cross-platform SDK consisting of a real-time 3D avatar system, facial motion capture, and an Avatar Designer component built from scratch for web3 interoperability and the open metaverse.

Alter SDK is a cross-platform SDK consisting of a real-time 3D avatar system, facial motion capture, and an Avatar Designer component built from scratch for web3 interoperability and the open metaverse.

The Unofficial Apple iOS Swift Calendar View. Swift calendar Library. iOS calendar Control. 100% Customizable
The Unofficial Apple iOS Swift Calendar View. Swift calendar Library. iOS calendar Control. 100% Customizable

Q: How will my calendar dateCells look with this library? A: However you want them to look. More Images Features Range selection - select dates in a r

Wanikani-swift - Unofficial Swift client for the WaniKani API

WaniKani A Swift library and client for the WaniKani REST API. It currently supp

Google Directions API helper for iOS, written in Swift
Google Directions API helper for iOS, written in Swift

PXGoogleDirections Google Directions API SDK for iOS, entirely written in Swift. 🗺 Features Supports all features from the Google Directions API as o

iOS Slide Menu View based on Google+, iQON, Feedly, Ameba iOS app.  It is written in pure swift.
iOS Slide Menu View based on Google+, iQON, Feedly, Ameba iOS app. It is written in pure swift.

SlideMenuControllerSwift iOS Slide View based on iQON, Feedly, Google+, Ameba iPhone app. Installation CocoaPods pod 'SlideMenuControllerSwift' Carth

A Google like action sheet for iOS written in Swift.
A Google like action sheet for iOS written in Swift.

MaterialActionSheetController Lightweight and totally customizable. Create and present it the way you do with UIAlertController. Screenshots Demo | De

Google Directions API helper for iOS, written in Swift
Google Directions API helper for iOS, written in Swift

PXGoogleDirections Google Directions API SDK for iOS, entirely written in Swift. 🗺 Features Supports all features from the Google Directions API as o

An unofficial supported Swift client library for accessing News API.

An unofficial supported Swift client library for accessing News API.

Unofficial GitHub API client in Swift
Unofficial GitHub API client in Swift

Github.swift ❤️ Support my apps ❤️ Push Hero - pure Swift native macOS application to test push notifications PastePal - Pasteboard, note and shortcut

IOS - Unofficial app for Swift Evolution
IOS - Unofficial app for Swift Evolution

EVOlution - iOS The goal of this project is for the version 1.0 was: bring to iOS the experience provided by Swift Evolution website. Now we are shift

An unofficial wrapper around FSEvent tailored for Swift 5.

EonilFSEvents Eonil 2018 Maintenance. 2019 Maintenance. It's possible to use FSEvents directly in Swift, but it still involves many boilerplate works

An unofficial version of the Sandwiches app and pre-built materials similar to those used in the Introduction to SwiftUI session video from WWDC20

Unofficial Sandwiches The WWDC20 Session Introduction to SwiftUI provides a tutorial-like walk-through of building a list-detail SwiftUI app from scra

EU Digital COVID Certificate Kit for the Apple Platform  (unofficial)
EU Digital COVID Certificate Kit for the Apple Platform  (unofficial)

EU Digital COVID Certificate Kit A Swift Package to decode, verify and validate EU Digital COVID Certificates for iOS, tvOS, watchOS and macOS Disclai

Unofficial Yandex Music API
Unofficial Yandex Music API

YM-API - Unofficial Swift Yandex Music Library Fully ported Yandex Music API Swift implementation. Russian Readme (Readme на русском) Thanks to Marsha

An unofficial E-Hentai App for iOS built with SwiftUI.
An unofficial E-Hentai App for iOS built with SwiftUI.

EhPanda An unofficial E-Hentai App for iOS. English・ Deutsch・ 한국어・ 日本語・ 繁體中文・ 简体中文 📢 Translations Wanted 📢 Please submit a pull request if you want

iCome Out is an open source project of an unofficial Pornub app for iPhone and iPad
iCome Out is an open source project of an unofficial Pornub app for iPhone and iPad

iCome Out is an open source project of an unofficial Pornub app for iPhone and iPad, written in Swift with some cool features Getting Started Prerequi

Comments
  • Cannot choose format for Poly.download

    Cannot choose format for Poly.download

    Poly.download(asset: [...]) just returns the first defined format for the asset. It should have a parameter to choose the asset type, as usually .gltf is returned which is not that usable in IOS.

    enhancement 
    opened by skpinelabs 2
  • Add Choice of Model Format to Poly Download

    Add Choice of Model Format to Poly Download

    It currently is not possible to specify the format of the model to download. This PR adds that capability.

    This PR is a draft so I would welcome feedback from the owner on how to improve it and make it mergable.

    opened by skpinelabs 1
Owner
patrick piemonte
if it ain't broke, fix it.
patrick piemonte
Smart Online Shopping iOS App with Augmented Reality (AR) and simple Social Media features using SwiftUI and Google Firebase Cloud Services

Table of contents App Demo How to Run Context Content How it's written Inspiration App Demo AR.online.shopping.iOS.demo.mp4 How to Run First make sure

Ashkan Goharfar 13 Nov 1, 2022
PlacenoteSDK Sample app in native iOS using ARKit, written primarily in Swift

Placenote SDK for iOS Placenote SDK lets you easily build cloud-based Augmented Reality (AR) apps that pin digital content to locations in the real wo

Placenote 93 Nov 15, 2022
This is a sample AR project written with Swift language for iOS devices

ARSample This is a sample AR project written with Swift language for iOS devices. While I was learning the ARKit framework, I defined this project and

Kamyar Sehati 2 Jun 27, 2022
Swift framework for loading various 3d models in SceneKit

AssetImportKit AssetImportKit is a cross platform library (macOS, iOS) that coverts the files supported by Assimp to SceneKit scenes. Features AssetIm

eugene 74 Nov 30, 2022
Unofficial Google ARCore Swift Package for iOS

Google didn't want to make a swift package for ARCore… so let's do it instead.

Max Cobb 4 Jul 15, 2022
Google Analytics tracker for Apple tvOS provides an easy integration of Google Analytics’ measurement protocol for Apple TV.

Google Analytics tracker for Apple tvOS by Adswerve About Google Analytics tracker for Apple tvOS provides an easy integration of Google Analytics’ me

Adswerve 81 Nov 13, 2022
Google-Blogger-iOS-App - Using Google Blogger API to build an iOS app like Medium

Google Blogger iOS App Using Google Blogger API to build an iOS app like Medium!

Ricky Chuang 9 Dec 13, 2022
👤 Framework to Generate Random Users - An Unofficial Swift SDK for randomuser.me

RandomUserSwift is an easy to use Swift framework that provides the ability to generate random users and their accompanying data for your Swift applic

Wilson Ding 95 Sep 9, 2022
👤 Framework to Generate Random Users - An Unofficial Swift SDK for randomuser.me

RandomUserSwift is an easy to use Swift framework that provides the ability to generate random users and their accompanying data for your Swift applic

Wilson Ding 95 Sep 9, 2022
Unofficial iOS/macOS SDK for the Notion API.

NotionClient: a Notion SDK for iOS & macOS Unofficial Notion API SDK for iOS & macOS. This is an alpha version and still work in progress. TODO Featur

David De Bels 15 Aug 4, 2022