Skip to main content

Running Analysis Guide

This guide covers how to run various analysis operations on your Voyager projects programmatically, including mesh generation, wall thickness analysis, and integrity checks.

Overview

Voyager provides several analysis operations that can be triggered via the API:
  • Mesh Generation - Create 3D meshes from scan data
  • Wall Thickness Analysis - Measure wall thickness throughout a part
  • Integrity Analysis - Detect defects and anomalies
  • CAD Comparison - Compare scan data to CAD models
  • Auto-Alignment - Automatically align scan data

Mesh Generation

Generate Basic Mesh

  • Python
from api_client import LumafieldAPIClient

client = LumafieldAPIClient(api_url, email, password)

# Generate mesh
result = client.run_project_mesh(project_id)
print(f"Mesh generation started: {result}")

Generate Textured Mesh

  • Python
# Generate textured mesh
result = client.create_project_textured_mesh(project_id)
print(f"Textured mesh generation started: {result}")

Wall Thickness Analysis

  • Python
# Run wall thickness analysis
result = client.run_project_wall_thickness(project_id)
print(f"Wall thickness analysis started: {result}")

Integrity Analysis

  • Python
# Run integrity analysis
result = client.run_project_integrity_analysis(project_id)
print(f"Integrity analysis started: {result}")

CAD Comparison

  • Python
# Run mesh comparison
result = client.run_project_mesh_compare(project_id)
print(f"CAD comparison started: {result}")

Auto-Alignment

  • Python
# Run auto-alignment
result = client.run_project_auto_align_lite(project_id)
print(f"Auto-alignment started: {result}")

Checking Analysis Status

Get Project Status

  • Python
# Check project status
status = client.get_project_status(project_id)
print(f"Project status: {status}")

# Status includes information about running analyses

Polling for Completion

  • Python
import time

def wait_for_analysis(project_id, max_wait=3600):
    """Wait for analysis to complete"""
    start_time = time.time()
    
    while time.time() - start_time < max_wait:
        status = client.get_project_status(project_id)
        
        # Check if analysis is complete
        # (Status structure depends on analysis type)
        
        time.sleep(30)  # Check every 30 seconds
    
    raise TimeoutError("Analysis not complete after maximum wait time")

Recipe Invocations

List Recipe Invocations

  • Python
# Get recipe invocations for a project
invocations = client.get_project_recipe_invocations(project_id)

for invocation in invocations['results']:
    print(f"Recipe: {invocation['recipe']['name']}")
    print(f"State: {invocation['state']}")

Run Recipe

  • Python
# Run a specific recipe
recipe_pk = "recipe-uuid"
result = client.run_project_recipe(project_id, recipe_pk)
print(f"Recipe execution started: {result}")

Best Practices

1. Check Project Readiness

Ensure the project has completed processing before running analyses:
project = client.get_project(project_id)
if project['status'] != 'ready':
    print("Project not ready for analysis")
    return

2. Monitor Analysis Progress

Implement proper polling with timeouts:
def monitor_analysis(project_id, check_interval=30, max_wait=3600):
    start = time.time()
    while time.time() - start < max_wait:
        status = client.get_project_status(project_id)
        # Check completion status
        if is_complete(status):
            return status
        time.sleep(check_interval)
    raise TimeoutError("Analysis timeout")

3. Handle Errors

try:
    result = client.run_project_mesh(project_id)
except requests.exceptions.HTTPError as e:
    if e.response.status_code == 400:
        print("Invalid request - check project state")
    elif e.response.status_code == 403:
        print("Insufficient permissions")
    else:
        raise

Next Steps