newton.Gaussian#
- class newton.Gaussian(positions, rotations=None, scales=None, opacities=None, sh_coeffs=None, sh_degree=None, min_response=0.1)[source]#
Bases:
objectRepresents a Gaussian splat asset for rendering and rigid body attachment.
A Gaussian splat is a collection of oriented, scaled 3D Gaussians with appearance data (color via spherical harmonics or flat RGB). Gaussian objects can be attached to rigid bodies as a shape type (
GeoType.GAUSSIAN) for rendering, with collision handled by an optional proxy geometry.Example
Load a Gaussian splat from a
.plyfile and inspect it:import newton gaussian = newton.Gaussian.create_from_ply("object.ply") print(gaussian.count, gaussian.sh_degree)
- static create_from_ply(filename, min_response=0.1)#
Load Gaussian splat data from a
.plyfile (standard 3DGS format).Reads positions (
x/y/z), rotations (rot_0..3), scales (scale_0..2, stored as log-scale), opacities (logit-space), and SH coefficients (f_dc_*,f_rest_*). Converts log-scale and logit-opacity to linear values.
- static create_from_usd(prim, min_response=0.1)#
Load Gaussian splat data from a USD prim.
Reads positions from attributes: positions, orientations, scales, opacities and radiance:sphericalHarmonicsCoefficients.
- __init__(positions, rotations=None, scales=None, opacities=None, sh_coeffs=None, sh_degree=None, min_response=0.1)#
Construct a Gaussian splat asset from arrays.
- Parameters:
positions (ndarray) – Gaussian centers in local space [m], shape
(N, 3), float.rotations (ndarray | None) – Quaternion orientations
(x, y, z, w), shape(N, 4), float. IfNone, defaults to identity quaternions.scales (ndarray | None) – Per-axis scales (linear), shape
(N, 3), float. IfNone, defaults to ones.opacities (ndarray | None) – Opacity values
[0, 1], shape(N,), float. IfNone, defaults to ones (fully opaque).sh_coeffs (ndarray | None) – Spherical harmonic coefficients, shape
(N, C), float. The number of coefficients C determines the SH degree (C = 3-> degree 0,C = 12-> degree 1, etc.).sh_degree (int | None) – Spherical harmonic degree.
min_response (float) – Minimum response required for alpha testing.
- compute_aabb()#
Compute axis-aligned bounding box of Gaussian centers.
- finalize(device=None)#
Upload Gaussian data to the GPU as Warp arrays.