pub struct SplatCloud {
pub positions: Vec<[f32; 3]>,
pub colors: Vec<[f32; 3]>,
pub opacities: Vec<f32>,
pub scales: Vec<[f32; 3]>,
pub rotations: Vec<[f32; 4]>,
pub sh: Vec<f32>,
pub sh_degree: u8,
pub vertical_axis: Option<[f32; 3]>,
}Expand description
A 3D Gaussian Splatting point cloud in raw (stored) units.
Fields§
§positions: Vec<[f32; 3]>Positions as [x, y, z] triples.
colors: Vec<[f32; 3]>Spherical harmonic DC terms as [r, g, b] triples.
opacities: Vec<f32>Opacity logits, one per splat.
scales: Vec<[f32; 3]>Natural-log scales as [sx, sy, sz] triples.
rotations: Vec<[f32; 4]>Rotation quaternions as [w, x, y, z], matching the PLY rot_* order.
sh: Vec<f32>Higher-order SH coefficients, sh_degree dependent, channel-major per splat.
sh_degree: u8Spherical harmonic degree present in sh (0 through 3).
vertical_axis: Option<[f32; 3]>Declared scene vertical axis from the PLY comment Vertical axis line.
Trainers such as brush export the scene in their own reference frame
and state which way is up in the header. None when the PLY has no
such comment (the standard 3DGS convention, where up is -Z).
Implementations§
Source§impl SplatCloud
impl SplatCloud
Sourcepub const fn sh_rest_per_channel(&self) -> usize
pub const fn sh_rest_per_channel(&self) -> usize
Coefficients per colour channel implied by Self::sh_degree.
Sourcepub fn bounds(&self) -> Option<([f32; 3], [f32; 3])>
pub fn bounds(&self) -> Option<([f32; 3], [f32; 3])>
Axis-aligned bounds as (min, max), or None when empty.
Sourcepub fn crop_percentile(&self, percent: f64) -> Result<SplatCloud, GeolithError>
pub fn crop_percentile(&self, percent: f64) -> Result<SplatCloud, GeolithError>
Drop splats outside the central per-axis percentile band.
Inward-facing captures hallucinate a far-field shell of splats around
the real subject; trimming percent from both ends of each axis keeps
the capture hull. 0.0 keeps every splat.
§Errors
Returns GeolithError::SplatTiles when percent is negative or at
least 50, which would discard the entire cloud.
Sourcepub fn crop_radial_percentile(
&self,
percent: f64,
) -> Result<SplatCloud, GeolithError>
pub fn crop_radial_percentile( &self, percent: f64, ) -> Result<SplatCloud, GeolithError>
Drop splats whose distance from the cloud centroid exceeds percent of
the radial distance distribution.
Aerial captures hallucinate a roughly spherical shell of low-quality
splats around the subject that per-axis percentile cropping misses;
trimming the far end of the radial distance distribution removes it.
0.0 keeps every splat.
§Errors
Returns GeolithError::SplatTiles when percent is negative or at
least 50, which would discard the entire cloud.
Sourcepub fn rescale(&mut self, factor: f32)
pub fn rescale(&mut self, factor: f32)
Uniformly scale the scene by factor.
Positions multiply by the factor and the natural-log splat scales
shift by ln(factor), so each splat’s footprint shrinks or grows with
the scene instead of smearing.
Sourcepub fn coverage_boost(&mut self, boost: f32)
pub fn coverage_boost(&mut self, boost: f32)
Apply the gsplat coverage boost: opacity_logit += ln(boost) and
log_scale -= 0.5 * ln(boost).
Trainers that run without a coverage boost leave splats dim and
large; the same capture trained with --coverage-boost-scale N
brightens each splat N-fold while shrinking its footprint by √N, so
the rendered image keeps its luminance but regains sharpness.
boost <= 1.0 is a no-op.
Sourcepub fn orient_to_negative_z(&mut self)
pub fn orient_to_negative_z(&mut self)
Rotate the whole scene so the declared Self::vertical_axis points
along -Z, the convention the tileset pipeline expects.
Positions and per-splat rotation quaternions are rotated by the
shortest-arc rotation that maps the declared up vector onto -Z.
Scales and SH coefficients are untouched: they live in the splat’s
local frame, which rotates along with the quaternion.
No-op when the cloud has no declared axis, or the declared axis is
already -Z within a small tolerance.
Sourcepub fn subset(&self, indices: &[u32]) -> Result<SplatCloud, GeolithError>
pub fn subset(&self, indices: &[u32]) -> Result<SplatCloud, GeolithError>
Build a cloud holding only the splats at indices.
§Errors
Returns GeolithError::Ply when an index is out of range.
Trait Implementations§
Source§impl Clone for SplatCloud
impl Clone for SplatCloud
Source§fn clone(&self) -> SplatCloud
fn clone(&self) -> SplatCloud
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SplatCloud
impl Debug for SplatCloud
Source§impl Default for SplatCloud
impl Default for SplatCloud
Source§fn default() -> SplatCloud
fn default() -> SplatCloud
Auto Trait Implementations§
impl Forget for SplatCloud
impl Freeze for SplatCloudwhere
*const u8 is !null: Freeze,
PhantomData<[f32; 3]>: Freeze,
PhantomData<f32>: Freeze,
PhantomData<[f32; 4]>: Freeze,
impl Move for SplatCloud
impl RefUnwindSafe for SplatCloud
impl Send for SplatCloudwhere
RawVecInner: Send,
impl Sync for SplatCloudwhere
RawVecInner: Sync,
impl Unpin for SplatCloud
impl UnsafeUnpin for SplatCloudwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<[f32; 3]>: UnsafeUnpin,
PhantomData<f32>: UnsafeUnpin,
PhantomData<[f32; 4]>: UnsafeUnpin,
impl UnwindSafe for SplatCloudwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.