PointCloud

PointCloud

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

Constructor

new PointCloud()

Extends

Members

containsColors :bool

Gets a value indicating whether or not the points in this point cloud have colors assigned to them.
Type:
  • bool

containsHiddenFlags :bool

Gets a value indicating whether or not the points in this point cloud have hidden flags assigned to them.
Type:
  • bool

containsNormals :bool

Gets a value indicating whether or not the points in this point cloud have normals assigned to them.
Type:
  • bool

count :int

Gets the number of points in this point cloud.
Type:
  • int

hasBrepForm :bool

Inherited From:
Returns true if the Brep.TryConvertBrep function will be successful for this object
Type:
  • bool

hiddenPointCount :int

Gets the number of points that have their Hidden flag set.
Type:
  • int

isDeformable :bool

Inherited From:
true if object can be accurately modified with "squishy" transformations like projections, shears, and non-uniform scaling.
Type:
  • bool

isValid :bool

Inherited From:
Tests an object to see if it is valid.
Type:
  • bool

objectType :ObjectType

Inherited From:
Useful for switch statements that need to differentiate between basic object types like points, curves, surfaces, and so on.
Type:
  • ObjectType

userStringCount

Inherited From:

Methods

add(point)

Append a new point to the end of the list.
Parameters:
Name Type Description
point Array.<x, y, z> Point to append.

add(point, normal)

Append a new point to the end of the list.
Parameters:
Name Type Description
point Array.<x, y, z> Point to append.
normal Array.<x, y, z> Normal vector of new point.

add(point, normal)

Append a new point to the end of the list.
Parameters:
Name Type Description
point Array.<x, y, z> Point to append.
normal Array.<x, y, z> Normal vector of new point.

add(point, normal, color)

Append a new point to the end of the list.
Parameters:
Name Type Description
point Array.<x, y, z> Point to append.
normal Array.<x, y, z> Normal vector of new point.
color Color Color of new point.

addRange(points)

Appends a collection of points to this point cloud.
Parameters:
Name Type Description
points IEnumerable.<Point3d> Points to append.

addRange(points, normals)

Appends a collection of points and normal vectors to this point cloud.
Parameters:
Name Type Description
points IEnumerable.<Point3d> Points to append.
normals IEnumerable.<Vector3d> Normal Vectors to append.

addRange(points, normals)

Appends a collection of points and normal vectors to this point cloud.
Parameters:
Name Type Description
points IEnumerable.<Point3d> Points to append.
normals IEnumerable.<Vector3d> Normal Vectors to append.

addRange(points, normals, colors)

Appends a collection of points, normal vectors, and colors to this point cloud.
Parameters:
Name Type Description
points IEnumerable.<Point3d> Points to append.
normals IEnumerable.<Vector3d> Normal Vectors to append.
colors IEnumerable.<Color> Colors to append.

appendNew() → {PointCloudItem}

Appends a new PointCloudItem to the end of this point cloud.
Returns:
The newly appended item.
Type
PointCloudItem

clearColors()

Destroys the color information in this point cloud.

clearHiddenFlags()

Destroys the hidden flag information in this point cloud.

clearNormals()

Destroys the normal vector information in this point cloud.

closestPoint(testPoint) → {int}

Returns index of the closest point in the point cloud to a given test point.
Parameters:
Name Type Description
testPoint Array.<x, y, z> .
Returns:
Index of point in the point cloud on success. -1 on failure.
Type
int

duplicate() → {GeometryBase}

Inherited From:
Constructs a deep (full) copy of this object.
Returns:
An object of the same type as this, with the same properties and behavior.
Type
GeometryBase

encode()

Inherited From:
...

getBoundingBox(plane) → {Array}

Inherited From:
Aligned Bounding box solver. Gets the plane aligned bounding box.
Parameters:
Name Type Description
plane Plane Orientation plane for BoundingBox.
Returns:
[BoundingBox, Box]
  • (BoundingBox) A BoundingBox in plane coordinates.
  • (Box) Aligned box in World coordinates.
Type
Array

getColors() → {Array.<Color>}

Copy all the point colors in this point cloud to an array.
Returns:
An array containing all the colors in this point cloud.
Type
Array.<Color>

getNormals() → {Array.<Vector3d>}

Copy all the normal vectors in this point cloud to an array.
Returns:
An array containing all the normals in this point cloud.
Type
Array.<Vector3d>

getPoints() → {Array.<Point3d>}

Copy all the point coordinates in this point cloud to an array.
Returns:
An array containing all the points in this point cloud.
Type
Array.<Point3d>

getUserString()

Inherited From:
...

getUserStrings()

Inherited From:
...

insert(index, point)

Inserts a new point into the point list.
Parameters:
Name Type Description
index int Insertion index.
point Array.<x, y, z> Point to append.

insert(index, point, normal)

Inserts a new point into the point list.
Parameters:
Name Type Description
index int Insertion index.
point Array.<x, y, z> Point to append.
normal Array.<x, y, z> Normal vector of new point.

insert(index, point, normal)

Inserts a new point into the point list.
Parameters:
Name Type Description
index int Insertion index.
point Array.<x, y, z> Point to append.
normal Array.<x, y, z> Normal vector of new point.

insert(index, point, normal, color)

Inserts a new point into the point list.
Parameters:
Name Type Description
index int Insertion index.
point Array.<x, y, z> Point to append.
normal Array.<x, y, z> Normal vector of new point.
color Color Color of new point.

insertNew(index) → {PointCloudItem}

Inserts a new at a specific position of the point cloud.
Parameters:
Name Type Description
index int Index of new item.
Returns:
The newly inserted item.
Type
PointCloudItem

insertRange(index, points)

Append a collection of points to this point cloud.
Parameters:
Name Type Description
index int Index at which to insert the new collection.
points IEnumerable.<Point3d> Points to append.

makeDeformable() → {bool}

Inherited From:
If possible, converts the object into a form that can be accurately modified with "squishy" transformations like projections, shears, an non-uniform scaling.
Returns:
false if object cannot be converted to a deformable object. true if object was already deformable or was converted into a deformable object.
Type
bool

merge(other)

Copies the point values of another point cloud into this one.
Parameters:
Name Type Description
other PointCloud PointCloud to merge with this one.

pointAt(index)

Returns the location of the point at a specific index.
Parameters:
Name Type Description
index int The index.

rdkXml()

Inherited From:
...

removeAt(index)

Remove the point at the given index.
Parameters:
Name Type Description
index int Index of point to remove.

rotate(angleRadians, rotationAxis, rotationCenter) → {bool}

Inherited From:
Rotates the object about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule).
Parameters:
Name Type Description
angleRadians double Angle of rotation in radians.
rotationAxis Array.<x, y, z> Direction of the axis of rotation.
rotationCenter Array.<x, y, z> Point on the axis of rotation.
Returns:
true if geometry successfully rotated.
Type
bool

scale(scaleFactor) → {bool}

Inherited From:
Scales the object by the specified factor. The scale is centered at the origin.
Parameters:
Name Type Description
scaleFactor double The uniform scaling factor.
Returns:
true if geometry successfully scaled.
Type
bool

setUserString()

Inherited From:
...

toJSON()

Inherited From:
Create a JSON string representation of this object

toThreejsJSON()

...

transform(xform) → {bool}

Inherited From:
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.
Parameters:
Name Type Description
xform Transform Transformation to apply to geometry.
Returns:
true if geometry successfully transformed.
Type
bool

translate(translationVector) → {bool}

Inherited From:
Translates the object along the specified vector.
Parameters:
Name Type Description
translationVector Array.<x, y, z> A moving vector.
Returns:
true if geometry successfully translated.
Type
bool