Skip to contents

Launches a standalone, GPU-accelerated interactive 3D WebGL viewer for both Gaussian Splats and Agisoft Metashape / COLMAP point clouds with zero external server dependencies.

Features include:

  • Online Real-Time Noise Filter (SOR / Density Filter): Prunes spatial outlier noise live in the browser using a high-speed 3D spatial voxel grid.

  • 3D Measurement Ruler (Tape Measure): Interactive point-to-point Euclidean 3D distance and component dimension measurement.

  • Camera Projection Mode Toggle: Instant switching between Perspective and Orthographic CAD views.

  • RealityCapture Reconstruction Region (3D Clipping Box): Interactive 6-plane section clipping to isolate plant stems and foliage.

  • Direct Client-Side Export: Export clean filtered point clouds (.ply binary / .txt) and calibrated camera poses (.txt COLMAP) directly to download.

  • Multi-Engine Shading Modes: Photorealistic RGB, Studio Clay (geometry surface inspection), Elevation Heatmap, Point Density Map, and SAM Classes.

  • Zero Server Dependencies: 100% client-side HTML5 WebGL running locally in Google Chrome / Edge without Shiny, Node.js or Python.

  • Direct File Import & Drag-and-Drop: Load .ply, .splat, or COLMAP points3D.txt files directly into the 3D canvas anytime!

  • COLMAP / Metashape 3D Camera Frustums: Pyramidal camera view cones and magenta sight lines in 3D world space.

  • Interactive Photo Inspection: Click on any camera frustum in 3D to open a floating photo viewer modal with high-res thumbnails, camera metadata, and photo cycling!

  • "Look Through Camera" View: Align the 3D scene camera directly with any photo pose to inspect point cloud alignment from that exact shot's perspective.

  • Metashape Navigation Trackball: Translucent smooth glass 3D sphere (customizable opacity, zero wireframe clutter) with colored Pitch (X), Roll (Y), and Yaw (Z) gimbal rings.

  • Direct 3D Axis Dragging: Click and drag directly on the X, Y, or Z rings in the 3D viewport to rotate the model.

  • 3-Axis Model Alignment: Interactive sliders, step buttons (+/-90°, +/-15°), and code copy to level tilted models horizontally.

  • Double-Click Pivot Focusing: Double click anywhere on the model to set the orbit pivot and center the Trackball Sphere.

  • Dual Rendering Engines: Switch between crisp Metashape-style point pixels and volumetric continuous Gaussian splats.

  • Splat Surface Closure: Continuous alpha-blending slider to seal gaps and form solid watertight surfaces.

  • Subject Cluster Framing: Automatically frames the camera tightly on the main object rather than distant room walls.

  • Real-Time 3D Coordinates: Dynamic coordinate tracking in world space on mouse hover.

Usage

gs_viewer(
  splat = NULL,
  cameras = NULL,
  images = NULL,
  show_cameras = TRUE,
  sight_lines = TRUE,
  camera_size = 1,
  texture = NULL,
  thumbnails = c("on_demand", "embedded", "none"),
  file = NULL,
  browser = TRUE,
  browser_path = NULL,
  mode = c("points", "splats", "mesh"),
  color_by = c("rgb", "clay", "height", "density", "semantic"),
  point_size = 3.5,
  trackball = TRUE,
  sphere_opacity = 0.04,
  rotation = c(0, 0, 0),
  bg = c("dark", "light"),
  title = "3D Point Cloud & Gaussian Splat Viewer [pliman]",
  unit_scale = NULL,
  tools = TRUE,
  focus_subject = TRUE,
  min_opacity = 0.2
)

Arguments

splat

Optional. An object of class gaussian_splat (e.g. from gs_import_metashape() or gs_fit()), colmap_sfm, or a character string path to a .ply, .splat, or .txt file. If NULL (default), launches a standalone viewer in import mode with a drag-and-drop interface.

cameras

Optional camera poses. Can be a list of camera objects (e.g. from gs_import_cameras_colmap()), or a character string path to a COLMAP sparse directory (e.g. "sparse/0"), images.txt, or exported text cameras.

images

Optional path to the directory containing the original photos (e.g. "my_photos/"). If provided, clicking on any 3D camera frustum will display that photo in a floating viewer modal!

show_cameras

Logical. If TRUE (default when cameras are provided), displays 3D camera frustums.

sight_lines

Logical. If TRUE (default), displays magenta sight rays connecting each camera to the subject center.

camera_size

Numeric scalar. Initial scale factor for 3D camera frustums. Defaults to 1.0.

texture

Optional character string path to a texture image (.png or .jpg) or texture atlas directory.

thumbnails

Character string specifying thumbnail handling: "on_demand", "embedded", or "none" (defaults to "on_demand").

file

Character string. Path to the output HTML file. Defaults to a temporary file.

browser

Logical. If TRUE (default), automatically opens the default web browser.

browser_path

Optional character string specifying a custom browser executable (e.g. Google Chrome).

mode

Character string. Initial render mode: "points", "splats", or "mesh". Defaults to "mesh" if a mesh is loaded, otherwise "points".

color_by

Character string. Initial color mode: "rgb", "clay", "height", "density", or "semantic".

point_size

Numeric scalar. Initial point/splat size. Defaults to 3.5.

trackball

Logical. If TRUE (default), displays the Metashape-style Trackball Navigation Sphere and 3-axis rotation gizmo.

sphere_opacity

Numeric scalar between 0 and 1. Initial transparency of the navigation sphere. Defaults to 0.04 (very subtle, clean glass).

rotation

Numeric vector of length 3 c(x, y, z). Initial rotation in degrees. Defaults to c(0, 0, 0).

bg

Character string. Background theme: "dark" (default, slate dark) or "light" (Metashape light).

title

Character string. Viewer window title.

unit_scale

Optional numeric. Factor converting model units into meters, used by the ruler and the measurement tools (e.g. 0.01 if one model unit is 1 cm). NULL (default) assumes meters for metric reconstructions (e.g. Metashape) and unknown scale for COLMAP-based reconstructions, whose scale is arbitrary; in that case lengths are shown in model units (u) until the scale is calibrated in the viewer (GS Studio > Measure > Calibrate scale, two points of known distance).

tools

Logical. If TRUE (default), adds the GS Studio panel with Gaussian-splatting tools: view-dependent color (spherical harmonics), floater filter, image adjustments and background color; rectangle, lasso and brush selection with delete/isolate/undo and export of the edited model as a full 3DGS PLY; section (clipping) plane; scale calibration, polyline, angle, area and volume measurements; turntable / fly-through video recording (WebM), high-resolution and transparent snapshots, and comparison of the render with the original photos.

focus_subject

Logical. If TRUE (default), the viewer opens with the Focus on Subject bounding region (35%), hiding distant background splats; use Full Scene in the viewer (or FALSE) to show everything.

min_opacity

Numeric between 0 and 1. Initial minimum opacity of the GS Studio floater filter (default 0.2): more translucent splats are hidden (non-destructively). It is ignored, with a message in the viewer, when it would hide more than 90% of the splats (e.g. clouds that were not optimized). Use 0 to disable.

Value

Invisible character string containing the path to the generated HTML file.

Examples

if (FALSE) { # interactive()
library(pliman)

# 1. Launch standalone viewer ready for drag & drop
gs_viewer()

# 2. Or pass a model and cameras directly
splat <- gs_import_metashape("cuia_densa.ply")
gs_viewer(splat, cameras = "colmap/sparse/0", images = "photos/")
}