Files
makeCAD/docs/point-clouds.md
T
brett19 054392abbe Wave 509/509: Kernel rig: assembly cases for mass properties, align, find limits and moving items between parts (and 38 more)
39 commits, squashed; the originals stay reachable from tag archive/merge-main-develop. These commits sit on several merged branches, so the wave holds their combined result.

- 1b17dd7f5 brett19: Merge fixes: every crate and test target compiles on the merged tree, but for crates/geom's hlr
- 8f2c11da2 brett19: Drawings hidden lines: read develop's B-rep records
- c30ca0216 brett19: Hidden-line fixtures: build develop's records from the fixtures' data
- 5dd2509ae brett19: Hidden lines: tests of the bounded edges, face charts and placed revolutions
- 1642df0ea brett19: drawing-hlr doc: what is drawn and refused on develop's records
- ddcb80c8e brett19: hlr tests: a placed revolution is refused when its placement is not rigid
- e4977721f brett19: Hidden lines: a traced intersection is drawn only where its spline lies on both surfaces
- b3ef6ae52 brett19: Hidden lines: kernel bodies through the production prepare against closed forms
- 4cd2ae062 brett19: Tests from main: the world state is a Result here
- 51d7ad09e brett19: A blend's pick measures close edges on their curves, not their polylines
- 11a89713c brett19: Merge fixes from the first SMLib test pass
- 48fcb7aac brett19: Merge fixes from the ui test pass and the gates
- abd739855 brett19: A silhouette takes its facing from the surface's normals
- 85114c5a2 brett19: Clippy and rustfmt on the merged tree
- 55a46569f brett19: Stepwise open checks every feature under the session's mode
- 4627402e4 brett19: Clippy without SMLib: the planar-sheet edge reader is built only with it
- 5fbece0ac brett19: STEP import: a ball's halves whose seams are off each other's quarter lines each form within one turn
- eb78d20b0 brett19: Lid ring sketch test: find the ring under the pick, not by main's kernel's name
- 3048d8c49 brett19: Viewport culling test: each box's triangles from its mesh, not 12
- dc88b80e2 brett19: Timeline chip test: a fillet that really reduces
- 876203621 brett19: Edge names: a seam names its one face once; the curve-id test reads every edge kernel-neutrally
- 900635710 brett19: rustfmt on the merged tree
- b7e83cd7c brett19: Known failing on SMLib: two of main's new tests assume truck's box mesh and fillet torus
- 63bde053a jyviko: Locales: Vietnamese for the setback-too-short refusal, now that vi is a complete catalog
- 967a1caa6 brett19: Kernel rig: exact volumes for 1213's bent-tube round and 4782's bar round, rel 1e-6
- 82c821d2a brett19: After the merge: clippy's auto-deref, and the mesh-decisions list for the merged tree
- 5862ee223 brett19: After the merge: main's new tests on the SMLib kernel
- be78372b2 brett19: Twisted sweep: circles about a straight path are exact cylinders (solidcore#2184)
- 312d14500 jyviko: After the merge: a hole that misses is found by exact boxes; a face is a one-face patch; main's mesh-box helpers gone
- 6f7e51acb jyviko: After the merge: split_move's Result reaches its callers; to_local's duplicated move check goes
- 8f0c79b20 jyviko: After the merge: main's two new tests take world_state's Result, as the rest of their files do
- 5f4d70061 jyviko: After the merge with main: its new code on develop's exact bounds, types and thread fields
- 2b2ab6627 jyviko: Cargo.lock: develop's profile, smlib and step crates at main's 0.30.1
- e6a4b0a9a jyviko: Kernel rig: main's six new sketch-only commands are exempt from a kernel case
- 5acbd2e71 jyviko: Cuts leave the bodies their tools can't reach, by exact boxes (#10225 on exact geometry)
- d2b202307 jyviko: Kernel rig: main's new view, rendering, appearance and settings commands are exempt from a case
- 21db090ba jyviko: Kernel rig: construct.plane.axis_point gets construction cases
- c1f45cae2 jyviko: Kernel rig: assembly cases for mass properties, align, find limits and moving items between parts
- 084695416 jyviko: Kernel rig: export and print face cases in the import area

Co-authored-by: jyviko <2501648+jyviko@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ
2026-11-02 17:34:24 -05:00

107 lines
6.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Point clouds
A point cloud is scanned points kept in the design as a reference to model from (#5151): a
lidar or SLAM map, a photogrammetry result, a part from a handheld scanner. It is drawn as dots
in the viewport, depth-tested with the bodies, and never becomes a body; nothing in the timeline
depends on it.
## Files
| Extension | What is read |
|-----------|--------------|
| `.ply` | ASCII, binary little-endian and binary big-endian PLY: the `vertex` element's `x`, `y`, `z` (any numeric type) and its `red`, `green`, `blue` when present (bytes, 16-bit or 0…1 floats). Every other scalar vertex property (intensity, a class, a time…) is kept, by its name in the file, to colour and filter the cloud by; it is whole-numbered when its type is an integer. Other elements are passed over. |
| `.xyz`, `.pts` | Text, a point per line: `x y z`, optionally followed by `r g b` (six numbers) or by an intensity and `r g b` (seven or more, as PTS files write it). Spaces, tabs, commas or semicolons separate the numbers; `#` and `//` start comments; a PTS file's first line (its count) is skipped. |
A PLY file that also has faces can be inserted as a mesh body instead with **Insert Mesh**
(`file.insert_mesh`); **Insert Point Cloud** then mentions it in its warnings.
Point cloud files say nothing about their length unit. `units` (`mm`, `cm`, `m`, `in`, `ft`)
says what it is; the default is millimetres, as for every other import. Lidar and SLAM maps are
usually in metres. The unit can be changed afterwards (Browser › Point Clouds › Edit Point Cloud,
or `pointcloud.edit` with `units`): the points are scaled from the unit they came in as.
## Colours
**Color By** in the Edit Point Cloud card (or `color_by`) says how the points are coloured:
- `file` (the default): the file's colour of each point, grey when it has none.
- `single`: one colour (`color`) for every point.
- `height`: a ramp by design Z, blue low through cyan, green and yellow to red high. It runs
between two heights (`color_range`, mm). By default they are worked out from the points: all
but the lowest and highest 2 %, so a few stray points don't flatten the ramp.
- any property's name (`x`, `y`, `z` or one of the file's): the same ramp over the property's
values or, for a whole-numbered property, a palette of ten colours (its value modulo ten;
negative values grey). By default the ramp runs exactly over the values the property takes on
the points every filter keeps, so filtering re-spreads the colours over what is left.
A ramp's range is a [range track](#range-tracks) in the card; touching it sets the range and
turns **Automatic Range** off, and ticking the box (or a double click beside the range) gives
it back. `color_range: null` does the same from a command.
A whole-numbered property may name its values with a PLY comment, `property: 0 name, 1 other
name, -1 none` (for example `comment role: 0 outer wall, 1 inner wall`). Coloured by it, the
card shows a legend, a swatch and a name per value; clicking a name shows or hides that value.
## Filters
A filter keeps the points whose property lies in a range (both ends included) or, for a
property with named values, is one of a set of values. Only what every filter keeps is shown; a
cloud has at most 8 filters, and the view applies the first 4. **Filter by** in the card adds
one over a property's whole span (or with all its named values); × removes it. Filters change
what is drawn, never the points the design holds.
## Range tracks
Each range filter, and a ramp's range, is edited on a track, as a range is in an audio editor.
The track draws how much of the cloud lies at each value: a histogram of the property over what
the *other* filters keep, stacked by colour, so it is also the colour legend. A thin strip above
it shows the property's whole span, with the part the track shows framed.
- Drag an end or the band between them to move them; drag elsewhere to draw a new range.
Shift-click brings the nearer end to the pointer.
- Double-click the band to fit the track to it; double-click beside it for the whole span.
The wheel or a pinch zooms around the pointer, a sideways scroll pans, and dragging in the
strip moves the framed part.
- An end snaps to a value where the colour changes when no other change is near at this zoom;
a whole-numbered property's ends snap to whole numbers. ⌥ moves ten times slower, without
snapping.
- Once the track is touched, ← and → bring the part touched last to the previous or next colour
change (one pixel with ⌥, or where there is none).
- **Start**, **End** and **Length** are fields too; Length keeps the start. A value typed with a
sign is relative: `+30` moves it by 30.
- **▶ Play** (or Space) moves the part touched last across the track in 20 seconds: an upper
end grows the range, the band slides it, a lower end wipes it. The track follows it, and an
automatic colour range follows it too. Touching the range stops it.
## Size
A cloud keeps at most `max_points` points (5,000,000 unless asked, at most 20,000,000); a larger
file is thinned evenly, one point in *n*, and the result says how many were kept. Files up to
1 GiB are read. The points are stored single precision relative to the cloud's first point (kept
double precision), so a scan far from the origin keeps its detail; they travel inside the design
file as a binary part (12 bytes a point, 3 more with colours).
## Commands
- `pointcloud.insert` — `path`; `name?`, `units?`, `max_points?`, `center?` (move the middle of
its base to the origin), `point_size?` (pixels), `color_by?` (`file`, `single`, `height` or a
property's name), `color?` (`[r, g, b]` 0…1; alone it means `single`, `null` means `file`),
`color_range?` (`[low, high]`, or `null` for the automatic range; `height_range` is the same),
`filters?` (`[{"property": …, "range": [low, high]}` or `{"property": …, "values": [whole
numbers]}]`, or `null` for none).
- `pointcloud.edit` — `cloud` (id or name); `name?`, `visible?`, `point_size?`, `color_by?`,
`color?`, `color_range?`, `filters?`, `units?`, `matrix?` (a rigid placement, as
`occurrence.move` takes it).
- `pointcloud.delete`.
- `pointcloud.list` — each cloud with its properties (name, whole-numbered or not, span, named
values), its filters and its ramp's range as drawn (`color_range`).
- `doc.open` opens a point cloud file as a new design holding it; dropping one on the window
adds it to the open design.
## Example
```json
{"command": "pointcloud.insert", "params": {"path": "glim-points.ply", "units": "m", "color_by": "height"}}
{"command": "pointcloud.edit", "params": {"cloud": "glim-points", "color_by": "intensity", "filters": [{"property": "z", "range": [0, 2500]}]}}
```