def to_sparse_tensor(self): """Return a sparse tensor compatible with 3D sparse CNNs (e.g., MinkowskiEngine).""" coords = torch.floor(self.points / self.voxel_size).int() feats = torch.cat([self.points, self.features['normals']], dim=1) return coords, feats
def _load_ply(self, path): ply = PlyData.read(path) vertices = np.vstack([ply['vertex'][axis] for axis in ['x', 'y', 'z']]).T return torch.tensor(vertices, dtype=torch.float32)
def _compute_normals(self): # Simplified: fit plane to 10 nearest neighbors (use sklearn or open3d) from sklearn.neighbors import NearestNeighbors nbrs = NearestNeighbors(n_neighbors=10).fit(self.points) # ... compute normals via PCA ... self.features['normals'] = normals geometry3d.aip
def save_aip(self, path): """Save as .aip (custom HDF5 or pickle).""" import pickle with open(path, 'wb') as f: pickle.dump('points': self.points, 'features': self.features, f)
def __init__(self, point_cloud_path, precompute=True): self.points = self._load_ply(point_cloud_path) self.features = {} if precompute: self._compute_normals() self._compute_curvature() | | Robotic manipulation | Grasp pose detection
def _compute_curvature(self): # Eigenvalue-based curvature from local covariance self.features['curvature'] = curvature
import numpy as np import torch from plyfile import PlyData class Geometry3DAIPReader: """Minimal reader for a .aip-like specification.""" | | AR/VR | Scene understanding from sparse
| Domain | Use Case | How geometry3d.aip Helps | |--------|----------|----------------------------| | | Real-time LiDAR segmentation | Sparse tensors + temporal fusion (multiple aip frames). | | Robotic manipulation | Grasp pose detection | Precomputed contact normals and friction cones. | | Medical imaging | 3D organ reconstruction from CT scans | Topology-preserving implicit surfaces. | | CAD & generative design | AI-assisted part modeling | Latent space of meshes with editable semantic slots. | | AR/VR | Scene understanding from sparse sensors | Fast voxel hashing + online adaptation. |