module

GS::Utils::Geometry

Geometry utilities module

Instance methods

apply_transform(p : Vec3, transform : NamedTuple(rotation: Array(Array(Float64)), c1: Vec3, c2: Vec3)) : Vec3

Apply Kabsch transform to a point

Source
center(coords : Array(Vec3)) : Vec3

Compute centroid of point cloud

Source
estimate_normal(point : Vec3, neighbors : Array(Vec3)) : Vec3

Estimate normal at a point using PCA of neighborhood

Source
fit_plane(points : Array(Vec3)) : Tuple(Vec3, Float64)

Fit plane to points, return normal and distance from origin

Source
icp(source : Array(Vec3), target : Array(Vec3), iterations : Int32 = 50, tolerance : Float64 = 1e-6) : Array(Vec3)

ICP (Iterative Closest Point) registration Aligns source point cloud to target

Source
kabsch_align(coords1 : Array(Vec3), coords2 : Array(Vec3)) : Array(Vec3)

Align coords1 onto coords2 using Kabsch algorithm

Source
kabsch_rmsd(coords1 : Array(Vec3), coords2 : Array(Vec3)) : Float64

Kabsch RMSD with optimal rotation alignment

Source
kabsch_transform(coords1 : Array(Vec3), coords2 : Array(Vec3)) : NamedTuple(rotation: Array(Array(Float64)), c1: Vec3, c2: Vec3) | Nil

Get Kabsch transform (rotation + translation)

Source
refine_coordinates!(coords : Array(Vec3), constraints : Array(DistanceConstraint), iterations : Int32 = 100)

Refine coordinates to satisfy constraints

Source
rmsd(coords1 : Array(Vec3), coords2 : Array(Vec3)) : Float64

Compute RMSD between two point sets (no alignment)

Source
solve_distance_geometry(n_atoms : Int32, constraints : Array(DistanceConstraint), min_coverage : Float64 | Nil = nil) : Array(Vec3) | Nil

Distance Geometry: solve 3D coordinates from pairwise distances

Source