cli-anything-cloudcompare
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecli-anything-cloudcompare
cli-anything-cloudcompare
Agent-friendly command-line harness for CloudCompare — the open-source 3D point cloud and mesh processing software.
41 commands across 9 groups.
为Agent优化的CloudCompare命令行封装工具——CloudCompare是一款开源3D点云与网格处理软件。
涵盖9类分组的41条命令。
Installation
安装
bash
pip install cli-anything-cloudcomparePrerequisites:
- Python 3.10+
- CloudCompare installed on your system
- Linux (Flatpak):
flatpak install flathub org.cloudcompare.CloudCompare - macOS/Windows: download from https://cloudcompare.org
- Linux (Flatpak):
Tested with: CloudCompare 2.13.2 (Flatpak, Linux)
bash
pip install cli-anything-cloudcompare前置要求:
- Python 3.10+
- 系统已安装CloudCompare
- Linux(Flatpak):
flatpak install flathub org.cloudcompare.CloudCompare - macOS/Windows:从 https://cloudcompare.org 下载
- Linux(Flatpak):
测试兼容版本: CloudCompare 2.13.2(Flatpak,Linux)
Global Options
全局选项
These options must be placed before the subcommand:
bash
cli-anything-cloudcompare [--project FILE] [--json] COMMAND [ARGS]...| Option | Description |
|---|---|
| Path to project JSON file |
| Output results as JSON (for agent consumption) |
这些选项必须放在子命令之前:
bash
cli-anything-cloudcompare [--project FILE] [--json] COMMAND [ARGS]...| 选项 | 描述 |
|---|---|
| 项目JSON文件路径 |
| 以JSON格式输出结果(供Agent解析) |
Command Groups
命令分组
1. project — Project Management (3 commands)
1. project — 项目管理(3条命令)
project new
project new
Create a new empty project file.
bash
undefined创建一个新的空项目文件。
bash
undefinedCreate a project with default name
创建默认名称的项目
cli-anything-cloudcompare project new -o myproject.json
cli-anything-cloudcompare project new -o myproject.json
Create a project with a custom name
创建自定义名称的项目
cli-anything-cloudcompare project new -o myproject.json -n "Bridge Survey 2024"
cli-anything-cloudcompare project new -o myproject.json -n "Bridge Survey 2024"
JSON output for agents
为Agent输出JSON格式结果
cli-anything-cloudcompare --json project new -o myproject.json
Options: `-o/--output TEXT` (required), `-n/--name TEXT`cli-anything-cloudcompare --json project new -o myproject.json
选项:`-o/--output TEXT`(必填),`-n/--name TEXT`project info
project info
Show project info and loaded entities.
bash
cli-anything-cloudcompare --project myproject.json project info显示项目信息和已加载的实体。
bash
cli-anything-cloudcompare --project myproject.json project infoJSON output
JSON格式输出
cli-anything-cloudcompare --project myproject.json --json project info
undefinedcli-anything-cloudcompare --project myproject.json --json project info
undefinedproject status
project status
Show quick project status (cloud count, mesh count, last operation).
bash
cli-anything-cloudcompare --project myproject.json project status显示项目快速状态(点云数量、网格数量、最后操作)。
bash
cli-anything-cloudcompare --project myproject.json project status2. session — Session Management (4 commands)
2. session — 会话管理(4条命令)
session save
session save
Save the current project state to disk.
bash
cli-anything-cloudcompare --project myproject.json session save将当前项目状态保存到磁盘。
bash
cli-anything-cloudcompare --project myproject.json session savesession history
session history
Show recent operation history.
bash
undefined显示最近的操作历史。
bash
undefinedShow last 10 operations (default)
显示最近10条操作(默认)
cli-anything-cloudcompare --project myproject.json session history
cli-anything-cloudcompare --project myproject.json session history
Show last 5 operations
显示最近5条操作
cli-anything-cloudcompare --project myproject.json session history -n 5
Options: `-n/--last INTEGER`cli-anything-cloudcompare --project myproject.json session history -n 5
选项:`-n/--last INTEGER`session set-format
session set-format
Update the default export format for future operations.
bash
undefined更新后续操作的默认导出格式。
bash
undefinedSet default cloud export to LAS
设置点云默认导出格式为LAS
cli-anything-cloudcompare --project myproject.json session set-format --cloud-fmt LAS --cloud-ext las
cli-anything-cloudcompare --project myproject.json session set-format --cloud-fmt LAS --cloud-ext las
Set default mesh export to OBJ
设置网格默认导出格式为OBJ
cli-anything-cloudcompare --project myproject.json session set-format --mesh-fmt OBJ --mesh-ext obj
cli-anything-cloudcompare --project myproject.json session set-format --mesh-fmt OBJ --mesh-ext obj
Set both cloud and mesh defaults
同时设置点云和网格的默认格式
cli-anything-cloudcompare --project myproject.json session set-format
--cloud-fmt PLY --cloud-ext ply
--mesh-fmt STL --mesh-ext stl
--cloud-fmt PLY --cloud-ext ply
--mesh-fmt STL --mesh-ext stl
Options: `--cloud-fmt TEXT`, `--cloud-ext TEXT`, `--mesh-fmt TEXT`, `--mesh-ext TEXT`cli-anything-cloudcompare --project myproject.json session set-format
--cloud-fmt PLY --cloud-ext ply
--mesh-fmt STL --mesh-ext stl
--cloud-fmt PLY --cloud-ext ply
--mesh-fmt STL --mesh-ext stl
选项:`--cloud-fmt TEXT`, `--cloud-ext TEXT`, `--mesh-fmt TEXT`, `--mesh-ext TEXT`session undo
session undo
Remove the last operation from history (soft undo — does not delete output files).
bash
cli-anything-cloudcompare --project myproject.json session undo从历史记录中移除最后一次操作(软撤销——不删除输出文件)。
bash
cli-anything-cloudcompare --project myproject.json session undo3. cloud — Point Cloud Operations (21 commands)
3. cloud — 点云操作(21条命令)
All cloud commands take (0-based integer from ) and most accept to register the output back into the project.
CLOUD_INDEXcloud list--add-to-project所有点云命令都需要(从获取的0-based整数),大多数命令支持参数将输出结果重新注册到项目中。
CLOUD_INDEXcloud list--add-to-projectcloud add
cloud add
Add a point cloud file to the project.
bash
undefined将点云文件添加到项目中。
bash
undefinedAdd a LAS file
添加LAS文件
cli-anything-cloudcompare --project myproject.json cloud add /data/scan.las
cli-anything-cloudcompare --project myproject.json cloud add /data/scan.las
Add with a label
添加带标签的点云
cli-anything-cloudcompare --project myproject.json cloud add /data/scan.las -l "roof scan"
Options: `-l/--label TEXT`cli-anything-cloudcompare --project myproject.json cloud add /data/scan.las -l "roof scan"
选项:`-l/--label TEXT`cloud list
cloud list
List all clouds currently in the project.
bash
cli-anything-cloudcompare --project myproject.json cloud list列出项目中所有的点云。
bash
cli-anything-cloudcompare --project myproject.json cloud listJSON output for parsing indices
输出JSON格式以解析索引
cli-anything-cloudcompare --project myproject.json --json cloud list
undefinedcli-anything-cloudcompare --project myproject.json --json cloud list
undefinedcloud convert
cloud convert
Convert a cloud from one format to another (format determined by file extension).
bash
undefined将点云从一种格式转换为另一种(格式由文件扩展名决定)。
bash
undefinedLAS → PLY
LAS → PLY
cli-anything-cloudcompare cloud convert /data/scan.las /data/scan.ply
cli-anything-cloudcompare cloud convert /data/scan.las /data/scan.ply
PCD → LAS
PCD → LAS
cli-anything-cloudcompare cloud convert /data/cloud.pcd /data/cloud.las
undefinedcli-anything-cloudcompare cloud convert /data/cloud.pcd /data/cloud.las
undefinedcloud subsample
cloud subsample
Reduce the number of points using RANDOM, SPATIAL, or OCTREE method.
bash
undefined使用RANDOM、SPATIAL或OCTREE方法减少点的数量。
bash
undefinedRandom: keep 100 000 points
随机采样:保留100000个点
cli-anything-cloudcompare --project myproject.json cloud subsample 0
-o /data/sub_random.las -m random -n 100000
-o /data/sub_random.las -m random -n 100000
cli-anything-cloudcompare --project myproject.json cloud subsample 0
-o /data/sub_random.las -m random -n 100000
-o /data/sub_random.las -m random -n 100000
Spatial: minimum distance 0.05 m between points
空间采样:点之间最小距离0.05米
cli-anything-cloudcompare --project myproject.json cloud subsample 0
-o /data/sub_spatial.las -m spatial -n 0.05
-o /data/sub_spatial.las -m spatial -n 0.05
cli-anything-cloudcompare --project myproject.json cloud subsample 0
-o /data/sub_spatial.las -m spatial -n 0.05
-o /data/sub_spatial.las -m spatial -n 0.05
Octree: level 8
八叉树采样:层级8
cli-anything-cloudcompare --project myproject.json cloud subsample 0
-o /data/sub_octree.las -m octree -n 8 --add-to-project
-o /data/sub_octree.las -m octree -n 8 --add-to-project
Options: `-o/--output TEXT` (required), `-m/--method [random|spatial|octree]`, `-n/--param FLOAT`, `--add-to-project`cli-anything-cloudcompare --project myproject.json cloud subsample 0
-o /data/sub_octree.las -m octree -n 8 --add-to-project
-o /data/sub_octree.las -m octree -n 8 --add-to-project
选项:`-o/--output TEXT`(必填),`-m/--method [random|spatial|octree]`,`-n/--param FLOAT`,`--add-to-project`cloud crop
cloud crop
Crop a cloud to an axis-aligned bounding box.
bash
undefined将点云裁剪到轴对齐的边界框内。
bash
undefinedKeep points inside the box
保留边界框内的点
cli-anything-cloudcompare --project myproject.json cloud crop 0
-o /data/cropped.las
--xmin 0.0 --ymin 0.0 --zmin 0.0
--xmax 10.0 --ymax 10.0 --zmax 5.0
-o /data/cropped.las
--xmin 0.0 --ymin 0.0 --zmin 0.0
--xmax 10.0 --ymax 10.0 --zmax 5.0
cli-anything-cloudcompare --project myproject.json cloud crop 0
-o /data/cropped.las
--xmin 0.0 --ymin 0.0 --zmin 0.0
--xmax 10.0 --ymax 10.0 --zmax 5.0
-o /data/cropped.las
--xmin 0.0 --ymin 0.0 --zmin 0.0
--xmax 10.0 --ymax 10.0 --zmax 5.0
Keep points OUTSIDE the box
保留边界框外的点
cli-anything-cloudcompare --project myproject.json cloud crop 0
-o /data/exterior.las
--xmin 0.0 --ymin 0.0 --zmin 0.0
--xmax 10.0 --ymax 10.0 --zmax 5.0 --outside
-o /data/exterior.las
--xmin 0.0 --ymin 0.0 --zmin 0.0
--xmax 10.0 --ymax 10.0 --zmax 5.0 --outside
Options: `-o/--output TEXT` (required), `--xmin/ymin/zmin/xmax/ymax/zmax FLOAT` (all required), `--outside`, `--add-to-project`cli-anything-cloudcompare --project myproject.json cloud crop 0
-o /data/exterior.las
--xmin 0.0 --ymin 0.0 --zmin 0.0
--xmax 10.0 --ymax 10.0 --zmax 5.0 --outside
-o /data/exterior.las
--xmin 0.0 --ymin 0.0 --zmin 0.0
--xmax 10.0 --ymax 10.0 --zmax 5.0 --outside
选项:`-o/--output TEXT`(必填),`--xmin/ymin/zmin/xmax/ymax/zmax FLOAT`(均必填),`--outside`,`--add-to-project`cloud normals
cloud normals
Compute surface normals via the octree method.
bash
undefined通过八叉树方法计算表面法线。
bash
undefinedCompute normals at octree level 6
在八叉树层级6计算法线
cli-anything-cloudcompare --project myproject.json cloud normals 0
-o /data/with_normals.ply --level 6
-o /data/with_normals.ply --level 6
cli-anything-cloudcompare --project myproject.json cloud normals 0
-o /data/with_normals.ply --level 6
-o /data/with_normals.ply --level 6
Compute normals oriented toward +Z
计算朝向+Z轴的法线
cli-anything-cloudcompare --project myproject.json cloud normals 0
-o /data/with_normals.ply --level 6 --orientation plus_z --add-to-project
-o /data/with_normals.ply --level 6 --orientation plus_z --add-to-project
Options: `-o/--output TEXT` (required), `--level INTEGER` (1–10), `--orientation [plus_x|plus_y|plus_z|minus_x|minus_y|minus_z]`, `--add-to-project`cli-anything-cloudcompare --project myproject.json cloud normals 0
-o /data/with_normals.ply --level 6 --orientation plus_z --add-to-project
-o /data/with_normals.ply --level 6 --orientation plus_z --add-to-project
选项:`-o/--output TEXT`(必填),`--level INTEGER`(1–10),`--orientation [plus_x|plus_y|plus_z|minus_x|minus_y|minus_z]`,`--add-to-project`cloud invert-normals
cloud invert-normals
Flip all normal vectors in the cloud.
bash
cli-anything-cloudcompare --project myproject.json cloud invert-normals 0 \
-o /data/flipped_normals.ply --add-to-projectOptions: (required),
-o/--output TEXT--add-to-project翻转点云中的所有法线向量。
bash
cli-anything-cloudcompare --project myproject.json cloud invert-normals 0 \
-o /data/flipped_normals.ply --add-to-project选项:(必填),
-o/--output TEXT--add-to-projectcloud filter-sor
cloud filter-sor
Statistical Outlier Removal — removes isolated noise points.
bash
undefined统计离群点移除——移除孤立的噪声点。
bash
undefinedDefault parameters (k=6 neighbours, 1.0 std ratio)
默认参数(k=6个邻域点,1.0标准差比率)
cli-anything-cloudcompare --project myproject.json cloud filter-sor 0
-o /data/denoised.las
-o /data/denoised.las
cli-anything-cloudcompare --project myproject.json cloud filter-sor 0
-o /data/denoised.las
-o /data/denoised.las
Custom parameters
自定义参数
cli-anything-cloudcompare --project myproject.json cloud filter-sor 0
-o /data/denoised.las --nb-points 12 --std-ratio 2.0 --add-to-project
-o /data/denoised.las --nb-points 12 --std-ratio 2.0 --add-to-project
Options: `-o/--output TEXT` (required), `--nb-points INTEGER`, `--std-ratio FLOAT`, `--add-to-project`cli-anything-cloudcompare --project myproject.json cloud filter-sor 0
-o /data/denoised.las --nb-points 12 --std-ratio 2.0 --add-to-project
-o /data/denoised.las --nb-points 12 --std-ratio 2.0 --add-to-project
选项:`-o/--output TEXT`(必填),`--nb-points INTEGER`,`--std-ratio FLOAT`,`--add-to-project`cloud noise-filter
cloud noise-filter
Remove noisy points using the PCL noise filter (KNN or radius mode).
bash
undefined使用PCL噪声过滤器(KNN或半径模式)移除噪声点。
bash
undefinedKNN mode (default)
KNN模式(默认)
cli-anything-cloudcompare --project myproject.json cloud noise-filter 0
-o /data/clean.las --knn 8 --noisiness 1.0
-o /data/clean.las --knn 8 --noisiness 1.0
cli-anything-cloudcompare --project myproject.json cloud noise-filter 0
-o /data/clean.las --knn 8 --noisiness 1.0
-o /data/clean.las --knn 8 --noisiness 1.0
Radius mode
半径模式
cli-anything-cloudcompare --project myproject.json cloud noise-filter 0
-o /data/clean.las --radius 0.1 --use-radius --add-to-project
-o /data/clean.las --radius 0.1 --use-radius --add-to-project
Options: `-o/--output TEXT` (required), `--knn INTEGER`, `--noisiness FLOAT`, `--radius FLOAT`, `--use-radius`, `--absolute`, `--add-to-project`cli-anything-cloudcompare --project myproject.json cloud noise-filter 0
-o /data/clean.las --radius 0.1 --use-radius --add-to-project
-o /data/clean.las --radius 0.1 --use-radius --add-to-project
选项:`-o/--output TEXT`(必填),`--knn INTEGER`,`--noisiness FLOAT`,`--radius FLOAT`,`--use-radius`,`--absolute`,`--add-to-project`cloud filter-csf
cloud filter-csf
Ground filtering using the Cloth Simulation Filter (CSF) algorithm. Separates ground from off-ground points (buildings, vegetation).
bash
undefined使用布料模拟过滤(CSF)算法进行地面过滤。将地面点与非地面点(建筑物、植被)分离。
bash
undefinedExtract ground only — mixed terrain
仅提取地面——混合地形
cli-anything-cloudcompare --project myproject.json cloud filter-csf 0
--ground /data/ground.las --scene relief
--ground /data/ground.las --scene relief
cli-anything-cloudcompare --project myproject.json cloud filter-csf 0
--ground /data/ground.las --scene relief
--ground /data/ground.las --scene relief
Split ground + off-ground — urban scene
分离地面+非地面——城市场景
cli-anything-cloudcompare --project myproject.json cloud filter-csf 0
--ground /data/ground.las
--offground /data/buildings.las
--scene flat --cloth-resolution 0.5 --class-threshold 0.3
--ground /data/ground.las
--offground /data/buildings.las
--scene flat --cloth-resolution 0.5 --class-threshold 0.3
cli-anything-cloudcompare --project myproject.json cloud filter-csf 0
--ground /data/ground.las
--offground /data/buildings.las
--scene flat --cloth-resolution 0.5 --class-threshold 0.3
--ground /data/ground.las
--offground /data/buildings.las
--scene flat --cloth-resolution 0.5 --class-threshold 0.3
Steep forested slope with slope post-processing
带坡度后处理的陡峭森林斜坡
cli-anything-cloudcompare --project myproject.json cloud filter-csf 0
--ground /data/terrain.las --scene slope --proc-slope --add-to-project
--ground /data/terrain.las --scene slope --proc-slope --add-to-project
Options: `-g/--ground TEXT` (required), `-u/--offground TEXT`, `--scene [slope|relief|flat]`, `--cloth-resolution FLOAT`, `--class-threshold FLOAT`, `--max-iteration INTEGER`, `--proc-slope`, `--add-to-project`cli-anything-cloudcompare --project myproject.json cloud filter-csf 0
--ground /data/terrain.las --scene slope --proc-slope --add-to-project
--ground /data/terrain.las --scene slope --proc-slope --add-to-project
选项:`-g/--ground TEXT`(必填),`-u/--offground TEXT`,`--scene [slope|relief|flat]`,`--cloth-resolution FLOAT`,`--class-threshold FLOAT`,`--max-iteration INTEGER`,`--proc-slope`,`--add-to-project`cloud filter-sf
cloud filter-sf
Filter a cloud by scalar field value range (keep points where SF ∈ [min, max]).
bash
undefined按标量字段值范围过滤点云(保留SF ∈ [min, max]的点)。
bash
undefinedKeep points with SF value between 10 and 50
保留SF值在10到50之间的点
cli-anything-cloudcompare --project myproject.json cloud filter-sf 0
-o /data/filtered.las --min 10.0 --max 50.0
-o /data/filtered.las --min 10.0 --max 50.0
cli-anything-cloudcompare --project myproject.json cloud filter-sf 0
-o /data/filtered.las --min 10.0 --max 50.0
-o /data/filtered.las --min 10.0 --max 50.0
Filter using a specific SF index
使用特定SF索引进行过滤
cli-anything-cloudcompare --project myproject.json cloud filter-sf 0
-o /data/filtered.las --min 0.0 --max 1.5 --sf-index 2 --add-to-project
-o /data/filtered.las --min 0.0 --max 1.5 --sf-index 2 --add-to-project
Options: `-o/--output TEXT` (required), `--min FLOAT` (required), `--max FLOAT` (required), `--sf-index INTEGER`, `--add-to-project`cli-anything-cloudcompare --project myproject.json cloud filter-sf 0
-o /data/filtered.las --min 0.0 --max 1.5 --sf-index 2 --add-to-project
-o /data/filtered.las --min 0.0 --max 1.5 --sf-index 2 --add-to-project
选项:`-o/--output TEXT`(必填),`--min FLOAT`(必填),`--max FLOAT`(必填),`--sf-index INTEGER`,`--add-to-project`cloud sf-from-coord
cloud sf-from-coord
Convert a coordinate axis (X/Y/Z) to a scalar field. Commonly used to create a height (Z) scalar field.
bash
undefined将坐标轴(X/Y/Z)转换为标量字段。通常用于创建高度(Z)标量字段。
bash
undefinedCreate Z scalar field (height)
创建Z标量字段(高度)
cli-anything-cloudcompare --project myproject.json cloud sf-from-coord 0
-o /data/with_z_sf.las --dim z --add-to-project
-o /data/with_z_sf.las --dim z --add-to-project
cli-anything-cloudcompare --project myproject.json cloud sf-from-coord 0
-o /data/with_z_sf.las --dim z --add-to-project
-o /data/with_z_sf.las --dim z --add-to-project
Create X scalar field with a specific active index
创建指定活动索引的X标量字段
cli-anything-cloudcompare --project myproject.json cloud sf-from-coord 0
-o /data/with_x_sf.las --dim x --sf-index 0
-o /data/with_x_sf.las --dim x --sf-index 0
Options: `-o/--output TEXT` (required), `--dim [x|y|z]` (default: z), `--sf-index INTEGER`, `--add-to-project`cli-anything-cloudcompare --project myproject.json cloud sf-from-coord 0
-o /data/with_x_sf.las --dim x --sf-index 0
-o /data/with_x_sf.las --dim x --sf-index 0
选项:`-o/--output TEXT`(必填),`--dim [x|y|z]`(默认:z),`--sf-index INTEGER`,`--add-to-project`cloud sf-filter-z
cloud sf-filter-z
Convenience command: convert Z → scalar field and filter by height range in one step.
bash
undefined便捷命令:一步完成Z→标量字段转换和高度范围过滤。
bash
undefinedExtract points between z=1.0 m and z=2.5 m
提取z=1.0米到z=2.5米之间的点
cli-anything-cloudcompare --project myproject.json cloud sf-filter-z 0
-o /data/slice.las --min 1.0 --max 2.5 --add-to-project
-o /data/slice.las --min 1.0 --max 2.5 --add-to-project
cli-anything-cloudcompare --project myproject.json cloud sf-filter-z 0
-o /data/slice.las --min 1.0 --max 2.5 --add-to-project
-o /data/slice.las --min 1.0 --max 2.5 --add-to-project
Only apply upper bound
仅应用上限
cli-anything-cloudcompare --project myproject.json cloud sf-filter-z 0
-o /data/below_5m.las --max 5.0
-o /data/below_5m.las --max 5.0
Options: `-o/--output TEXT` (required), `--min FLOAT`, `--max FLOAT`, `--add-to-project`cli-anything-cloudcompare --project myproject.json cloud sf-filter-z 0
-o /data/below_5m.las --max 5.0
-o /data/below_5m.las --max 5.0
选项:`-o/--output TEXT`(必填),`--min FLOAT`,`--max FLOAT`,`--add-to-project`cloud sf-to-rgb
cloud sf-to-rgb
Convert the active scalar field to RGB colours.
bash
cli-anything-cloudcompare --project myproject.json cloud sf-to-rgb 0 \
-o /data/coloured.ply --add-to-projectOptions: (required),
-o/--output TEXT--add-to-project将活动标量字段转换为RGB颜色。
bash
cli-anything-cloudcompare --project myproject.json cloud sf-to-rgb 0 \
-o /data/coloured.ply --add-to-project选项:(必填),
-o/--output TEXT--add-to-projectcloud rgb-to-sf
cloud rgb-to-sf
Convert RGB colours to a scalar field (luminance value).
bash
cli-anything-cloudcompare --project myproject.json cloud rgb-to-sf 0 \
-o /data/luminance.las --add-to-projectOptions: (required),
-o/--output TEXT--add-to-project将RGB颜色转换为标量字段(亮度值)。
bash
cli-anything-cloudcompare --project myproject.json cloud rgb-to-sf 0 \
-o /data/luminance.las --add-to-project选项:(必填),
-o/--output TEXT--add-to-projectcloud curvature
cloud curvature
Compute curvature scalar field (MEAN or GAUSS).
bash
undefined计算曲率标量字段(MEAN或GAUSS)。
bash
undefinedMean curvature with radius 0.5 m
半径0.5米的平均曲率
cli-anything-cloudcompare --project myproject.json cloud curvature 0
-o /data/curvature.las --type mean --radius 0.5
-o /data/curvature.las --type mean --radius 0.5
cli-anything-cloudcompare --project myproject.json cloud curvature 0
-o /data/curvature.las --type mean --radius 0.5
-o /data/curvature.las --type mean --radius 0.5
Gaussian curvature
高斯曲率
cli-anything-cloudcompare --project myproject.json cloud curvature 0
-o /data/curvature.las --type gauss --radius 0.5 --add-to-project
-o /data/curvature.las --type gauss --radius 0.5 --add-to-project
Options: `-o/--output TEXT` (required), `--type [mean|gauss]`, `-r/--radius FLOAT`, `--add-to-project`cli-anything-cloudcompare --project myproject.json cloud curvature 0
-o /data/curvature.las --type gauss --radius 0.5 --add-to-project
-o /data/curvature.las --type gauss --radius 0.5 --add-to-project
选项:`-o/--output TEXT`(必填),`--type [mean|gauss]`,`-r/--radius FLOAT`,`--add-to-project`cloud roughness
cloud roughness
Compute roughness scalar field (deviation from local best-fit plane).
bash
cli-anything-cloudcompare --project myproject.json cloud roughness 0 \
-o /data/roughness.las --radius 0.2 --add-to-projectOptions: (required), ,
-o/--output TEXT-r/--radius FLOAT--add-to-project计算粗糙度标量字段(与局部最佳拟合平面的偏差)。
bash
cli-anything-cloudcompare --project myproject.json cloud roughness 0 \
-o /data/roughness.las --radius 0.2 --add-to-project选项:(必填),,
-o/--output TEXT-r/--radius FLOAT--add-to-projectcloud density
cloud density
Compute point density scalar field.
bash
undefined计算点密度标量字段。
bash
undefinedKNN density
KNN密度
cli-anything-cloudcompare --project myproject.json cloud density 0
-o /data/density.las --type knn --radius 0.5
-o /data/density.las --type knn --radius 0.5
cli-anything-cloudcompare --project myproject.json cloud density 0
-o /data/density.las --type knn --radius 0.5
-o /data/density.las --type knn --radius 0.5
Surface density
表面密度
cli-anything-cloudcompare --project myproject.json cloud density 0
-o /data/density.las --type surface --radius 1.0 --add-to-project
-o /data/density.las --type surface --radius 1.0 --add-to-project
Options: `-o/--output TEXT` (required), `-r/--radius FLOAT`, `--type [knn|surface|volume]`, `--add-to-project`cli-anything-cloudcompare --project myproject.json cloud density 0
-o /data/density.las --type surface --radius 1.0 --add-to-project
-o /data/density.las --type surface --radius 1.0 --add-to-project
选项:`-o/--output TEXT`(必填),`-r/--radius FLOAT`,`--type [knn|surface|volume]`,`--add-to-project`cloud segment-cc
cloud segment-cc
Segment cloud into connected components (clusters). Each component is saved as a separate file.
bash
undefined将点云分割为连通组件(簇)。每个组件保存为单独的文件。
bash
undefinedSegment with octree level 8, minimum 100 points per component
八叉树层级8,每个组件最少100个点
cli-anything-cloudcompare --project myproject.json cloud segment-cc 0
-o /data/components/ --octree-level 8 --min-points 100
-o /data/components/ --octree-level 8 --min-points 100
cli-anything-cloudcompare --project myproject.json cloud segment-cc 0
-o /data/components/ --octree-level 8 --min-points 100
-o /data/components/ --octree-level 8 --min-points 100
Save components as PLY files
将组件保存为PLY文件
cli-anything-cloudcompare --project myproject.json cloud segment-cc 0
-o /data/components/ --octree-level 6 --min-points 50 --fmt ply
-o /data/components/ --octree-level 6 --min-points 50 --fmt ply
Options: `-o/--output-dir TEXT` (required), `--octree-level INTEGER`, `--min-points INTEGER`, `--fmt TEXT`cli-anything-cloudcompare --project myproject.json cloud segment-cc 0
-o /data/components/ --octree-level 6 --min-points 50 --fmt ply
-o /data/components/ --octree-level 6 --min-points 50 --fmt ply
选项:`-o/--output-dir TEXT`(必填),`--octree-level INTEGER`,`--min-points INTEGER`,`--fmt TEXT`cloud merge
cloud merge
Merge all clouds in the project into a single cloud.
bash
cli-anything-cloudcompare --project myproject.json cloud merge \
-o /data/merged.las --add-to-projectOptions: (required),
-o/--output TEXT--add-to-project将项目中所有点云合并为单个点云。
bash
cli-anything-cloudcompare --project myproject.json cloud merge \
-o /data/merged.las --add-to-project选项:(必填),
-o/--output TEXT--add-to-projectcloud mesh-delaunay
cloud mesh-delaunay
Build a 2.5-D Delaunay triangulation mesh from a cloud.
bash
undefined从点云构建2.5维Delaunay三角化网格。
bash
undefinedBasic Delaunay mesh
基础Delaunay网格
cli-anything-cloudcompare --project myproject.json cloud mesh-delaunay 0
-o /data/surface.obj
-o /data/surface.obj
cli-anything-cloudcompare --project myproject.json cloud mesh-delaunay 0
-o /data/surface.obj
-o /data/surface.obj
Best-fit plane with max edge length limit
带最大边长限制的最佳拟合平面
cli-anything-cloudcompare --project myproject.json cloud mesh-delaunay 0
-o /data/surface.ply --best-fit --max-edge-length 2.0 --add-to-project
-o /data/surface.ply --best-fit --max-edge-length 2.0 --add-to-project
Options: `-o/--output TEXT` (required), `--best-fit`, `--max-edge-length FLOAT`, `--add-to-project`
---cli-anything-cloudcompare --project myproject.json cloud mesh-delaunay 0
-o /data/surface.ply --best-fit --max-edge-length 2.0 --add-to-project
-o /data/surface.ply --best-fit --max-edge-length 2.0 --add-to-project
选项:`-o/--output TEXT`(必填),`--best-fit`,`--max-edge-length FLOAT`,`--add-to-project`
---4. mesh — Mesh Operations (3 commands)
4. mesh — 网格操作(3条命令)
mesh add
mesh add
Add a mesh file to the project.
bash
cli-anything-cloudcompare --project myproject.json mesh add /data/model.obj将网格文件添加到项目中。
bash
cli-anything-cloudcompare --project myproject.json mesh add /data/model.objAdd with label
添加带标签的网格
cli-anything-cloudcompare --project myproject.json mesh add /data/model.ply -l "building model"
Options: `-l/--label TEXT`cli-anything-cloudcompare --project myproject.json mesh add /data/model.ply -l "building model"
选项:`-l/--label TEXT`mesh list
mesh list
List all meshes in the project.
bash
cli-anything-cloudcompare --project myproject.json mesh list列出项目中所有的网格。
bash
cli-anything-cloudcompare --project myproject.json mesh listJSON output
JSON格式输出
cli-anything-cloudcompare --project myproject.json --json mesh list
undefinedcli-anything-cloudcompare --project myproject.json --json mesh list
undefinedmesh sample
mesh sample
Sample a point cloud from a mesh surface.
bash
undefined从网格表面采样点云。
bash
undefinedSample 50 000 points from mesh at index 0
从索引0的网格采样50000个点
cli-anything-cloudcompare --project myproject.json mesh sample 0
-o /data/sampled.las -n 50000
-o /data/sampled.las -n 50000
cli-anything-cloudcompare --project myproject.json mesh sample 0
-o /data/sampled.las -n 50000
-o /data/sampled.las -n 50000
Add sampled cloud back to project
将采样的点云添加回项目
cli-anything-cloudcompare --project myproject.json mesh sample 0
-o /data/sampled.las -n 100000 --add-to-project
-o /data/sampled.las -n 100000 --add-to-project
Options: `-o/--output TEXT` (required), `-n/--count INTEGER`, `--add-to-project`
---cli-anything-cloudcompare --project myproject.json mesh sample 0
-o /data/sampled.las -n 100000 --add-to-project
-o /data/sampled.las -n 100000 --add-to-project
选项:`-o/--output TEXT`(必填),`-n/--count INTEGER`,`--add-to-project`
---5. distance — Distance Computation (2 commands)
5. distance — 距离计算(2条命令)
distance c2c
distance c2c
Compute cloud-to-cloud distances. Adds a distance scalar field to the compared cloud.
bash
undefined计算点云到点云的距离。为对比点云添加距离标量字段。
bash
undefinedCompare cloud 1 to reference cloud 0
将点云1与参考点云0对比
cli-anything-cloudcompare --project myproject.json distance c2c
--compare 1 --reference 0 -o /data/distances.las
--compare 1 --reference 0 -o /data/distances.las
cli-anything-cloudcompare --project myproject.json distance c2c
--compare 1 --reference 0 -o /data/distances.las
--compare 1 --reference 0 -o /data/distances.las
Split into X/Y/Z components at octree level 8
在八叉树层级8下拆分为X/Y/Z分量
cli-anything-cloudcompare --project myproject.json distance c2c
--compare 1 --reference 0 -o /data/distances.las
--split-xyz --octree-level 8 --add-to-project
--compare 1 --reference 0 -o /data/distances.las
--split-xyz --octree-level 8 --add-to-project
Options: `--compare TEXT` (required), `--reference TEXT` (required), `-o/--output TEXT` (required), `--split-xyz`, `--octree-level INTEGER`, `--add-to-project`cli-anything-cloudcompare --project myproject.json distance c2c
--compare 1 --reference 0 -o /data/distances.las
--split-xyz --octree-level 8 --add-to-project
--compare 1 --reference 0 -o /data/distances.las
--split-xyz --octree-level 8 --add-to-project
选项:`--compare TEXT`(必填),`--reference TEXT`(必填),`-o/--output TEXT`(必填),`--split-xyz`,`--octree-level INTEGER`,`--add-to-project`distance c2m
distance c2m
Compute cloud-to-mesh distances. Adds a distance scalar field to the cloud.
bash
undefined计算点云到网格的距离。为点云添加距离标量字段。
bash
undefinedBasic cloud-to-mesh distance
基础点云到网格距离计算
cli-anything-cloudcompare --project myproject.json distance c2m
--cloud 0 --mesh 0 -o /data/c2m_dist.las
--cloud 0 --mesh 0 -o /data/c2m_dist.las
cli-anything-cloudcompare --project myproject.json distance c2m
--cloud 0 --mesh 0 -o /data/c2m_dist.las
--cloud 0 --mesh 0 -o /data/c2m_dist.las
With flipped normals and unsigned distances
翻转法线并计算无符号距离
cli-anything-cloudcompare --project myproject.json distance c2m
--cloud 0 --mesh 0 -o /data/c2m_dist.las
--flip-normals --unsigned --add-to-project
--cloud 0 --mesh 0 -o /data/c2m_dist.las
--flip-normals --unsigned --add-to-project
Options: `--cloud INTEGER` (required), `--mesh INTEGER` (required), `-o/--output TEXT` (required), `--flip-normals`, `--unsigned`, `--add-to-project`
---cli-anything-cloudcompare --project myproject.json distance c2m
--cloud 0 --mesh 0 -o /data/c2m_dist.las
--flip-normals --unsigned --add-to-project
--cloud 0 --mesh 0 -o /data/c2m_dist.las
--flip-normals --unsigned --add-to-project
选项:`--cloud INTEGER`(必填),`--mesh INTEGER`(必填),`-o/--output TEXT`(必填),`--flip-normals`,`--unsigned`,`--add-to-project`
---6. transform — Transformations and Registration (2 commands)
6. transform — 变换与配准(2条命令)
transform apply
transform apply
Apply a 4×4 rigid-body transformation matrix to a cloud.
bash
undefined将4×4刚体变换矩阵应用到点云。
bash
undefinedApply a transformation matrix from file
应用文件中的变换矩阵
cli-anything-cloudcompare --project myproject.json transform apply 0
-o /data/transformed.las -m /data/matrix.txt
-o /data/transformed.las -m /data/matrix.txt
cli-anything-cloudcompare --project myproject.json transform apply 0
-o /data/transformed.las -m /data/matrix.txt
-o /data/transformed.las -m /data/matrix.txt
Apply the inverse transformation
应用逆变换
cli-anything-cloudcompare --project myproject.json transform apply 0
-o /data/transformed.las -m /data/matrix.txt --inverse --add-to-project
-o /data/transformed.las -m /data/matrix.txt --inverse --add-to-project
The matrix file must contain 4 rows of 4 space-separated values:1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
Options: `-o/--output TEXT` (required), `-m/--matrix TEXT` (required), `--inverse`, `--add-to-project`cli-anything-cloudcompare --project myproject.json transform apply 0
-o /data/transformed.las -m /data/matrix.txt --inverse --add-to-project
-o /data/transformed.las -m /data/matrix.txt --inverse --add-to-project
矩阵文件必须包含4行,每行4个空格分隔的值:1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
选项:`-o/--output TEXT`(必填),`-m/--matrix TEXT`(必填),`--inverse`,`--add-to-project`transform icp
transform icp
Run ICP (Iterative Closest Point) registration to align one cloud to another.
bash
undefined运行ICP(迭代最近点)配准以将一个点云对齐到另一个点云。
bash
undefinedBasic ICP alignment
基础ICP对齐
cli-anything-cloudcompare --project myproject.json transform icp
--aligned 1 --reference 0 -o /data/aligned.las
--aligned 1 --reference 0 -o /data/aligned.las
cli-anything-cloudcompare --project myproject.json transform icp
--aligned 1 --reference 0 -o /data/aligned.las
--aligned 1 --reference 0 -o /data/aligned.las
ICP with overlap and iteration control
带重叠度和迭代控制的ICP
cli-anything-cloudcompare --project myproject.json transform icp
--aligned 1 --reference 0 -o /data/aligned.las
--max-iter 50 --overlap 80 --min-error-diff 1e-6 --add-to-project
--aligned 1 --reference 0 -o /data/aligned.las
--max-iter 50 --overlap 80 --min-error-diff 1e-6 --add-to-project
Options: `--aligned INTEGER` (required), `--reference INTEGER` (required), `-o/--output TEXT` (required), `--max-iter INTEGER`, `--min-error-diff FLOAT`, `--overlap FLOAT`, `--add-to-project`
---cli-anything-cloudcompare --project myproject.json transform icp
--aligned 1 --reference 0 -o /data/aligned.las
--max-iter 50 --overlap 80 --min-error-diff 1e-6 --add-to-project
--aligned 1 --reference 0 -o /data/aligned.las
--max-iter 50 --overlap 80 --min-error-diff 1e-6 --add-to-project
选项:`--aligned INTEGER`(必填),`--reference INTEGER`(必填),`-o/--output TEXT`(必填),`--max-iter INTEGER`,`--min-error-diff FLOAT`,`--overlap FLOAT`,`--add-to-project`
---7. export — Export Clouds and Meshes (4 commands)
7. export — 导出点云和网格(4条命令)
export formats
export formats
List all available export format presets.
bash
cli-anything-cloudcompare export formats列出所有可用的导出格式预设。
bash
cli-anything-cloudcompare export formatsJSON output
JSON格式输出
cli-anything-cloudcompare --json export formats
undefinedcli-anything-cloudcompare --json export formats
undefinedexport cloud
export cloud
Export a cloud to a target format.
bash
undefined将点云导出为目标格式。
bash
undefinedExport cloud at index 0 as LAS
将索引0的点云导出为LAS
cli-anything-cloudcompare --project myproject.json export cloud 0 /data/output.las
cli-anything-cloudcompare --project myproject.json export cloud 0 /data/output.las
Export as PLY using preset
使用预设导出为PLY
cli-anything-cloudcompare --project myproject.json export cloud 0 /data/output.ply -f ply
cli-anything-cloudcompare --project myproject.json export cloud 0 /data/output.ply -f ply
Overwrite if file exists
如果文件存在则覆盖
cli-anything-cloudcompare --project myproject.json export cloud 0 /data/output.las -f las --overwrite
Supported presets: `las`, `laz`, `ply`, `pcd`, `xyz`, `asc`, `csv`, `bin`, `e57`
Options: `-f/--preset TEXT`, `--overwrite`cli-anything-cloudcompare --project myproject.json export cloud 0 /data/output.las -f las --overwrite
支持的预设:`las`, `laz`, `ply`, `pcd`, `xyz`, `asc`, `csv`, `bin`, `e57`
选项:`-f/--preset TEXT`, `--overwrite`export mesh
export mesh
Export a mesh to a target format.
bash
undefined将网格导出为目标格式。
bash
undefinedExport mesh at index 0 as OBJ
将索引0的网格导出为OBJ
cli-anything-cloudcompare --project myproject.json export mesh 0 /data/model.obj
cli-anything-cloudcompare --project myproject.json export mesh 0 /data/model.obj
Export as STL
导出为STL
cli-anything-cloudcompare --project myproject.json export mesh 0 /data/model.stl -f stl --overwrite
Supported presets: `obj`, `stl`, `ply`, `bin`
Options: `-f/--preset TEXT`, `--overwrite`cli-anything-cloudcompare --project myproject.json export mesh 0 /data/model.stl -f stl --overwrite
支持的预设:`obj`, `stl`, `ply`, `bin`
选项:`-f/--preset TEXT`, `--overwrite`export batch
export batch
Batch export all project clouds to a directory.
bash
undefined批量导出项目中所有点云到指定目录。
bash
undefinedExport all clouds as LAS
将所有点云导出为LAS
cli-anything-cloudcompare --project myproject.json export batch
-d /data/exports/ -f las
-d /data/exports/ -f las
cli-anything-cloudcompare --project myproject.json export batch
-d /data/exports/ -f las
-d /data/exports/ -f las
Overwrite existing files
覆盖现有文件
cli-anything-cloudcompare --project myproject.json export batch
-d /data/exports/ -f ply --overwrite
-d /data/exports/ -f ply --overwrite
Options: `-d/--output-dir TEXT` (required), `-f/--preset TEXT`, `--overwrite`
---cli-anything-cloudcompare --project myproject.json export batch
-d /data/exports/ -f ply --overwrite
-d /data/exports/ -f ply --overwrite
选项:`-d/--output-dir TEXT`(必填),`-f/--preset TEXT`, `--overwrite`
---8. info — Installation Info (1 command)
8. info — 安装信息(1条命令)
Show CloudCompare installation path and version.
bash
cli-anything-cloudcompare info显示CloudCompare的安装路径和版本。
bash
cli-anything-cloudcompare infoJSON output
JSON格式输出
cli-anything-cloudcompare --json info
---cli-anything-cloudcompare --json info
---9. repl — Interactive REPL (1 command)
9. repl — 交互式REPL(1条命令)
Start the interactive REPL session with history and undo support.
bash
undefined启动带历史记录和撤销支持的交互式REPL会话。
bash
undefinedStart REPL without a project
不加载项目启动REPL
cli-anything-cloudcompare repl
cli-anything-cloudcompare repl
Start REPL with an existing project
加载现有项目启动REPL
cli-anything-cloudcompare repl -p myproject.json
cli-anything-cloudcompare repl -p myproject.json
Equivalent: run without subcommand
等效方式:不指定子命令运行
cli-anything-cloudcompare --project myproject.json
Options: `-p/--project TEXT`
Inside the REPL, type `help` to list available commands or `session undo` to revert the last operation.
---cli-anything-cloudcompare --project myproject.json
选项:`-p/--project TEXT`
在REPL中,输入`help`列出可用命令,或输入`session undo`撤销最后一次操作。
---Supported File Formats
支持的文件格式
| Format | Extension | Read | Write | Notes |
|---|---|---|---|---|
| LAS | | ✓ | ✓ | LiDAR standard, supports intensity/RGB |
| LAZ | | ✓ | ✓ | Compressed LAS |
| PLY | | ✓ | ✓ | ASCII or binary |
| PCD | | ✓ | ✓ | PCL format |
| XYZ | | ✓ | ✓ | Plain text XYZ |
| ASC | | ✓ | ✓ | ASCII with header |
| CSV | | ✓ | ✓ | Comma-separated |
| E57 | | ✓ | ✓ | ASTM scanner exchange |
| BIN | | ✓ | ✓ | CloudCompare native binary |
| OBJ | | ✓ | ✓ | Mesh (Wavefront) |
| STL | | ✓ | ✓ | Mesh (3D printing) |
| 格式 | 扩展名 | 读取 | 写入 | 说明 |
|---|---|---|---|---|
| LAS | | ✓ | ✓ | LiDAR标准格式,支持强度/RGB |
| LAZ | | ✓ | ✓ | 压缩LAS格式 |
| PLY | | ✓ | ✓ | ASCII或二进制格式 |
| PCD | | ✓ | ✓ | PCL格式 |
| XYZ | | ✓ | ✓ | 纯文本XYZ格式 |
| ASC | | ✓ | ✓ | 带头部的ASCII格式 |
| CSV | | ✓ | ✓ | 逗号分隔格式 |
| E57 | | ✓ | ✓ | ASTM扫描仪交换格式 |
| BIN | | ✓ | ✓ | CloudCompare原生二进制格式 |
| OBJ | | ✓ | ✓ | 网格(Wavefront)格式 |
| STL | | ✓ | ✓ | 网格(3D打印)格式 |
Typical Workflows
典型工作流
Workflow 1: LiDAR Pre-processing Pipeline
工作流1:LiDAR预处理流程
bash
P=myproject.jsonbash
P=myproject.json1. Create project and load scan
1. 创建项目并加载扫描数据
cli-anything-cloudcompare project new -o $P
cli-anything-cloudcompare --project $P cloud add /data/scan.las
cli-anything-cloudcompare --project $P cloud list # note index → 0
cli-anything-cloudcompare project new -o $P
cli-anything-cloudcompare --project $P cloud add /data/scan.las
cli-anything-cloudcompare --project $P cloud list # 记录索引 → 0
2. Denoise
2. 去噪
cli-anything-cloudcompare --project $P cloud filter-sor 0
-o /data/denoised.las --nb-points 6 --std-ratio 1.0 --add-to-project
-o /data/denoised.las --nb-points 6 --std-ratio 1.0 --add-to-project
cli-anything-cloudcompare --project $P cloud filter-sor 0
-o /data/denoised.las --nb-points 6 --std-ratio 1.0 --add-to-project
-o /data/denoised.las --nb-points 6 --std-ratio 1.0 --add-to-project
3. Subsample to 5 cm grid
3. 按5厘米网格下采样
cli-anything-cloudcompare --project $P cloud subsample 1
-o /data/subsampled.las -m spatial -n 0.05 --add-to-project
-o /data/subsampled.las -m spatial -n 0.05 --add-to-project
cli-anything-cloudcompare --project $P cloud subsample 1
-o /data/subsampled.las -m spatial -n 0.05 --add-to-project
-o /data/subsampled.las -m spatial -n 0.05 --add-to-project
4. Extract ground plane (CSF)
4. 提取地面(CSF算法)
cli-anything-cloudcompare --project $P cloud filter-csf 2
--ground /data/ground.las --offground /data/objects.las
--scene relief --add-to-project
--ground /data/ground.las --offground /data/objects.las
--scene relief --add-to-project
cli-anything-cloudcompare --project $P cloud filter-csf 2
--ground /data/ground.las --offground /data/objects.las
--scene relief --add-to-project
--ground /data/ground.las --offground /data/objects.las
--scene relief --add-to-project
5. Export result
5. 导出结果
cli-anything-cloudcompare --project $P export cloud 3 /data/ground_final.las -f las --overwrite
undefinedcli-anything-cloudcompare --project $P export cloud 3 /data/ground_final.las -f las --overwrite
undefinedWorkflow 2: Change Detection Between Two Scans
工作流2:两次扫描之间的变化检测
bash
P=compare.json
cli-anything-cloudcompare project new -o $P
cli-anything-cloudcompare --project $P cloud add /data/scan_2023.las # index 0
cli-anything-cloudcompare --project $P cloud add /data/scan_2024.las # index 1bash
P=compare.json
cli-anything-cloudcompare project new -o $P
cli-anything-cloudcompare --project $P cloud add /data/scan_2023.las # 索引0
cli-anything-cloudcompare --project $P cloud add /data/scan_2024.las # 索引1ICP alignment (align 2024 to 2023)
ICP对齐(将2024年扫描对齐到2023年)
cli-anything-cloudcompare --project $P transform icp
--aligned 1 --reference 0 -o /data/aligned_2024.las
--overlap 90 --add-to-project # index 2
--aligned 1 --reference 0 -o /data/aligned_2024.las
--overlap 90 --add-to-project # index 2
cli-anything-cloudcompare --project $P transform icp
--aligned 1 --reference 0 -o /data/aligned_2024.las
--overlap 90 --add-to-project # 索引2
--aligned 1 --reference 0 -o /data/aligned_2024.las
--overlap 90 --add-to-project # 索引2
Cloud-to-cloud distance
点云到点云距离计算
cli-anything-cloudcompare --project $P distance c2c
--compare 2 --reference 0 -o /data/change_map.las --add-to-project
--compare 2 --reference 0 -o /data/change_map.las --add-to-project
cli-anything-cloudcompare --project $P distance c2c
--compare 2 --reference 0 -o /data/change_map.las --add-to-project
--compare 2 --reference 0 -o /data/change_map.las --add-to-project
Export as LAS with distance scalar field
导出带距离标量字段的LAS文件
cli-anything-cloudcompare --project $P export cloud 3 /data/change_map_final.las --overwrite
undefinedcli-anything-cloudcompare --project $P export cloud 3 /data/change_map_final.las --overwrite
undefinedWorkflow 3: Height Slice Extraction
工作流3:高度切片提取
bash
P=slice.json
cli-anything-cloudcompare project new -o $P
cli-anything-cloudcompare --project $P cloud add /data/building.lasbash
P=slice.json
cli-anything-cloudcompare project new -o $P
cli-anything-cloudcompare --project $P cloud add /data/building.lasExtract points at 2–3 m height (floor level)
提取高度2–3米的点(楼层)
cli-anything-cloudcompare --project $P cloud sf-filter-z 0
-o /data/floor_slice.las --min 2.0 --max 3.0 --add-to-project
-o /data/floor_slice.las --min 2.0 --max 3.0 --add-to-project
cli-anything-cloudcompare --project $P cloud sf-filter-z 0
-o /data/floor_slice.las --min 2.0 --max 3.0 --add-to-project
-o /data/floor_slice.las --min 2.0 --max 3.0 --add-to-project
Export
导出
cli-anything-cloudcompare --project $P export cloud 1 /data/floor_slice_out.las --overwrite
undefinedcli-anything-cloudcompare --project $P export cloud 1 /data/floor_slice_out.las --overwrite
undefinedWorkflow 4: Surface Reconstruction
工作流4:表面重建
bash
P=mesh.json
cli-anything-cloudcompare project new -o $P
cli-anything-cloudcompare --project $P cloud add /data/terrain.lasbash
P=mesh.json
cli-anything-cloudcompare project new -o $P
cli-anything-cloudcompare --project $P cloud add /data/terrain.lasCompute normals
计算法线
cli-anything-cloudcompare --project $P cloud normals 0
-o /data/with_normals.ply --level 6 --orientation plus_z --add-to-project
-o /data/with_normals.ply --level 6 --orientation plus_z --add-to-project
cli-anything-cloudcompare --project $P cloud normals 0
-o /data/with_normals.ply --level 6 --orientation plus_z --add-to-project
-o /data/with_normals.ply --level 6 --orientation plus_z --add-to-project
Delaunay mesh
Delaunay网格构建
cli-anything-cloudcompare --project $P cloud mesh-delaunay 1
-o /data/terrain_mesh.obj --max-edge-length 1.0 --add-to-project
-o /data/terrain_mesh.obj --max-edge-length 1.0 --add-to-project
cli-anything-cloudcompare --project $P cloud mesh-delaunay 1
-o /data/terrain_mesh.obj --max-edge-length 1.0 --add-to-project
-o /data/terrain_mesh.obj --max-edge-length 1.0 --add-to-project
Export mesh
导出网格
cli-anything-cloudcompare --project $P export mesh 0 /data/terrain_mesh_final.obj --overwrite
---cli-anything-cloudcompare --project $P export mesh 0 /data/terrain_mesh_final.obj --overwrite
---Error Handling
错误处理
| Exit Code | Meaning |
|---|---|
| Success |
| General error (see stderr for details) |
| Invalid arguments |
Common errors:
bash
undefined| 退出码 | 含义 |
|---|---|
| 成功 |
| 通用错误(查看stderr获取详情) |
| 参数无效 |
常见错误:
bash
undefinedCloudCompare not found
CloudCompare未找到
→ Install CloudCompare; check cli-anything-cloudcompare info
cli-anything-cloudcompare info→ 安装CloudCompare;运行cli-anything-cloudcompare info
检查
cli-anything-cloudcompare infoIndex out of range
索引超出范围
→ Run cloud list
or mesh list
to confirm valid indices
cloud listmesh list→ 运行cloud list
或mesh list
确认有效索引
cloud listmesh listFile already exists (no --overwrite)
文件已存在(未添加--overwrite)
→ Add --overwrite flag to export commands
→ 在导出命令中添加--overwrite参数
fcntl not available (Windows)
fcntl不可用(Windows)
→ File locking is skipped automatically; project save still works
→ 文件锁定会自动跳过;项目保存仍可正常工作
---
---For AI Agents
面向AI Agent的使用建议
- Always use flag for parseable output
--json - Check return codes — 0 for success, non-zero for errors
- Parse stderr for error messages on failure
- Use absolute paths for all file arguments
- Verify output files exist after export operations
- Chain with to build multi-step pipelines without re-loading files
--add-to-project - Use to discover valid cloud indices before each operation
cloud list --json - Use to discover available format presets
export formats --json
- 始终使用参数以获得可解析的输出
--json - 检查返回码——0表示成功,非0表示错误
- 解析stderr获取失败时的错误信息
- 所有文件参数使用绝对路径
- 导出操作后验证输出文件是否存在
- 结合参数构建多步骤流程,无需重新加载文件
--add-to-project - **使用**在每次操作前获取有效的点云索引
cloud list --json - **使用**查看可用的格式预设
export formats --json
Version
版本信息
| Component | Version |
|---|---|
| cli-anything-cloudcompare | 1.0.0 |
| CloudCompare (tested) | 2.13.2 |
| Python (minimum) | 3.10 |
| 组件 | 版本 |
|---|---|
| cli-anything-cloudcompare | 1.0.0 |
| CloudCompare(测试兼容) | 2.13.2 |
| Python(最低要求) | 3.10 |