Skip to content

TomRoyls/nc_potree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nextcloud PointCloud Viewer ExApp

A Nextcloud External App (ExApp) that provides 3D point cloud viewing using Potree.

Features

  • WebGL-based Rendering: Uses Potree's octree LOD structure for large datasets
  • Format Support: Converts LAS, LAZ, and E57 files to Potree format on-demand
  • Smart Caching: Configurable cache duration (default: 30 days) with automatic cleanup
  • Event-Driven Cleanup: Reacts to file deletion events to remove cached point clouds
  • Progressive Loading: Loads appropriate detail levels based on camera distance
  • Admin Configuration: Declarative settings for cache duration and conversion options

Requirements

  • Nextcloud 28+ (tested on 32)
  • AppAPI enabled (included with Nextcloud 30+)
  • Docker for ExApp deployment
  • Minimum 4GB RAM for large point clouds
  • SSD recommended for conversion performance

Quick Start

1. Clone Repository

git clone https://github.com/your-username/nc_potree.git
cd nc_potree

2. Configure Environment

cp .env.example .env
# Edit .env with your Nextcloud URL and credentials

3. Build Docker Image

make build

4. Register with Nextcloud

make register

Architecture

┌─────────────────────────────────────────┐
│           NEXTCLOUD SERVER               │
│  ┌────────┐  ┌──────────────────┐ │
│  │ PHP App  │  │  Event Bus (TS) │ │
│  └────┬─────┘  └─────────┴─┘  │  │
│       │ Events      │  │
│  │ AppAPI/OCS API    ↓            │
│       ↓                                 │
└────────────────────────────────────────┘
            │
┌──────────────────────────────────────────┐
│  │    RUST EXAPP (Docker)             │
│  │  ┌────────┐  ┌──────────┐  │
│  │  │  │ Axum   │  │ Potree   │  │
│  │  │  │ Server  │  │ Converter │  │ Cache│  │
│  │  └────┬───┘  └─────┴─┘  └───┴───┘  │  │
└───────┼───────────┼───────────┼──┘───┼───┘───┘
            │
    ┌───────┴─────┘  └───────────────────────┴─┘
    ┌───────────────────────────┴───────────────┴─┐
    │ Persistent Storage                                  │
    │ /nc_app_nc_                                  │
    │  potree_data/                                   │
    │  ├── pointclouds/│                             │
    │  │   ├── {fileid}/│                            │
    │  │   │   ├── Potree│                            │
    │   │   │   ├── cloud.js │                    │
    │   │   │   ├── data/ │                    │
    │   │   │   └── metadata.json                 │
    │   │   └── cache_meta.json                      │
    └───────────────────────────────────────────────┘
    ┌───────────────────────────────────┴───────────────┴─┐
    │ File Actions UI  │
    └───────────────────────────────────────────────┘

Conversion Workflow

  1. User uploads .las, .laz, or .e57 file to Nextcloud
  2. Nextcloud fires NodeCreatedEvent
  3. ExApp receives event, downloads file via WebDAV
  4. For E57 files: converts to LAS using LAStools e572las
  5. For LAS/LAZ: converts directly using PotreeConverter 2.0
  6. Stores output in APP_PERSISTENT_STORAGE/{fileid}/ with:
    • cloud.js - Potree metadata and hierarchy
    • data/ - Octree node files (.las)
    • metadata.json - Conversion metadata
  7. Registers "View in 3D" file action
  8. User clicks action → Potree viewer loads point cloud

File Format Support

Format Conversion Path Notes
LAS PotreeConverter 2.0 Native support, fast conversion
LAZ PotreeConverter 2.0 Compressed LAS, requires laszip
E57 LAStools e572las → PotreeConverter Multi-scan support, pre-conversion required

Configuration Options

Admin Settings

  • Cache Duration: Number of days to cache converted point clouds (default: 30, min: 1)
  • Max File Size: Maximum size in GB for automatic conversion (default: 10)
  • Sampling Method: PotreeConverter sampling strategy (default: Poisson)
    • poisson: Better point distribution
    • poisson_average: Smoother results
    • random: Fastest conversion
  • Encoding: Compression format for output (default: Brotli)

Environment Variables

See .env.example for all configuration options.

Development

Build Dependencies

  • Rust 1.85+
  • Node 20+ (for frontend)
  • Docker 20+

Running Locally

# Start backend
cd app/ex_app/backend
cargo run

# Start frontend (in separate terminal)
cd app/ex_app/frontend
npm run dev

Testing

# Run Rust tests
cargo test

# Run TypeScript tests
npm test

# Run Playwright E2E tests
npm run test:e2e

Troubleshooting

Conversion Fails

  1. Check PotreeConverter build status: make check-potree
  2. Verify file format is supported
  3. Check disk space in persistent storage
  4. Review conversion logs in APP_PERSISTENT_STORAGE/conversion_logs/

Cache Issues

  1. Clear all caches via Nextcloud admin settings
  2. Verify CACHE_DURATION_DAYS is > 1
  3. Check file permissions on persistent storage

Performance Issues

  1. Use SSD for persistent storage
  2. Limit concurrent conversions
  3. Adjust sampling method (random is fastest)
  4. Enable Brotli encoding for smaller files

License

AGPL-3.0-or-later

Contributing

See CONTRIBUTING.md for development guidelines.

Support

A Nextcloud External App (ExApp) that provides 3D point cloud viewing using Potree.

Features

  • WebGL-based Rendering: Uses Potree's octree LOD structure for large datasets
  • Format Support: Converts LAS, LAZ, and E57 files to Potree format on-demand
  • Smart Caching: Configurable cache duration (default: 30 days) with automatic cleanup
  • Event-Driven Cleanup: Reacts to file deletion events to remove cached point clouds
  • Progressive Loading: Loads appropriate detail levels based on camera distance
  • Admin Configuration: Declarative settings for cache duration and conversion options

Requirements

  • Nextcloud 28+ (tested on 32)
  • AppAPI enabled (included with Nextcloud 30+)
  • Docker for ExApp deployment
  • Minimum 4GB RAM for large point clouds
  • SSD recommended for conversion performance

Quick Start

1. Clone Repository

git clone https://github.com/your-username/nc_potree.git
cd nc_potree

2. Configure Environment

cp .env.example .env
# Edit .env with your Nextcloud URL and credentials

3. Build Docker Image

make build

4. Register with Nextcloud

make register

Architecture

┌─────────────────────────────────────────────┐
│           NEXTCLOUD SERVER               │
│  ┌──────────┐  ┌──────────────────┐ │
│  │ PHP App  │  │  Event Bus (TS) │ │
│  └────┬─────┘  └─────────┬────────┘ │
│       │                   │ Events      │
│       │ AppAPI/OCS API    ↓            │
│       ↓                                 │
│  ┌──────────────────────────────────────┐ │
│  │    RUST EXAPP (Docker)             │ │
│  │  ┌────────┐  ┌──────────┐  ┌────┐  │ │
│  │  │ Axum   │  │ Potree   │  │Cache│  │ │
│  │  │ Server  │  │Converter │  │Mgr  │  │ │
│  │  └────┬───┘  └────┬─────┘  └──┬──┘  │ │
│  └───────┼──────────────┼──────────┼──────┘  │
└───────────┼──────────────┼──────────┼─────────────┘
            │              │          │
    ┌───────┴──────┐     │          │
    │ Persistent Storage│     │          │
    │ /nc_app_nc_    │     │          │
    │  potree_data/   │     │          │
    │  ├── pointclouds/│     │          │
    │  │   ├── {fileid}/│     │          │
    │  │   │   └── Potree│     │          │
    │  └── cache_meta.json│     │          │
    └──────────────────────┘     │          │
                               ┌──────────┴──────┐
                               │ File Actions UI  │
                               └───────────────────┘

Conversion Workflow

  1. User uploads .las, .laz, or .e57 file to Nextcloud
  2. Nextcloud fires NodeCreatedEvent
  3. ExApp receives event, downloads file via WebDAV
  4. For E57 files: converts to LAS using LAStools e572las
  5. For LAS/LAZ: converts directly using PotreeConverter 2.0
  6. Stores output in APP_PERSISTENT_STORAGE/{fileid}/ with:
    • cloud.js - Potree metadata and hierarchy
    • data/ - Octree node files (.las)
    • metadata.json - Conversion metadata
  7. Registers "View in 3D" file action
  8. User clicks action → Potree viewer loads point cloud

File Format Support

Format Conversion Path Notes
LAS PotreeConverter 2.0 Native support, fast conversion
LAZ PotreeConverter 2.0 Compressed LAS, requires laszip
E57 LAStools e572las → PotreeConverter Multi-scan support, pre-conversion required

Configuration Options

Admin Settings

  • Cache Duration: Number of days to cache converted point clouds (default: 30, min: 1)
  • Max File Size: Maximum size in GB for automatic conversion (default: 10)
  • Sampling Method: PotreeConverter sampling strategy (default: Poisson)
    • poisson: Better point distribution
    • poisson_average: Smoother results
    • random: Fastest conversion

Environment Variables

See .env.example for all configuration options.

Development

Build Dependencies

  • Rust 1.85+
  • Node 20+ (for frontend)
  • Docker 20+

Running Locally

# Start backend
cd app/ex_app/backend
cargo run

# Start frontend (in separate terminal)
cd app/ex_app/frontend
npm run dev

Testing

# Run Rust tests
cargo test

# Run TypeScript tests
npm run test

# Run Playwright E2E tests
npm run test:e2e

Troubleshooting

Conversion Fails

  1. Check PotreeConverter build status: make check-potree
  2. Verify file format is supported
  3. Check disk space in persistent storage
  4. Review conversion logs in APP_PERSISTENT_STORAGE/conversion_logs/

Cache Issues

  1. Clear all caches via Nextcloud admin settings
  2. Verify CACHE_DURATION_DAYS is > 1
  3. Check file permissions on persistent storage

Performance Issues

  1. Use SSD for persistent storage
  2. Limit concurrent conversions
  3. Adjust sampling method (random is fastest)
  4. Enable Brotli encoding for smaller files

License

AGPL-3.0-or-later

Contributing

See CONTRIBUTING.md for development guidelines.

Support

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors