Represents a collection of coordinates with optional normal vectors and colors.

Constructors

PointCloud

#Since v5.0
Initializes a new instance of the PointCloud class that is empty.
public PointCloud()

PointCloud

#Since v5.0
Initializes a new instance of the PointCloud class, copying the content from a set of points.
public PointCloud(
points
A list or an array of Point3d, or any object that implements IEnumerable<Point3d>.
)

PointCloud

#Since v5.0
Initializes a new instance of the PointCloud class, copying (Merge) the content of another point cloud.
public PointCloud(
PointCloud
other
)

PointCloud

#
Binds with the Rhino default serializer to support object persistence.
protected PointCloud(
info,
Some storage.
context
The source and destination of the stream.
)

Properties

ContainsColors

#Since v5.0
Gets a value indicating whether or not the points in this point cloud have colors assigned to them.
public bool ContainsColors { get; }

ContainsHiddenFlags

#Since v5.0
Gets a value indicating whether or not the points in this point cloud have hidden flags assigned to them.
public bool ContainsHiddenFlags { get; }

ContainsNormals

#Since v5.0
Gets a value indicating whether or not the points in this point cloud have normals assigned to them.
public bool ContainsNormals { get; }

ContainsPointValues

#Since v7.5
Gets a value indicating whether or not the points in this point cloud have extra values assigned to them. Extra values can be used to store a user-defined values, such as intensity.
public bool ContainsPointValues { get; }

Count

#Since v5.0
Gets the number of points in this point cloud.
public int Count { get; }

Disposed

Indicates if this object has been disposed or the document it originally belonged to has been disposed.
public bool Disposed { get; }
inherited fromCommonObject

HasBrepForm

Returns true if the Brep.TryConvertBrep function will be successful for this object
public bool HasBrepForm { get; }
inherited fromGeometryBase

HasUserData

Gets true if this class has any custom information attached to it through UserData.
public bool HasUserData { get; }
inherited fromCommonObject

HiddenPointCount

#Since v5.0
Gets the number of points that have their Hidden flag set.
public int HiddenPointCount { get; }

IsDeformable

true if object can be accurately modified with "squishy" transformations like projections, shears, and non-uniform scaling.
public bool IsDeformable { get; }
inherited fromGeometryBase

IsDocumentControlled

If true this object may not be modified. Any properties or functions that attempt to modify this object when it is set to "IsReadOnly" will throw a NotSupportedException.
public sealed override bool IsDocumentControlled { get; }
inherited fromGeometryBase

IsShallowDuplicate

Is this instance a 'shallow copy'. Shallow copies are no different than regular instances with the exception that they will convert to complete independent 'deep' copies if a non const operation is perform on the instance (something that mutates the internal data)
public bool IsShallowDuplicate { get; }
inherited fromGeometryBase

IsValid

Tests an object to see if it is valid.
public virtual bool IsValid { get; }
inherited fromCommonObject

ObjectType

Useful for switch statements that need to differentiate between basic object types like points, curves, surfaces, and so on.
[CLSCompliant(false)] public ObjectType ObjectType { get; }
inherited fromGeometryBase

UserData

List of custom information that is attached to this class.
public UserDataList UserData { get; }
inherited fromCommonObject

UserDictionary

Dictionary of custom information attached to this class. The dictionary is actually user data provided as an easy to use shareable set of information.
public ArchivableDictionary UserDictionary { get; }
inherited fromCommonObject

UserStringCount

Gets the amount of user strings.
public int UserStringCount { get; }
inherited fromGeometryBase

Indexers

this[]

#
Gets the item at the given index.
public PointCloudItem this[
index
Index of item to retrieve.
] { get; }
The item at the given index.

Methods

Add

#Since v5.0
Append a new point to the end of the list.
public void Add(
point,
Point to append.
color
Color of new point.
)

Add

#Since v7.5
Append a new point to the end of the list.
public void Add(
point,
Point to append.
normal,
Normal vector of new point.
color,
Color of new point.
value
Extra value of new point. An extra value can be used to store a user-defined value, such as intensity.
)

Add

#Since v5.0
Append a new point to the end of the list.
public void Add(
point,
Point to append.
normal,
Normal vector of new point.
color
Color of new point.
)

Add

#Since v5.0
Append a new point to the end of the list.
public void Add(
point,
Point to append.
normal
Normal vector of new point.
)

Add

#Since v5.0
Append a new point to the end of the list.
public void Add(
point
Point to append.
)

AddRange

#Since v6.0
Appends a collection of points and normal vectors to this point cloud.
public void AddRange(
points,
Points to append.
colors
Colors to append.
)

AddRange

#Since v7.5
Appends a collection of points, normal vectors, colors, and extra values to this point cloud.
public void AddRange(
points,
Points to append.
normals,
Normal Vectors to append.
colors,
Colors to append.
values
Exta point values to append. Extra values can be used to store a user-defined values, such as intensity.
)

AddRange

#Since v6.0
Appends a collection of points, normal vectors, and colors to this point cloud.
public void AddRange(
points,
Points to append.
normals,
Normal Vectors to append.
colors
Colors to append.
)

AddRange

#Since v6.0
Appends a collection of points and normal vectors to this point cloud.
public void AddRange(
points,
Points to append.
normals
Normal Vectors to append.
)
ArgumentExceptionthrown if points and normals have differing numbers of elements

AddRange

#Since v5.0
Appends a collection of points to this point cloud.
public void AddRange(
points
Points to append.
)

AppendNew

#Since v5.0
Appends a new PointCloudItem to the end of this point cloud.
public PointCloudItem AppendNew()
The newly appended item.

AsReadOnlyListOfPoints

#Since v6.0
Returns an enumerator and list indexer over point cloud locations.
public IReadOnlyList<Point3d> AsReadOnlyListOfPoints()
The read-only list. This is a reference to the present point cloud.

ClearColors

#Since v5.0
Destroys the color information in this point cloud.
public void ClearColors()

ClearHiddenFlags

#Since v5.0
Destroys the hidden flag information in this point cloud.
public void ClearHiddenFlags()

ClearNormals

#Since v5.0
Destroys the normal vector information in this point cloud.
public void ClearNormals()

ClearPointValues

#Since v7.5
Destroys the extra value information in this point cloud. Extra values can be used to store a user-defined values, such as intensity.
public void ClearPointValues()

ClosestPoint

#Since v5.0
Returns index of the closest point in the point cloud to a given test point.
[ConstOperation] public int ClosestPoint(
testPoint
.
)
Index of point in the point cloud on success. -1 on failure.

ComponentIndex

If this piece of geometry is a component in something larger, like a BrepEdge in a Brep, then this function returns the component index.
[ConstOperation] public ComponentIndex ComponentIndex()
inherited fromGeometryBase
This object's component index. If this object is not a sub-piece of a larger geometric entity, then the returned index has m_type = ComponentIndex.InvalidType and m_index = -1.

ConstructConstObject

Assigns a parent object and a sub-object index to this.
protected void ConstructConstObject(
parentObject,
The parent object.
subobjectIndex
The sub-object index.
)
inherited fromCommonObject

CreateContourCurves

#Since v8.0
Creates a planar curves by intersecting a plane with a point cloud.
public Curve[] CreateContourCurves(
contourStart,
Start point for vector that is normal to contour plane.
contourEnd,
End point for vector that is normal to contour plane.
interval,
he interval or distance between contours.
absoluteTolerance
The document's model absolute tolerance
)
The intersection curves if successful, an empty array if unsuccessful.

CreateContourCurves

#Since v8.0
Creates a planar curves by intersecting a plane with a point cloud.
public Curve[] CreateContourCurves(
startPoint,
Start point for vector that is normal to contour plane.
endPoint,
End point for vector that is normal to contour plane.
interval,
he interval or distance between contours.
absoluteTolerance,
The document's model absolute tolerance
maxDistance,
Maximum distance to plane. The thickness of the "slab" around the plane from which sample points are taken. Those sample points are projected to the section plane and a polyline is found that connects them. This distance depends on the size of the point cloud and the spacing of the points.
minDistance,
Minimum distance between points. A threshold for the minimum spacing between adjacent sample points. If there are points closer than that, some are not used.
openCurves,
True for open, false for closed.
createSpline,
Creates a smooth curve. You can create both a curve and a polyline.
createPolyline,
Creates a polyline. You can create both a curve and a polyline.
fitTolerance
The tolerance used to fit the curve through the polyline.
)
The intersection curves if successful, an empty array if unsuccessful.

CreateFromMesh

#Since v8.29
Creates a point cloud from a mesh.
public static PointCloud CreateFromMesh(
Mesh
mesh
Mesh to copy vertices, vertex normals, and colors.
)
A point cloud if successful, otherwise null.

CreateSectionCurve

#Since v8.0
Creates a planar curve by intersecting a plane with a point cloud.
public Curve[] CreateSectionCurve(
plane,
The plane to intersect with
absoluteTolerance,
The document's model absolute tolerance
maxDistance,
Maximum distance to plane. The thickness of the "slab" around the plane from which sample points are taken. Those sample points are projected to the section plane and a polyline is found that connects them. This distance depends on the size of the point cloud and the spacing of the points.
minDistance,
Minimum distance between points. A threshold for the minimum spacing between adjacent sample points. If there are points closer than that, some are not used.
openCurves,
True for open, false for closed.
createSpline,
Creates a smooth curve. You can create both a curve and a polyline.
createPolyline,
Creates a polyline. You can create both a curve and a polyline.
fitTolerance
The tolerance used to fit the curve through the polyline.
)
The intersection curves if successful, an empty array if unsuccessful.

CreateSectionCurve

#Since v8.0
Creates planar curves by intersecting a plane with a point cloud.
public Curve[] CreateSectionCurve(
plane,
The plane to intersect with
absoluteTolerance
The document's model absolute tolerance
)
The intersection curves if successful, an empty array if unsuccessful.

DataCRC

Returns a CRC calculated from the information that defines the object. This CRC can be used as a quick way to see if two objects are not identical.
[CLSCompliant(false)] public uint DataCRC(
currentRemainder
The current remainder value.
)
inherited fromGeometryBase
CRC of the information the defines the object.

DeleteAllUserStrings

public void DeleteAllUserStrings()
inherited fromGeometryBase

DeleteUserString

public bool DeleteUserString(
key
)
inherited fromGeometryBase

Dispose

Actively reclaims unmanaged resources that this instance uses.
public void Dispose()
inherited fromCommonObject

Dispose

Overridden in order to destroy local display cache information
protected override void Dispose(
disposing
)
inherited fromGeometryBase

Duplicate

Constructs a deep (full) copy of this object.
public virtual GeometryBase Duplicate()
inherited fromGeometryBase
An object of the same type as this, with the same properties and behavior.

DuplicateShallow

Constructs a light copy of this object. By "light", it is meant that the same underlying data is used until something is done to attempt to change it. For example, you could have a shallow copy of a very heavy mesh object and the same underlying data will be used when doing things like inspecting the number of faces on the mesh. If you modify the location of one of the mesh vertices, the shallow copy will create a full duplicate of the underlying mesh data and the shallow copy will become a deep copy.
public GeometryBase DuplicateShallow()
inherited fromGeometryBase
An object of the same type as this object.

This behavior is overridden by implementing classes.

EnsurePrivateCopy

If you want to keep a copy of this class around by holding onto it in a variable after a command completes, call EnsurePrivateCopy to make sure that this class is not tied to the document. You can call this function as many times as you want.
public void EnsurePrivateCopy()
inherited fromCommonObject

ExpertGetValues

#Since v9.0
Expert tool to get all values of a point cloud item. This method minimizes the number of pInvoke function calls.
public bool ExpertGetValues(
index,
The index of the point cloud item.
out Point3d
location,
Output location of the point cloud item.
normal,
Output normal vector of the point cloud item.
out Color
color,
Output color of the point cloud item.
out double
extra,
Extra value of the point cloud item.
out bool
hidden
Output hidden flag of the point cloud item.
)
True on success.

GetBoundingBox

Bounding box solver. Gets the world axis aligned bounding box for the geometry.
[ConstOperation] public BoundingBox GetBoundingBox(
accurate
If true, a physically accurate bounding box will be computed. If not, a bounding box estimate will be computed. For some geometry types there is no difference between the estimate and the accurate bounding box. Estimated bounding boxes can be computed much (much) faster than accurate (or "tight") bounding boxes. Estimated bounding boxes are always similar to or larger than accurate bounding boxes.
)
inherited fromGeometryBase
The bounding box of the geometry in world coordinates or BoundingBox.Empty if not bounding box could be found.

GetBoundingBox

Aligned Bounding box solver. Gets the plane aligned bounding box.
[ConstOperation] public BoundingBox GetBoundingBox(
plane,
Orientation plane for BoundingBox.
out Box
worldBox
Aligned box in World coordinates.
)
inherited fromGeometryBase
A BoundingBox in plane coordinates.

GetBoundingBox

Aligned Bounding box solver. Gets the plane aligned bounding box.
[ConstOperation] public BoundingBox GetBoundingBox(
plane
Orientation plane for BoundingBox.
)
inherited fromGeometryBase
A BoundingBox in plane coordinates.

GetBoundingBox

Aligned Bounding box solver. Gets the world axis aligned bounding box for the transformed geometry.
[ConstOperation] public virtual BoundingBox GetBoundingBox(
xform
Transformation to apply to object prior to the BoundingBox computation. The geometry itself is not modified.
)
inherited fromGeometryBase
The accurate bounding box of the transformed geometry in world coordinates or BoundingBox.Empty if not bounding box could be found.

GetColors

#Since v5.0
Copy all the point colors in this point cloud to an array.
[ConstOperation] public Color[] GetColors()
An array containing all the colors in this point cloud.

GetEnumerator

#Since v5.0
Gets an enumerator that allows to modify each point cloud point.
public IEnumerator<PointCloudItem> GetEnumerator()
A instance of IEnumerator<PointCloudItem>.

GetNormals

#Since v5.0
Copy all the normal vectors in this point cloud to an array.
[ConstOperation] public Vector3d[] GetNormals()
An array containing all the normals in this point cloud.

GetObjectData

Populates a System.Runtime.Serialization.SerializationInfo with the data needed to serialize the target object.
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] public virtual void GetObjectData(
info,
The System.Runtime.Serialization.SerializationInfo to populate with data.
context
The destination (see System.Runtime.Serialization.StreamingContext) for this serialization.
)
inherited fromCommonObject

GetPoints

#Since v5.0
Copy all the point coordinates in this point cloud to an array.
[ConstOperation] public Point3d[] GetPoints()
An array containing all the points in this point cloud.

GetPointValues

#Since v7.5
Copy all the extra point values in this point cloud to an array. Extra values can be used to store a user-defined value, such as intensity.
[ConstOperation] public double[] GetPointValues()
An array containing all the extra point values in this point cloud.

GetRandomSubsample

#Since v7.5
Returns a random subsample of a point cloud.
[ConstOperation] [CLSCompliant(false)] public PointCloud GetRandomSubsample(
numberOfPoints,
The number of points the new point cloud should contain.
cancelToken,
The cancellation token.
progress
The provider for progress updates.
)
A subsample of this point cloud if success, null otherwise.

GetRandomSubsample

#Since v7.5
Returns a random subsample of a point cloud.
[ConstOperation] [CLSCompliant(false)] public PointCloud GetRandomSubsample(
numberOfPoints
The number of points the new point cloud should contain.
)
A subsample of this point cloud if success, null otherwise.

GetUnsafeLock

#Since v7.9
Allows the developer to obtain unsafe pointers to the underlying unmanaged data structures of the PointCloud.
public PointCloudUnsafeLock GetUnsafeLock(
writable
true if user will need to write onto the structure. false otherwise.
)
Remarks: The lock implements the IDisposable interface, and one call of its IDisposable.Dispose() or ReleaseUnsafeLock(PointCloudUnsafeLock) will update the data structure as required. This can be achieved with a using statement (Using in Vb.Net).
A lock that needs to be released.

GetUserString

Gets user string from this geometry.
public string GetUserString(
key
id used to retrieve the string.
)
inherited fromGeometryBase
string associated with the key if successful. null if no key was found.

GetUserStrings

Gets a copy of all (user key string, user value string) pairs attached to this geometry.
public NameValueCollection GetUserStrings()
inherited fromGeometryBase
A new collection.

Insert

#Since v5.0
Inserts a new point into the point list.
public void Insert(
index,
Insertion index.
point,
Point to append.
color
Color of new point.
)

Insert

#Since v7.5
Inserts a new point into the point list.
public void Insert(
index,
Insertion index.
point,
Point to append.
normal,
Normal vector of new point.
color,
Color of new point.
value
An extra value of new point. An extra values can be used to store a user-defined value, such as intensity.
)

Insert

#Since v5.0
Inserts a new point into the point list.
public void Insert(
index,
Insertion index.
point,
Point to append.
normal,
Normal vector of new point.
color
Color of new point.
)

Insert

#Since v5.0
Inserts a new point into the point list.
public void Insert(
index,
Insertion index.
point,
Point to append.
normal
Normal vector of new point.
)

Insert

#Since v5.0
Inserts a new point into the point list.
public void Insert(
index,
Insertion index.
point
Point to append.
)

InsertNew

#Since v5.0
Inserts a new PointCloudItem at a specific position of the point cloud.
public PointCloudItem InsertNew(
index
Index of new item.
)
The newly inserted item.

InsertRange

#Since v5.0
Append a collection of points to this point cloud.
public void InsertRange(
index,
Index at which to insert the new collection.
points
Points to append.
)

IsValidWithLog

Determines if an object is valid. Also provides a report on errors if this object happens not to be valid.
public bool IsValidWithLog(
out string
log
A textual log. This out parameter is assigned during this call.
)
inherited fromCommonObject
true if this object is valid; false otherwise.

MakeDeformable

If possible, converts the object into a form that can be accurately modified with "squishy" transformations like projections, shears, an non-uniform scaling.
public bool MakeDeformable()
inherited fromGeometryBase
false if object cannot be converted to a deformable object. true if object was already deformable or was converted into a deformable object.

MemoryEstimate

Computes an estimate of the number of bytes that this object is using in memory.
[CLSCompliant(false)] [ConstOperation] public uint MemoryEstimate()
inherited fromGeometryBase
An estimated memory footprint.

Merge

#Since v5.0
Merges, or appends, a specified point cloud into this one.
public void Merge(
other
PointCloud to merge with this one.
)

NonConstOperation

Destroy cache handle
protected override void NonConstOperation()
inherited fromGeometryBase

OnSwitchToNonConst

Is called when a non-constant operation occurs.
protected override void OnSwitchToNonConst()
inherited fromGeometryBase

PointAt

#Since v6.0
Returns the location of the point at a specific index.
[ConstOperation] public Point3d PointAt(
index
The index.
)

ReleaseUnsafeLock

#Since v7.9
Updates the PointCloud data with the information that was stored via the PointCloudUnsafeLock.
public void ReleaseUnsafeLock(
pointCloudData
The data that will be unlocked.
)

RemoveAt

#Since v5.0
Remove the point at the given index.
public void RemoveAt(
index
Index of point to remove.
)

RemoveRange

#Since v7.5
Removes points at given indices.
public int RemoveRange(
indices
An array of indices of the points to remove.
)
The number of points removed from the point cloud.

Rotate

Rotates the object about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule).
public bool Rotate(
angleRadians,
Angle of rotation in radians.
rotationAxis,
Direction of the axis of rotation.
rotationCenter
Point on the axis of rotation.
)
inherited fromGeometryBase
true if geometry successfully rotated.

Scale

Scales the object by the specified factor. The scale is centered at the origin.
public bool Scale(
scaleFactor
The uniform scaling factor.
)
inherited fromGeometryBase
true if geometry successfully scaled.

SetUserString

Attach a user string (key,value combination) to this geometry.
public bool SetUserString(
key,
id used to retrieve this string.
value
string associated with key.
)
inherited fromGeometryBase
true on success.

ShrinkWrap

#Since v8.0
Returns a ShrinkWrap mesh from this point cloud object.
public Mesh ShrinkWrap()

Split

#Since v9.0
Split a point cloud into two parts using a plane, or returns false if the pointcloud is not partitioned by plane.
[ConstOperation] public bool Split(
plane,
The splitting plane
above,
The part of the point cloud that is above the plane
below
The part of the point cloud that is below the plane
)
true on success, false if the plane does not partition the cloud, or on error.
Explicit

IEnumerable.GetEnumerator

#Since v5.0
IEnumerator IEnumerable.GetEnumerator()

ToJSON

Create a JSON string representation of this object
public string ToJSON()
inherited fromCommonObject

Transform

Transforms the geometry. If the input Transform has a SimilarityType of OrientationReversing, you may want to consider flipping the transformed geometry after calling this function when it makes sense. For example, you may want to call Flip() on a Brep after transforming it.
public bool Transform(
Transform
xform
Transformation to apply to geometry.
)
inherited fromGeometryBase
true if geometry successfully transformed.

Translate

Translates the object along the specified vector.
public bool Translate(
x,
The X component.
y,
The Y component.
z
The Z component.
)
inherited fromGeometryBase
true if geometry successfully translated.

Translate

Translates the object along the specified vector.
public bool Translate(
translationVector
A moving vector.
)
inherited fromGeometryBase
true if geometry successfully translated.