Overview
The Reality Capture API lets you generate 3D models, point clouds, and orthophotos from photographs using photogrammetry. You provide a set of overlapping images of an object or scene, and APS processes them into a 3D model in your chosen output format.
Typical workflow:
- Authenticate — get a 2-legged token.
- Create a photoscene — define the output format.
- Upload images — send your photographs to the photoscene.
- Process — trigger photogrammetry processing.
- Poll for completion — wait until the model is ready.
- Download — retrieve the finished 3D model.
Authentication
library(AutoDeskR)
tok <- getToken(
id = Sys.getenv("client_id"),
secret = Sys.getenv("client_secret"),
scope = "data:read data:write data:create"
)Create a Photoscene
ps <- createPhotoscene(
name = "building-survey",
format = "obj",
token = tok
)
photoscene_id <- ps$content$photoscene$photosceneidSupported output formats:
| Format | Description |
|---|---|
rcm |
ReCap point cloud (default) |
rcs |
ReCap scan |
obj |
Wavefront OBJ mesh |
ortho |
Orthophoto |
report |
Quality report only |
Upload Images
Provide a character vector of local file paths. The Reality Capture API supports JPEG and PNG images. For best results, use 20–300 overlapping photos with at least 60% overlap between adjacent shots.
image_files <- list.files("~/survey-photos", pattern = "\\.jpg$", full.names = TRUE)
imgs <- uploadImages(
photoscene_id = photoscene_id,
files = image_files,
token = tok
)Start Processing
proc <- processPhotoscene(
photoscene_id = photoscene_id,
token = tok
)Wait for Completion
Processing is asynchronous and can take several minutes to hours
depending on the number of images. Use waitForPhotoscene()
to block until it finishes:
done <- waitForPhotoscene(
photoscene_id = photoscene_id,
token = tok,
interval = 30, # poll every 30 seconds
timeout = 3600, # give up after 1 hour
verbose = TRUE
)Or poll manually with checkPhotoscene():
status <- checkPhotoscene(photoscene_id = photoscene_id, token = tok)
status$content$photoscene$progress # e.g. "75"
status$content$photoscene$progressmsg # e.g. "Processing..."Download the Result
Once processing reaches 100%, download the output via the Model Derivative API. First get the output URN from the manifest, then download the file:
encoded_urn <- jsonlite::base64_enc(photoscene_id)
manifest <- getOutputUrn(urn = encoded_urn, token = tok)
encoded_output <- jsonlite::base64_enc(manifest$content$derivatives[[1]]$children[[1]]$urn)
result <- downloadFile(
urn = encoded_urn,
output_urn = encoded_output,
token = tok,
destfile = "building-survey.obj"
)