### Install Viewer Dependencies
Source: https://github.com/manycoretech/aholo-viewer/blob/master/website/src/content/manual/en-US/viewer.md
Install the necessary packages for @manycore/aholo-splat-transform and @manycore/aholo-splat-dev-server globally.
```bash
npm install @manycore/aholo-splat-transform -g
npm install @manycore/aholo-splat-dev-server -g
```
--------------------------------
### Preview Production Build
Source: https://github.com/manycoretech/aholo-viewer/blob/master/README.md
Starts a local server to preview the production build of the Aholo Viewer.
```bash
pnpm preview
```
--------------------------------
### Run Development Server
Source: https://github.com/manycoretech/aholo-viewer/blob/master/README.md
Starts the development server for the Aholo Viewer project.
```bash
pnpm dev
```
--------------------------------
### Install Dependencies with npm
Source: https://github.com/manycoretech/aholo-viewer/blob/master/website/src/content/manual/en-US/getting-started.md
Install the Aholo-Viewer package and Vite for development. TypeScript is recommended for better development experience.
```bash
npm install --save @manycore/aholo-viewer
npm install --save-dev vite typescript # TypeScript is recommended.
```
--------------------------------
### Install Dependencies
Source: https://github.com/manycoretech/aholo-viewer/blob/master/README.md
Installs all project dependencies using pnpm.
```bash
pnpm install
```
--------------------------------
### Start Vite Development Server
Source: https://github.com/manycoretech/aholo-viewer/blob/master/website/src/content/manual/en-US/getting-started.md
Run this command in your project directory to start the Vite development server. Access your application via the local URL provided in the terminal output.
```bash
npx vite
```
--------------------------------
### Example File Structure
Source: https://github.com/manycoretech/aholo-viewer/blob/master/docs/architecture.md
Examples are stored in the Astro content tree with paired metadata (JSON) and source (TypeScript) files. The JSON file contains metadata, while the TypeScript file holds the code.
```text
website/src/content/examples/
basic-scene.json
basic-scene.ts
```
--------------------------------
### Splat Dev Server Startup Output
Source: https://github.com/manycoretech/aholo-viewer/blob/master/website/src/content/manual/en-US/viewer.md
Example output indicating the successful startup of the splat-dev-server, showing host, port, root directory, and base URL.
```bash
========================================
Splat dev server started
Host: 127.0.0.1:3000
Root: ./chunk-lod
Base URL: http://127.0.0.1:3000
========================================
```
--------------------------------
### Install Splat-Dev-Server Globally
Source: https://github.com/manycoretech/aholo-viewer/blob/master/external/splat-dev-server/README.md
Installs the splat-dev-server package globally using npm. Ensure you have Node.js version 22.22.1 or higher installed.
```bash
npm install @manycore/aholo-splat-dev-server -g
```
--------------------------------
### Run Splat-Dev-Server
Source: https://github.com/manycoretech/aholo-viewer/blob/master/external/splat-dev-server/README.md
Starts the splat-dev-server. It requires a directory containing 3DGS files as an argument. You can specify the address and port to listen on.
```bash
splat-dev-server [options]
```
--------------------------------
### Install Splat Transform Globally
Source: https://github.com/manycoretech/aholo-viewer/blob/master/external/splat-transform/README.md
Installs the splat-transform package globally using npm. Ensure Node.js version 22.22.1 or higher is installed.
```bash
npm install @manycore/aholo-splat-transform -g
```
--------------------------------
### Pipeline Descriptor Example
Source: https://github.com/manycoretech/aholo-viewer/blob/master/website/src/content/manual/en-US/splat-transform.md
Defines a sample pipeline configuration for splat-transform, including reading, LOD generation, and writing tasks.
```json
{
"version": 1,
"tasks": [
{
"id": "0",
"type": "Read",
"config": { "inputs": ["a.ply"], "output": "cache0" }
},
{
"id": "1",
"type": "AutoChunkLod",
"config": { "input": "cache0", "output": "cache0", "type": "spz" }
},
{
"id": "2",
"type": "Write",
"config": { "input": "cache0", "output": "a-lod" }
}
]
}
```
--------------------------------
### Dependency Direction Example
Source: https://github.com/manycoretech/aholo-viewer/blob/master/docs/architecture.md
Visualizes the flow of dependencies between different parts of the Aholo Viewer project, including external modules, workspace packages, scripts, and the website.
```text
external/egs-core workspace packages
-> scripts/prepare-egs-types.mjs
-> renderer type checks and declaration bundling
packages/renderer/src/index.ts
-> scripts/build-package.mjs
-> packages/renderer/dist
-> website Playground runtime, examples, and type hints
packages/renderer/src/index.ts
-> scripts/generate-api-docs.mjs
-> website/.generated/api/
-> website pages
```
--------------------------------
### Playground Renderer Adapter
Source: https://github.com/manycoretech/aholo-viewer/blob/master/docs/architecture.md
This file serves as the boundary for the playground, handling transpiled examples, preview lifecycle, and camera control.
```typescript
website/src/playground/renderer-adapter.ts
```
--------------------------------
### Navigation Seed Structure
Source: https://github.com/manycoretech/aholo-viewer/blob/master/website/src/content/manual/en-US/splat-transform.md
Sets the starting center point for navigation. Used in conjunction with navCapsule for navigation simplification.
```typescript
{
x: number,
y: number,
z: number
}
```
--------------------------------
### Build Project
Source: https://github.com/manycoretech/aholo-viewer/blob/master/README.md
Builds the Aholo Viewer project for production.
```bash
pnpm build
```
--------------------------------
### Splat-Dev-Server Options
Source: https://github.com/manycoretech/aholo-viewer/blob/master/external/splat-dev-server/README.md
Lists available options for the splat-dev-server command, including help, version, address, and port.
```bash
Options:
--help Show help [boolean]
--version Show version number [boolean]
-a, --address Address to listen [string] [default: "127.0.0.1"]
-p, --port Port to listen [number] [default: 3000]
```
--------------------------------
### Check Renderer API Release
Source: https://github.com/manycoretech/aholo-viewer/blob/master/docs/ai/vibe-coding-guide.md
Execute this command to check the renderer's API for release readiness. Ensures API integrity.
```bash
pnpm.cmd check
```
--------------------------------
### Build Website Package
Source: https://github.com/manycoretech/aholo-viewer/blob/master/README.md
Builds only the website package within the monorepo.
```bash
pnpm build:website
```
--------------------------------
### Build Package for Release
Source: https://github.com/manycoretech/aholo-viewer/blob/master/docs/ai/vibe-coding-guide.md
Use this command to build the package for release. This is essential for preparing distribution artifacts.
```bash
pnpm.cmd build
```
--------------------------------
### Create Aholo-Viewer Scene with JavaScript
Source: https://github.com/manycoretech/aholo-viewer/blob/master/website/src/content/manual/en-US/getting-started.md
This script initializes an Aholo-Viewer, loads a splat file, configures the camera and scene settings, and sets up a render loop. Ensure the container element is appended to the document body.
```javascript
import {
createViewer,
setViewerConfig,
PerspectiveCamera,
BackgroundMode,
Vector3,
Color,
SplatLoader,
SplatUtils,
} from '@manycore/aholo-viewer';
const SPLAT_URL = 'https://holo-cos.aholo3d.cn/aholo-opensource/gs_file/bear/bear.3d71a266.sog';
// Create the container and attach it to the page.
const container = document.createElement('div');
container.style.width = '500px';
container.style.height = '500px';
container.style.display = 'block';
document.body.appendChild(container);
async function createScene() {
const viewer = createViewer('example-viewer', container, {});
const camera = new PerspectiveCamera(60, 1, 0.1, 2000);
const resp = await fetch(SPLAT_URL);
const buffer = await resp.arrayBuffer();
const data = await SplatLoader.parseSplatData(
SplatLoader.SplatFileType.SOG,
new Uint8Array(buffer),
SplatLoader.SplatPackType.Compressed,
);
const splat = await SplatUtils.createSplat(data);
// The splat uses -Y up in OpenCV coordinates.
camera.up.set(0, -1, 0);
camera.position.set(-1.5, -0.5, 0);
camera.lookAt(new Vector3(0, 0, 0));
viewer.getScene().add(splat);
viewer.setCamera(camera);
setViewerConfig(viewer, {
pipeline: {
Background: {
background: {
active: BackgroundMode.BasicBackground,
basic: {
color: new Color(0, 0, 0),
},
},
ground: {
enabled: false,
},
},
Splatting: {
enabled: true,
},
TAA: {
enabled: false,
},
},
});
function render() {
viewer.render();
}
// Render again when viewer.requestRender is called.
viewer.requestRenderHandler = function () {
requestAnimationFrame(render);
};
requestAnimationFrame(render);
}
createScene();
```
--------------------------------
### Generate API Documentation
Source: https://github.com/manycoretech/aholo-viewer/blob/master/README.md
Generates API documentation from the renderer source code.
```bash
pnpm docs:api
```
--------------------------------
### Check Website Styles
Source: https://github.com/manycoretech/aholo-viewer/blob/master/docs/ai/vibe-coding-guide.md
Run this command to check website styles. It's useful for validating visual consistency.
```bash
pnpm.cmd check:website
```
--------------------------------
### Build Renderer Package
Source: https://github.com/manycoretech/aholo-viewer/blob/master/packages/renderer/README.md
Builds the renderer source package from the repository root. This command generates the necessary runtime files and declaration types.
```bash
pnpm build:renderer
```
--------------------------------
### Display Splat Transform Help
Source: https://github.com/manycoretech/aholo-viewer/blob/master/external/splat-transform/README.md
Displays the help information for the splat-transform command, showing available options and commands.
```bash
splat-transform --help
```
--------------------------------
### Configure Quality First Preset
Source: https://github.com/manycoretech/aholo-viewer/blob/master/website/src/content/manual/en-US/3dgs-preset-config.md
Configures the parser and viewer for the 'Quality First' preset. This setting balances image quality with acceptable device performance.
```typescript
// set parser config
const splatData = await SplatLoader.parseSplatData(
// file type and data
splatFileType,
content,
// compress config
SplatLoader.SplatPackType.Compressed,
);
const splat = await SplatUtils.createSplat(splatData);
splat.autoFreeResourceOnGpuPacked = true;
viewer.getScene().add(splat);
// update viewer config
setViewerConfig(viewer, {
pipeline: {
Splatting: {
pack: {
highPrecisionEnabled: true,
cameraRelativeEnabled: false,
},
},
},
});
```
--------------------------------
### Build Package Script
Source: https://github.com/manycoretech/aholo-viewer/blob/master/docs/architecture.md
This script discovers runtime packages for esbuild aliases.
```javascript
build-package.mjs
```
--------------------------------
### CLI Mode: Create Format Conversion
Source: https://github.com/manycoretech/aholo-viewer/blob/master/website/src/content/manual/en-US/splat-transform.md
Converts 3DGS files between different formats using the CLI.
```bash
splat-transform create