Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Dec 3, 2020. It is now read-only.
/PolyPublic archive

🦕 Unofficial Google Poly SDK in Swift – search, discover, and download 3D models and scenes

License

NotificationsYou must be signed in to change notification settings

piemonte/Poly

Repository files navigation

Poly is an unofficialGoogle Poly SDK, written inSwift.

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

Build StatusPod VersionSwift VersionGitHub 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 theswift4.2 branch

Important

Before you begin, ensure that you have read Google’s Polydocumentation, 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 commandpod install or by running the makefile commandsmake setup && make pods.

# CocoaPodspod"Poly","~> 0.4.0"# Carthagegithub"piemonte/Poly" ~>0.4.0# Swift PMletpackage=Package(dependencies:[.Package(url:"https://github.com/piemonte/Poly",majorVersion:0)])

Alternatively, drop thesource 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 creationPoly.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 creationPoly.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)iniflet rootFileUrl= rootFileUrl{letnode=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 theauthToken property.

Documentation

You can findthe docs here. Documentation is generated withjazzy and hosted onGitHub-Pages.

Resources

License

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

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp