Skip to content

Point Clouds

Stefan Maierhofer edited this page Nov 19, 2017 · 1 revision

Point Clouds

Point clouds can be loaded like this:

var a = PointCloud.Import("scan.pts"); // in-memory, limited size
WriteLine(a.PointCount);
WriteLine(a.Bounds);

By specifying an additional location for out-of-core data, all size limits will be removed.

var a = PointCloud.Import("scan.pts", @"C:\Data\mystore"); // out-of-core, unlimited size
var key = a.Id;

When using a store, the imported dataset will also be stored permanently and can be loaded again directly from the store, which is very fast:

var a = PointCloud.Load(key, @"C:\Data\mystore");

Operations

Point clouds can be merged into larger ones.

var a = PointCloud.Import("scan1.pts");
var b = PointCloud.Import("scan2.pts");
var m = a.Merge(b);

By the way, a and b are not touched by the merge operation and are still valid. Internally, m will of course efficiently reuse the data already stored for a and b.

Queries

Planes

// All points within maxDistance of given plane.
QueryPointsNearPlane(Plane3d plane, double maxDistance)

// All points within maxDistance of ANY of the given planes.
QueryPointsNearPlanes(Plane3d[] planes, double maxDistance)

// All points NOT within maxDistance of given plane.
QueryPointsNotNearPlane(Plane3d plane, double maxDistance)

// All points NOT within maxDistance of ALL the given planes.
QueryPointsNotNearPlanes(Plane3d[] planes, double maxDistance)

Polygons

// All points within maxDistance of given polygon.
QueryPointsNearPolygon(Polygon3d plane, double maxDistance)

// All points within maxDistance of ANY of the given polygons.
QueryPointsNearPolygons(Polygon3d[] planes, double maxDistance)

// All points NOT within maxDistance of given polygon.
QueryPointsNotNearPolygon(Polygon3d plane, double maxDistance)

// All points NOT within maxDistance of ALL the given polygons.
QueryPointsNotNearPolygons(Polygon3d[] planes, double maxDistance)

Box

// All points inside axis-aligned box (including boundary).
QueryPointsInsideBox(Box3d box)

// All points outside axis-aligned box (excluding boundary).
QueryPointsOutsideBox(Box3d box)

Convex Hull

// All points inside convex hull (including boundary).
QueryPointsInsideConvexHull(Hull3d convexHull)

// All points outside convex hull (excluding boundary).
QueryPointsOutsideConvexHull(Hull3d convexHull)
Clone this wiki locally
You can’t perform that action at this time.