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

Constructors

PointCloud

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

PointCloud

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

PointCloud

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

PointCloud

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

Properties

ContainsColors

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

ContainsHiddenFlags

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

ContainsNormals

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

ContainsPointValues

#Since v7.5
public bool ContainsPointValues { get; }
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.

Count

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

Disposed

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

HasBrepForm

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

HasUserData

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

HiddenPointCount

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

IsDeformable

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

IsDocumentControlled

public sealed override bool IsDocumentControlled { get; }
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.
inherited fromGeometryBase

IsShallowDuplicate

public bool IsShallowDuplicate { get; }
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)
inherited fromGeometryBase

IsValid

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

ObjectType

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

UserData

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

UserDictionary

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

UserStringCount

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

Indexers

this[]

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

Methods

Add

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

Add

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

Add

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

Add

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

Add

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

AddRange

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

AddRange

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

AddRange

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

AddRange

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

AddRange

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

AppendNew

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

AsReadOnlyListOfPoints

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

ClearColors

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

ClearHiddenFlags

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

ClearNormals

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

ClearPointValues

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

ClosestPoint

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

ComponentIndex

[ConstOperation] public ComponentIndex 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.
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

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

CreateContourCurves

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

CreateContourCurves

#Since v8.0
public Curve[] CreateContourCurves(Point3d startPoint, Point3d endPoint, double interval, double absoluteTolerance, double maxDistance, double minDistance, bool openCurves, bool createSpline, bool createPolyline, double fitTolerance)
Creates a planar curves by intersecting a plane with a point cloud.
startPoint (Point3d)Start point for vector that is normal to contour plane.
endPoint (Point3d)End point for vector that is normal to contour plane.
interval (double)he interval or distance between contours.
absoluteTolerance (double)The document's model absolute tolerance
maxDistance (double)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 (double)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 (bool)True for open, false for closed.
createSpline (bool)Creates a smooth curve. You can create both a curve and a polyline.
createPolyline (bool)Creates a polyline. You can create both a curve and a polyline.
fitTolerance (double)The tolerance used to fit the curve through the polyline.
The intersection curves if successful, an empty array if unsuccessful.

CreateFromMesh

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

CreateSectionCurve

#Since v8.0
public Curve[] CreateSectionCurve(Plane plane, double absoluteTolerance, double maxDistance, double minDistance, bool openCurves, bool createSpline, bool createPolyline, double fitTolerance)
Creates a planar curve by intersecting a plane with a point cloud.
plane (Plane)The plane to intersect with
absoluteTolerance (double)The document's model absolute tolerance
maxDistance (double)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 (double)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 (bool)True for open, false for closed.
createSpline (bool)Creates a smooth curve. You can create both a curve and a polyline.
createPolyline (bool)Creates a polyline. You can create both a curve and a polyline.
fitTolerance (double)The tolerance used to fit the curve through the polyline.
The intersection curves if successful, an empty array if unsuccessful.

CreateSectionCurve

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

DataCRC

[CLSCompliant(false)] public uint DataCRC(uint currentRemainder)
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.
inherited fromGeometryBase
currentRemainder (uint)The current remainder value.
CRC of the information the defines the object.

DeleteAllUserStrings

public void DeleteAllUserStrings()
inherited fromGeometryBase

DeleteUserString

public bool DeleteUserString(string key)
inherited fromGeometryBase
key (string)

Dispose

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

Dispose

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

Duplicate

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

DuplicateShallow

public GeometryBase 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.
inherited fromGeometryBase
An object of the same type as this object.

This behavior is overridden by implementing classes.

EnsurePrivateCopy

public void 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.
inherited fromCommonObject

ExpertGetValues

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

GetBoundingBox

[ConstOperation] public BoundingBox GetBoundingBox(bool accurate)
Bounding box solver. Gets the world axis aligned bounding box for the geometry.
inherited fromGeometryBase
accurate (bool)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.
The bounding box of the geometry in world coordinates or BoundingBox.Empty if not bounding box could be found.

GetBoundingBox

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

GetBoundingBox

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

GetBoundingBox

[ConstOperation] public virtual BoundingBox GetBoundingBox(Transform xform)
Aligned Bounding box solver. Gets the world axis aligned bounding box for the transformed geometry.
inherited fromGeometryBase
xform (Transform)Transformation to apply to object prior to the BoundingBox computation. The geometry itself is not modified.
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
[ConstOperation] public Color[] GetColors()
Copy all the point colors in this point cloud to an array.
An array containing all the colors in this point cloud.

GetEnumerator

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

GetNormals

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

GetObjectData

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

GetPoints

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

GetPointValues

#Since v7.5
[ConstOperation] public double[] GetPointValues()
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.
An array containing all the extra point values in this point cloud.

GetRandomSubsample

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

GetRandomSubsample

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

GetUnsafeLock

#Since v7.9
public PointCloudUnsafeLock GetUnsafeLock(bool writable)
Allows the developer to obtain unsafe pointers to the underlying unmanaged data structures of the PointCloud.
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).
writable (bool)true if user will need to write onto the structure. false otherwise.
A lock that needs to be released.

GetUserString

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

GetUserStrings

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

Insert

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

Insert

#Since v7.5
public void Insert(int index, Point3d point, Vector3d normal, Color color, double value)
Inserts a new point into the point list.
index (int)Insertion index.
point (Point3d)Point to append.
normal (Vector3d)Normal vector of new point.
color (Color)Color of new point.
value (double)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
public void Insert(int index, Point3d point, Vector3d normal, Color color)
Inserts a new point into the point list.
index (int)Insertion index.
point (Point3d)Point to append.
normal (Vector3d)Normal vector of new point.
color (Color)Color of new point.

Insert

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

Insert

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

InsertNew

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

InsertRange

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

IsValidWithLog

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

MakeDeformable

public bool MakeDeformable()
If possible, converts the object into a form that can be accurately modified with "squishy" transformations like projections, shears, an non-uniform scaling.
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

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

Merge

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

NonConstOperation

protected override void NonConstOperation()
Destroy cache handle
inherited fromGeometryBase

OnSwitchToNonConst

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

PointAt

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

ReleaseUnsafeLock

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

RemoveAt

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

RemoveRange

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

Rotate

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

Scale

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

SetUserString

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

ShrinkWrap

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

Split

#Since v9.0
[ConstOperation] public bool Split(Plane plane, out PointCloud above, out PointCloud below)
Split a point cloud into two parts using a plane, or returns false if the pointcloud is not partitioned by plane.
plane (Plane)The splitting plane
above (out PointCloud)The part of the point cloud that is above the plane
below (out PointCloud)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

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

Transform

public bool Transform(Transform xform)
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.
inherited fromGeometryBase
xform (Transform)Transformation to apply to geometry.
true if geometry successfully transformed.

Translate

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

Translate

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