Skip to content
Skills Library
Programming · Building & coding

threecrate

/threecrate

Process 3D point clouds and meshes (PLY, PCD, XYZ, CSV, OBJ) with the threecrate Python library. Use for inspecting scans, downsampling, removing outliers, estimating normals, aligning scans (ICP, GICP, global registration), finding planes and objects, building meshes (Poisson, ball pivoting), and simplifying or smoothing meshes.

Repository
threecrate ↗
Licence
MIT
Last repository change
18.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
1
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 18.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 1 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/inspect_cloud.py

What it does and when to use it

Process 3D point clouds and meshes (PLY, PCD, XYZ, CSV, OBJ) with the threecrate Python library. Use for inspecting scans, downsampling, removing outliers, estimating normals, aligning scans (ICP, GICP, global registration), finding planes and objects, building meshes (Poisson, ball pivoting), and simplifying or smoothing meshes.

Original author description

Process 3D point clouds and meshes (PLY, PCD, XYZ, CSV, OBJ) with the threecrate Python library. Use for inspecting scans, downsampling, removing outliers, estimating normals, aligning scans (ICP, GICP, global registration), finding planes and objects, building meshes (Poisson, ball pivoting), and simplifying or smoothing meshes.

How it works

  1. Setup
  2. Workflow
  3. Choosing parameters
  4. Recipes
  5. Good to know
Original SKILL.md headings · 112 lines, 770 words
SKILL.md preview
---
name: threecrate
description: Process 3D point clouds and meshes (PLY, PCD, XYZ, CSV, OBJ) with the threecrate Python library. Use for inspecting scans, downsampling, removing outliers, estimating normals, aligning scans (ICP, GICP, global registration), finding planes and objects, building meshes (Poisson, ball pivoting), and simplifying or smoothing meshes.
---

# threecrate

threecrate is a fast Rust library for point clouds and meshes with Python bindings (`pip install threecrate`). This skill drives it from short Python scripts.

If the `threecrate` MCP server is connected (tools such as `inspect_point_cloud`, `register`, `reconstruct`), prefer those tools. Use this skill when it isn't.

## Setup

Install into a virtual environment, never the system Python:

```bash
python -m venv .venv
.venv/bin/pip install threecrate numpy
```

Then run scripts with `.venv/bin/python`. On Windows the folder is `Scripts`, not `bin`: use `.venv/Scripts/pip` and `.venv/Scripts/python` in Git Bash or PowerShell, or `.venv\Scripts\python` in cmd.

`orient_normals` and the `poisson_reconstruct` options below need threecrate 0.10.0 or newer. Check with `pip show threecrate`.

## Workflow

1. **Inspect first.** Run `scripts/inspect_cloud.py <file>` from this skill's folder. It prints the point count, bounds and median point spacing, plus suggested parameters. Every size parameter below depends on the spacing and the units, so don't guess them.
2. **Clean:** remove outliers, then downsample if the cloud is large or dense.
3. **Do the task:** register, segment or reconstruct.
4. **Write results to new files.** Never overwrite the user's input. Report what changed (point counts, fit error, face counts).

## Choosing parameters

Base sizes on the median spacing `s` from the inspect script:

| Parameter | Start with |
|---|---|
| `voxel_downsample` voxel size | `2*s` (light) to `5*s` (strong) |
| `remove_radius_outliers` radius | `3*s`, `min_neighbors=5` |
| `extract_clusters` tolerance | `3*s` |
| `segment_plane` threshold | `1*s` to `2*s` |
| `ball_pivoting_reconstruct` radius | `2*s` |
| `poisson_reconstruct` `trim_distance` | `2*s` to `3*s`, open scans only |

## Recipes

```python
import numpy as np
import threecrate as tc

cloud = tc.read_point_cloud("scan.ply")              # PLY, PCD, XYZ, CSV
pts = cloud.to_numpy()                               # (N, 3) float32
cloud = tc.PointCloud(pts)                           # and back
s = 0.01  # REPLACE with median_spacing from scripts/inspect_cloud.py. Every size below
          # scales with it, and a value far too small makes the filters delete real points.

# Clean. Statistical removal handles general noise; follow it with radius
# removal to drop isolated strays it leaves behind.
cloud = tc.remove_statistical_outliers(cloud, k_neighbors=20, std_ratio=2.0)
cloud = tc.remove_radius_outliers(cloud, radius=3 * s, min_neighbors=5)  # s: median spacing
cloud = tc.voxel_downsample(cloud, 2 * s)

# Normals (oriented toward a viewpoint above the cloud; fine for one scan)
normals = tc.estimate_normals(cloud, k_neighbors=10)
# Full 3D object? Make normals agree all the way around (outward):
normals = tc.orient_normals(normals, k_neighbors=10)

# Align source to target. Returns a 4x4 matrix (source -> target).
result = tc.icp(source, target, max_iterations=50)             # needs a rough initial alignment
result = tc.gicp(source, target, max_correspondence_distance=0.1)  # more robust
T = result.transformation()
aligned = tc.transform_point_cloud(source, T)
print(result.mse, result.converged)

# No initial alignment needed: feature matching, then ICP
result = tc.global_registration(source, target)
print(result.icp_mse, result.inlier_ratio)

# Floor or wall, then separate objects
plane = tc.segment_plane(cloud, threshold=1.5 * s)
a, b, c, d = plane.plane_coefficients()              # ax + by + cz + d = 0
if c < 0:                                            # the sign varies between runs;
    a, b, c, d = -a, -b, -c, -d                      # make the normal point up
pts = cloud.to_numpy()                               # the same cloud the indices refer to
on_plane = np.zeros(len(pts), dtype=bool)
on_plane[plane.inlier_indices()] = True
rest = pts[~on_plane]
above = rest[rest @ np.array([a, b, c]) + d > 0]     # only what sits on top of the floor
objects = tc.extract_clusters(tc.PointCloud(above), tolerance=3 * s, min_cluster_size=100)
# extract_clusters returns a list of PointClouds, largest first
for i, obj in enumerate(objects):
    tc.write_point_cloud(obj, f"object_{i}.ply")
tc.write_point_cloud(tc.PointCloud(np.vstack([o.to_numpy() for o in objects])), "objects.ply")

# Meshes
quick = tc.reconstruct(cloud)                                 # picks a method
detailed = tc.ball_pivoting_reconstruct(cloud, radius=2 * s)  # keeps detail, may leave holes
open_scan = tc.poisson_reconstruct(normals, depth=7, trim_distance=2.5 * s)  # one-sided scan
mesh = tc.poisson_reconstruct(normals, depth=7)               # smooth, watertight
mesh = tc.simplify_mesh(mesh, reduction_ratio=0.5)            # fails on meshes full of holes
mesh = tc.smooth_mesh_taubin(mesh, iterations=10)
print(mesh.vertex_count, mesh.face_count)

tc.write_point_cloud(cloud, "scan.clean.ply")
tc.write_mesh(mesh, "scan.mesh.ply")                 # PLY or OBJ
```

## Good to know

- Poisson `depth` runs from 3 to 8. Depth 7 takes about a second; each step up is about 8x slower and finer.
- Poisson always closes the surface. On a scan that only sees one side, set `trim_distance`, or the result is a closed blob.
- `simplify_mesh` raises an error when the mesh is mostly holes (common after ball pivoting). Pass `preserve_boundary=False`, or build the mesh with Poisson instead.
- Point-to-point `icp` can lock onto the wrong match when the clouds start far apart. Use `global_registration` first, then refine with `gicp`.
- Downsample both clouds before registration for speed. The transform still applies to the full clouds.
- Very large clouds (tens of millions of points) need a lot of memory. Downsample before meshing.
Files in this package (2)
  • SKILL.md 6 KB
  • scripts/inspect_cloud.py 2 KB

Versions

The database has no other skills named threecrate.

Database snapshot: 13.11.2026 · package version 970fc2f335ae (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100open3d
    Use when processing 3D point clouds and meshes in Python — read/write PLY/PCD, voxel downsample, normal estimation, outlier removal, RANSAC + ICP registration, Poisson surface reconstruction, quadric decimation, and headless/offscreen visualization. Open3D is Intel's open-source…
  • 100pyvista-mesh-io
    Dataset types and file I/O for PyVista — PolyData, UnstructuredGrid, ImageData, StructuredGrid, RectilinearGrid; points and faces array contracts; point_data/cell_data assignment; building meshes from NumPy; reading and saving VTK and mesh formats (vtk, vtu, vtp, stl, ply, obj,…
  • 100evo-threejs-scene-parser
    Parse a Three.js createScene() file in headless Node.js, identify part-level structure (Groups and standalone Meshes), and export OBJ files for both individual sub-meshes per part and merged part assemblies (links). Use when extracting decomposed 3D object structure from Three.js scene definitions.
  • 100matlab-read-write-point-cloud-file
    Read and write 3-D point cloud data using Lidar Toolbox file I/O. Covers PLY, PCD, LAS/LAZ, PCAP (Velodyne/Ouster/Hesai), E57, and IDC (Ibeo) formats. Use when loading point clouds from disk, saving to disk, choosing the correct reader or writer for a file format, extracting or…
  • 95obj-exporter
    Three.js OBJExporter utility for exporting 3D geometry to Wavefront OBJ format. Use when converting Three.js scenes, meshes, or geometries to OBJ files for use in other 3D software like Blender, Maya, or MeshLab.
  • 95obj-exporter
    Three.js OBJExporter utility for exporting 3D geometry to Wavefront OBJ format. Use when converting Three.js scenes, meshes, or geometries to OBJ files for use in other 3D software like Blender, Maya, or MeshLab.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.