Files
PozzettiAndrea-ComfyUI-Turn…/web/server_tools/spz-js/dist/math.d.ts
T
PozzettiAndrea 6bac79935e Reorganize: python in nodes/, non-python in web/, root __init__ uses register_nodes
Match LiTo's project layout. Net file moves:

  spz_route.py             -> nodes/spz_route.py
  install.py               -> root (was briefly in nodes/)
  server_tools/            -> web/server_tools/    (Node JS subprocess
                                                    tool — non-python
                                                    asset, sits next to
                                                    browser-served web/)

Root and nodes/ now mirror ComfyUI-LiTo:

  Root: __init__.py, install.py, pyproject.toml, comfy-env-root.toml,
        comfy-test.toml, README.md, LICENSE, web/, scripts/, nodes/
  nodes/: __init__.py, comfy-env.toml, common.py, preview_gaussian.py,
          merge_gaussians.py, load_ply.py, spz_route.py

## Root __init__.py — LiTo-style

  import logging
  log = logging.getLogger("comfyui-gaussianpack")
  from comfy_env import register_nodes
  NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS = register_nodes()
  WEB_DIRECTORY = "./web"

Delegates node discovery to `comfy_env.register_nodes()`, which scans
`nodes/__init__.py` for the mappings. WEB_DIRECTORY stays at root
(points at top-level web/) so ComfyUI's static handler doesn't have to
walk into nodes/.

## nodes/__init__.py — clean child package

Imports PreviewGaussians, GaussianMerge, LoadPLY from sibling modules,
calls register_routes() for the SPZ HTTP route, exposes the two
mapping dicts. Dropped `WEB_DIRECTORY` (it belongs at root).

## nodes/comfy-env.toml — pixi env declaration

numpy + plyfile + nanogs (git pip). Same content as before — was
previously at root, where comfy-env's discovery wouldn't pick it up
for isolation purposes. Now lives where comfy-env expects.

## spz_route.py — path fix

NODE_SCRIPT was `THIS_DIR / "server_tools" / "ply_to_spz.mjs"` when the
file was at root. Now at nodes/ with server_tools moved to web/, so:

  NODE_SCRIPT = THIS_DIR.parent / "web" / "server_tools" / "ply_to_spz.mjs"

Smoke test (worker pixi env):
  PYTHONPATH=.../ComfyUI:. python -c "import nodes; print(nodes.NODE_CLASS_MAPPINGS)"
  -> {'PreviewGaussians': ..., 'GaussianMerge': ..., 'LoadPLY': ...}
2026-05-16 14:49:10 +02:00

20 lines
1.1 KiB
TypeScript

import { Vec3f, Quat4f, Half } from './types.js';
export declare const PI: number;
export declare function halfToFloat(h: Half): number;
export declare function floatToHalf(f: number): Half;
export declare function axisAngleQuat(scaledAxis: Vec3f): Quat4f;
export declare function isVec3f(v: number[]): v is Vec3f;
export declare function isQuat4f(v: number[]): v is Quat4f;
export declare function vec3f(data: number[]): Vec3f;
export declare function quat4f(data: number[]): Quat4f;
export declare function dot(a: Vec3f, b: Vec3f): number;
export declare function squaredNorm(v: Vec3f | Quat4f): number;
export declare function norm(v: Vec3f | Quat4f): number;
export declare function normalized<T extends Vec3f | Quat4f>(v: T): T;
export declare function timesVec3(q: Quat4f, p: Vec3f): Vec3f;
export declare function timesQuat(a: Quat4f, b: Quat4f): Quat4f;
export declare function timesScalar<T extends Vec3f | Quat4f>(v: T, s: number): T;
export declare function plus<T extends Vec3f | Quat4f>(a: T, b: T): T;
export declare function vec3ToQuat4(v: Vec3f, w: number): Quat4f;
export declare function quatToVec3(q: Quat4f): Vec3f;