Cyclone 3DR Script
from Technodigit, part of Hexagon. Copyright 1997-2023.
Loading...
Searching...
No Matches
SCloud Class Reference

Provide point cloud edition and creation methods. More...

Inheritance diagram for SCloud:
SComp

Public Types

enum  BestRectangleForce {
  NO_FORCE = 0 , FORCE_NORMAL = 1 , FORCE_PLANE = 2 , FORCE_MAIN_DIRECTION = 4 ,
  FORCE_LENGTH = 8 , FORCE_WIDTH = 16 , FORCE_SQUARE = 32 , FORCE_IN_BEST_PLANE = 64 ,
  FORCE_CENTER = 128
}
 How the best square slot is forced. More...
 
enum  CircleEnum { CIRCLE_FORCE_NOTHING = 0 , CIRCLE_FORCE_RADIUS = 1 , CIRCLE_FORCE_CENTER = 2 , CIRCLE_FORCE_NORMAL = 4 }
 Enum to know which parameter(s) are forced and do not need to be computed. More...
 
enum  CloudRepresentationTypeEnum {
  CLOUD_FLAT = 0 , CLOUD_SMOOTH = 1 , CLOUD_SMOOTH_BACK = 2 , CLOUD_COLORED = 3 ,
  CLOUD_INSPECTION = 4 , CLOUD_CLASSIFICATION = 6
}
 The different representation types for clouds. More...
 
enum  CloudScriptTypesEnum {
  _3PI = 5 , _3PI_TRANSF = 6 , ASC_ESRI = 16 , ASC_SCAN = 17 ,
  CSV_ASCII = 18 , CSV_CSLM = 19 , AUTO_DETECT = 21
}
 The set of possible files to load. More...
 
enum  CylinderEnum {
  CYL_FORCE_NOTHING = 0 , CYL_FORCE_RADIUS = 1 , CYL_INIT_RADIUS = 2 , CYL_FORCE_CENTER = 4 ,
  CYL_INIT_CENTER = 8 , CYL_FORCE_DIRECTION = 16 , CYL_INIT_DIRECTION = 32
}
 Enum to know which parameter(s) are forced and do not need to be computed. More...
 
enum  FillCloudEnum { FILL_ALL = 0 , FILL_IN_ONLY = 1 , FILL_OUT_ONLY = 2 , FILL_NONE = 3 }
 Enum to know which cloud(s) should be filled when separated from a feature or calculating a best feature. More...
 
enum  LineEnum { LINE_FORCE_NOTHING = 0 , LINE_FORCE_POINT = 1 , LINE_FORCE_DIRECTION = 2 }
 Enum to know which parameter(s) are forced and do not need to be computed. More...
 
enum  MeshingMode { LOW = 0 , MEDIUM = 1 , HIGH = 2 }
 Set various internal parameters to determine the number of triangles that will compose a mesh. A higher number of triangles means a more precise mesh, but at the cost of higher computation time. More...
 
enum  MethodBestCircleEnum { BEST_CIRCLE = 0 , BEST_CIRCULARITY = 3 }
 Method to measure the best circle. More...
 
enum  MethodBestSqSlotEnum { BEST_SQ_SLOT = 2 }
 Method to measure the slot (best, inner, outer) More...
 
enum  OutputCloudsTypeClippPlanesEnum { Clipped = 0 , Unclipped = 1 , BothClipping = 2 }
 Specify which clouds are kept. More...
 
enum  OutputCloudsTypeInspectionValuesEnum { Inside = 0 , Outside = 1 , Both = 2 }
 Specify which clouds are kept. More...
 
enum  PlaneEnum { PLANE_FORCE_NOTHING = 0 , PLANE_FORCE_POINT = 1 , PLANE_FORCE_NORMAL = 2 }
 Enum to know which parameter(s) are forced and do not need to be computed. More...
 
enum  SphereEnum { SPHERE_FORCE_NOTHING = 0 , SPHERE_FORCE_RADIUS = 1 , SPHERE_FORCE_CENTER = 2 }
 Enum to know which parameter(s) are forced and do not need to be computed. More...
 
- Public Types inherited from SComp
enum  VisibilityEnum { HIDDEN_ONLY = 0 , VISIBLE_ONLY = 1 , ANY_VISIBILITY = 2 }
 Visible criteria. More...
 

Public Member Functions

 AddPoint (SPoint pointToAdd)
 Add a new point to the cloud. More...
 
Object BestCircle (MethodBestCircleEnum method=SCloud.BEST_CIRCLE, number nbPointElim=0, CircleEnum force=SCloud.CIRCLE_FORCE_NOTHING, SPoint center=SPoint(), SVector normal=SVector(), number radius=1, FillCloudEnum fillCloud=SCloud.FILL_ALL)
 Compute the best circle fitting with the cloud in the mean squares sense.Best fit with all the points. More...
 
Object BestCone (FillCloudEnum fillCloud=SCloud.FILL_ALL, number nbPointsElim=0)
 Compute the best cone fitting with the cloud. More...
 
Object BestCylinder (number nbPointElim=0, CylinderEnum force=SCloud.CYL_FORCE_NOTHING, SPoint center=SPoint(), SVector directionVector=SVector(), number radius=1, FillCloudEnum fillCloud=SCloud.FILL_ALL)
 Initialize a SCylinder using the best cylinder extracted from a cloud (inner, outer...) More...
 
Object BestLine (number nbPointElim=0, LineEnum force=SCloud.LINE_FORCE_NOTHING, SPoint averagePoint=SPoint(), SVector directionVector=SVector(), FillCloudEnum fillCloud=SCloud.FILL_ALL)
 Compute the best line fitting with the cloud. More...
 
Object BestPlane (number nbPointElim=0, PlaneEnum force=SCloud.PLANE_FORCE_NOTHING, SPoint ptToForce=SPoint(), SVector directionToForce=SVector(), FillCloudEnum fillCloud=SCloud.FILL_ALL)
 Compute the best plane fitting with all points from the cloud. More...
 
Object BestSphere (number nbPointElim=0, SphereEnum force=SCloud.SPHERE_FORCE_NOTHING, SPoint center=SPoint(), number radius=0, FillCloudEnum fillCloud=SCloud.FILL_ALL)
 Compute the best sphere fitting with the cloud. More...
 
Object BestSqSlot (MethodBestSqSlotEnum method=SCloud.BEST_SQ_SLOT, number nbPointElim=0, BestRectangleForce force=SCloud.NO_FORCE, SPoint center=SPoint(), SVector normal=SVector(), SVector mainDirection=SVector(), number length=0, number width=0, FillCloudEnum fillCloud=SCloud.FILL_ALL)
 Compute the best square slot fitting with the cloud. More...
 
Object Chain (number chainingDist)
 Chain the current point cloud and creates the shortest SMultiline(s). More...
 
Object CleanFeatureOrientation (SFeature featureType, number angle, number distanceTolerance, boolean useEstimatedDirection, FillCloudEnum fillCloud=SCloud.FILL_ALL)
 Get all the points found to be scanned (or estimated) with an angle to the feature normal lower than a threshold. More...
 
Object CleanPolyOrientation (SPoly polyhedron, number angle, number distanceTolerance, boolean useEstimatedDirection, boolean checkForThinParts, FillCloudEnum fillCloud=SCloud.FILL_ALL)
 Get all the points found inside (or outside) a SPoly. More...
 
Object CleanWithLocalNormal (number angle, FillCloudEnum fillCloud=SCloud.FILL_ALL)
 Clean the cloud according to the angle between:
* the local estimated normal of one point.
* and the scanning direction of the point. More...
 
 Clear ()
 Deallocate memory of the object. More...
 
Object ClosestPoint (SPoint inputPt, SPoint centerPt=SPoint(), number distance=0)
 Find the point in the current cloud that is the closest from an input point and optionally inside a sphere. More...
 
Object Compare (SCloud measuredCloud, number distMax, SVector direction=null, boolean checkBothDirection=false, number maxCosAngle=-2, boolean checkNormals=false)
 Compute the distances between 2 point clouds. More...
 
Object ComputeDensityFromNearestPoints ()
 Compute the density around each point of the cloud. More...
 
Object ComputeDensityFromSphere (number NeighborhoodRadiusSize=1)
 Compute the density around each point of the cloud. More...
 
Object ComputeFlatAndCurvedAreas (number neighborhoodRadius=0, number optionMask=0)
 Compute the flat and curved areas on the cloud. More...
 
Object ConvertInspectionToColor ()
 Convert the gradient of inspection into color for each point. More...
 
Object Explode (number maxDistance=0, number delNb=0, number maxNb=0)
 Split a SCloud into a group of point SClouds based on the distance between the points. More...
 
Object ExplodeByClass ()
 Explode a classified cloud by class. More...
 
Object ExplodeColor ()
 Explode a SCloud by inspection colors, or real colors if no inspection colors available. More...
 
Object ExplodeWithInspectionSteps ()
 Split the cloud according to the inspection steps. More...
 
Object ExtractCylinder (Array< SPoint > seedPoint, number tolerance, CylinderEnum force=SCloud.CYL_FORCE_NOTHING, SPoint center=SPoint(), SVector directionVector=SVector(), number radius=0, FillCloudEnum fillCloud=SCloud.FILL_ALL)
 Extract the cylinder region on the current cloud starting from seed point(s). More...
 
Object ExtractLine (SPoint seedPoint, number tolerance, LineEnum force=SCloud.LINE_FORCE_NOTHING, SPoint passingPoint=SPoint(), SVector directionVector=SVector(), FillCloudEnum fillCloud=SCloud.FILL_ALL)
 Extract the line on the current cloud, starting from seed point(s). More...
 
Object ExtractMedianPointOnWhiteLine (SPoint seedPoint, number sphereRadius, number optionMask, FillCloudEnum fillCloud=SCloud.FILL_NONE)
 Search a point on the median of the nearest white line of the seed point, in the area of a sphere with the given radius. More...
 
Object ExtractMultilineFromSeed (SPoint seedPoint, number tolerance, number cylinderLength, number searchRange, boolean chainOption)
 Extract a polyline inside a section cloud, from a seed point. More...
 
Object ExtractPlane (Array< SPoint > seedPoint, number tolerance, PlaneEnum force=SCloud.PLANE_FORCE_NOTHING, SPoint averagePoint=SPoint(), SVector directionVector=SVector(), FillCloudEnum fillCloud=SCloud.FILL_ALL)
 Extract the planar region on the current cloud, starting from seed point(s). More...
 
Object ExtractSphere (Array< SPoint > seedPoint, number tolerance, SphereEnum force=SCloud.SPHERE_FORCE_NOTHING, SPoint center=SPoint(), number radius=0, FillCloudEnum fillCloud=SCloud.FILL_ALL)
 Extract the spherical region on the current cloud starting from seed point(s). More...
 
Object FilterByNormalDirection (SVector direction, number minCosAngle, boolean isDirectionSigned)
 Filter a cloud in function of the direction of the normals. The missing normals will be computed and stored in the extra data of the cloud. More...
 
Object FilterMovingObjects (number resolutionAt10m, number threshold)
 Separate a cloud into two clouds, containing moving and fixed points respectively. More...
 
Object FlipIntensities ()
 Turn intensity values upside down. More...
 
Object GetCentroid ()
 Compute the Centroid of a point cloud. More...
 
CloudRepresentationTypeEnum GetCloudRepresentation ()
 Return the current representation of the cloud. More...
 
Object GetColorGradient ()
 Get the color gradient of the SCloud. More...
 
Object GetConvexContour (SVector viewDirection=null, SPoint pointOnPlane=null, boolean is3dContour=false)
 Compute the convex contour of the cloud according to a direction. More...
 
Object GetConvexHull ()
 Compute the convex hull of a point cloud. More...
 
Object GetHighestPoint (SVector direction)
 Get the highest point according to a direction. More...
 
SCloudIterator GetIterator ()
 Return an iterator on the current cloud. This iterator is initialized with a point of the cloud. More...
 
Object GetLowestPoint (SVector direction)
 Get the lowest point according to a direction. More...
 
number GetMeanDistance ()
 Compute the average distance between points of the cloud. More...
 
number GetNumber ()
 Return the number of points in the cloud. More...
 
number GetPointSize ()
 Return the current point size. More...
 
Object GetScanningPositions ()
 Extract the scanning positions of the cloud. More...
 
number HasColor ()
 Check if the cloud has color information. More...
 
number HasGriddedInformation ()
 Check if points are organized as a gridded structure. More...
 
number HasInspection ()
 Check if the cloud has inspection information. More...
 
boolean HasScanDir ()
 Allow the user to know if the cloud contains a scanning direction. More...
 
boolean hasScanDir ()
 Allow the user to know if the cloud contains a scanning direction. More...
 
Object LoadColorGradient (string filePath)
 Load the color gradient from a file (*.rsi binary file). More...
 
Object LocalizeValues (number min, number max)
 Extract the minimum and maximum threshold values of an inspected cloud. More...
 
Object NoiseReductionSplit (number threshold)
 Split the cloud in 2 clouds according to a noise reduction threshold:
1) The "good" points.
2) The "bad" (noisy) points.
The technique used in this function supposes that the point density within the cloud is constant or nearly. The function will consider as noisy the points in the zone under a certain density threshold. More...
 
Object ProjDir (SPoint pointToProject, SVector direction, number aperture, boolean isDirectionUnsigned=false)
 Compute the projection of a point on a cloud. More...
 
Object ProjectOnPlane (SPlane plane)
 Project the point cloud onto a plane. More...
 
Object Reduce (number numberOfPoints)
 Compute a reduced point cloud with points evenly spaced (as much as possible). More...
 
Object ReduceBest (number minAverageDist, number maxAverageDist)
 Compute a reduced point cloud keeping only the "best" points as much as possible evenly spaced. More...
 
Object RegionGrowFreePolyline (SPoint seedPoint, number samplingStep)
 Extract polyline using a seed point on the line and a sampling step that includes the line. More...
 
Object Save (string filePath, string decimalSeparator=".", boolean exportScanDir=false, SMatrix coordinateSystemMatrix=SMatrix())
 Save the cloud into a file. More...
 
Object SaveColorGradient (string filePath)
 Save the color gradient into a file (*.rsi binary file). More...
 
Object ScanToMesh (MeshingMode meshingMode, boolean textureFromCloud, boolean ignoreScanDir)
 Create a SPoly from predefined settings. More...
 
 SCloud ()
 Default constructor. More...
 
 SCloud (SCloud other)
 Copy constructor. More...
 
Object SectionPlane (SVector planesNormalVector, SPoint firstPlanePoint, number numberOfParallelPlanes, number distanceBetweenPlanes, number planeThickness, number chainingDistance, boolean doNoiseReduction)
 Intersection of a point cloud by parallel planes. More...
 
Object Separate (SMultiline closedContour, SVector direction, SPoint pntFirstPlane=SPoint(), SPoint pntSecondPlane=SPoint(), FillCloudEnum fillCloud=SCloud.FILL_ALL)
 Make a copy of points found INside and/or OUTside the box and preserve the current cloud. More...
 
Object SeparateFeature (SFeature featureType, number tolerance, FillCloudEnum fillCloud=SCloud.FILL_ALL)
 Get all the points found INside (or OUTside) a feature (circle, cylinder, plane). More...
 
Object SeparateMultiline (SMultiline multiline, number tolerance, FillCloudEnum fillCloud=SCloud.FILL_ALL)
 Separate the points in two parts with an offset on both sides of the multiline. More...
 
Object SeparatePoly (SPoly polyhedron, number tolerance, FillCloudEnum fillCloud=SCloud.FILL_ALL)
 Get all the points found INside (or OUTside) a SPoly. More...
 
 SetCloudRepresentation (CloudRepresentationTypeEnum representation)
 Modify the representation of the component. More...
 
 SetPointSize (number pointSize)
 Modify the point size. More...
 
boolean ShowInspectionQuotations (boolean showQuotations, Object options={})
 Manage inspection quotations appearance. More...
 
string toString ()
 Get the type of the variable. More...
 
string ValuesToString ()
 Get a debug string representation of the cloud. More...
 
- Public Member Functions inherited from SComp
 AddToDoc ()
 Add the object to the document. More...
 
 ApplyTransformation (SMatrix matrix)
 Apply a geometric transformation to the current object by making a product with the given matrix. More...
 
Object GetBoundingBox ()
 Calculate the bounding box of the object. More...
 
Object GetColors ()
 Get the colors of the object. More...
 
string GetFolderName ()
 Get the name of the folder containing the object. More...
 
string GetName ()
 Return the object's name. More...
 
string GetPath ()
 Return the full path of a SComp in the tree. More...
 
 Invert ()
 Invert the normal of the object. More...
 
boolean IsInDoc ()
 Return if the object is in the document or not. More...
 
boolean IsVisible ()
 Get the visibility of the object. More...
 
 MoveToGroup (string groupPath, boolean moveInsideTopParent=true)
 Move the object to the document group represent by the given path. If some groups, in the path, don't exist, they will be created. More...
 
 RemoveFromDoc ()
 Remove the object from the document. More...
 
 SetClippable (boolean clipping)
 Set clippable or not. More...
 
 SetColors (number red, number green, number blue)
 Set the colors of the object. More...
 
 SetName (string objectName)
 Set the object's name. More...
 
 SetTransparency (number alpha)
 Set the transparency of the object. More...
 
 SetVisibility (boolean visible)
 Set the object to be visible, or not visible. More...
 
string toString ()
 Get the type of the variable. More...
 
 Translate (SVector vector)
 Make a translation of the current object with an SVector. More...
 

Static Public Member Functions

static Array< SCloudAll (VisibilityEnum visCrit=SComp.ANY_VISIBILITY)
 Get all the SCloud in the document. More...
 
static Object Classify (Array< SCloud > clouds, string modelName)
 Classify the point clouds using a trained model. More...
 
static Object ColorAlongDir (Array< SCloud > clouds, SVector directionVect, SPoint origin=null)
 Color the clouds along a direction with a gradient. More...
 
static Object Extract (Array< SComp > tableSComp, number samplingDistance=0, boolean generateColor=false)
 Extract the cloud from an SComp array. More...
 
static Object FilterWithInspectionValues (Array< SCloud > cloudOfPoints, number lowerThreshold, number upperThreshold, OutputCloudsTypeInspectionValuesEnum outputCloudsType=SCloud.Both)
 Separate cloud(s) into 2 clouds according to inspection values. More...
 
static Object FromAsciiFile (string fileName, string format, number nbPtToKeep=0, boolean importScanDir=true)
 Read an ascii point cloud. More...
 
static Object FromClick ()
 Launch an interaction to select a SCloud in the scene. More...
 
static Object FromFile (string fileName, CloudScriptTypesEnum indexType=SCloud.AUTO_DETECT, number nbPtToKeep=6000000)
 Import clouds from a file. Authorized file extensions : .ac, .asc, .csv, .fls, .fws, .nsd, .ply, .psl, .pts, .ptx, .raw, .txt, .xyz, .yxz, .3pi. More...
 
static Array< SCloudFromName (string name)
 Search all the SCloud with the given name. More...
 
static Array< SCloudFromSel ()
 Get all the selected SCloud. More...
 
static Object GetCategoriesInModel (string modelName)
 Get the categories available in the given model. More...
 
static Array< string > GetClassificationModels ()
 Get a table of the names of all the classification models available. More...
 
static Object GetClassName (number classId)
 Get the class name for a given class ID. More...
 
static Object GriddedInspection (SPoly poly, SPoint origin, SVector projectionDir, SVector horizontalDir, number stepHorizontal, number stepVertical)
 Compute the inspected grid cloud projected onto an inspected SPoly. More...
 
static Object Merge (Array< SCloud > tableSCloud)
 Merge an array of clouds into one single cloud. More...
 
static SCloud New ()
 Default constructor. More...
 
static SCloud New (SCloud other)
 Copy constructor. More...
 
static Object ProjectGrid (SPoly poly, SPoint origin, SVector projectionDir, SVector horizontalDir, number stepHorizontal, number stepVertical)
 Compute the grid cloud projected onto a SPoly. More...
 
static Object SeparateWithClippingObjects (Array< SCloud > cloudOfPoints, OutputCloudsTypeClippPlanesEnum outputCloudsType=SCloud.BothClipping)
 Separate cloud(s) according to active clipping objects. More...
 
static Object SeparateWithRealColors (Array< SCloud > cloudOfPoints, number colorR, number colorG, number colorB, number tolerance)
 Separate cloud(s) into 2 clouds according to real colors. More...
 
static Object SeparateWithScanningPositions (Array< SCloud > clouds, boolean createCloudWithoutScanningPositions)
 Separate cloud(s) into many clouds according to their scanning positions. More...
 
static Object SeparateWithScanPatches (Array< SCloud > clouds, boolean createCloudWithoutScanPatches)
 Separate cloud(s) into many clouds according to scan patches. More...
 
- Static Public Member Functions inherited from SComp
static Array< SCompAll (VisibilityEnum visCrit=SComp.ANY_VISIBILITY)
 Get all the SComp in the document. More...
 
static Object FromClick ()
 Launch an interaction to select a SComp in the scene. More...
 
static Array< SCompFromName (string name)
 Search all the SComp with the given name. More...
 
static Array< SCompFromSel ()
 Get all the selected SComp. More...
 

Detailed Description

Provide point cloud edition and creation methods.

Member Enumeration Documentation

◆ BestRectangleForce

How the best square slot is forced.

Enumerator
NO_FORCE 

Nothing is forced.

FORCE_NORMAL 

To force only the normal, translation along this axis allowed.

FORCE_PLANE 

To force rectangle plane, only rotation and translation in the plane is allowed.

FORCE_MAIN_DIRECTION 

To force the main direction of the rectangle.

FORCE_LENGTH 

To force rectangle length.

FORCE_WIDTH 

To force rectangle width.

FORCE_SQUARE 

If FORCE_LENGTH and FORCE_WIDTH are used too, the length value will be used to define side square.

FORCE_IN_BEST_PLANE 

If FORCE_NORMAL, FORCE_CENTER or FORCE_PLANE are used, they will have no influence.

FORCE_CENTER 

To force rectangle center.

◆ CircleEnum

Enum to know which parameter(s) are forced and do not need to be computed.

Enumerator
CIRCLE_FORCE_NOTHING 

Nothing is forced.

CIRCLE_FORCE_RADIUS 

Radius is forced (using the value of the current circle)

CIRCLE_FORCE_CENTER 

Center is forced (using the value of the current circle)

CIRCLE_FORCE_NORMAL 

Normal vector is forced (using the value of the current circle)

◆ CloudRepresentationTypeEnum

The different representation types for clouds.

Enumerator
CLOUD_FLAT 

Representations which are always available.

CLOUD_SMOOTH 

Smooth shading.

CLOUD_SMOOTH_BACK 

Smooth shading + back and front in different color (only available if scanning direction is known)

CLOUD_COLORED 

Colored points (only available if the cloud contains color information)

CLOUD_INSPECTION 

Colors ares based on an inspection value on each point. (only available if the cloud contains inspection information)

CLOUD_CLASSIFICATION 

Colors ares based on classification ID on each point. (only available if the cloud contains classification information)

◆ CloudScriptTypesEnum

The set of possible files to load.

The FromFile() function requires to specify extension type for specific formats. If it's not a specific format as described below use SCloud.AUTO_DETECT.

Enumerator
_3PI 

ShapeGrabber format.

_3PI_TRANSF 

ShapeGrabber format.

ASC_ESRI 

ESRI format.

ASC_SCAN 

Ascii format.

CSV_ASCII 

Excel format.

CSV_CSLM 

Excel format.

AUTO_DETECT 

Auto detect.

◆ CylinderEnum

Enum to know which parameter(s) are forced and do not need to be computed.

Enumerator
CYL_FORCE_NOTHING 

Nothing is forced.

CYL_FORCE_RADIUS 

Radius is forced.

CYL_INIT_RADIUS 

Radius is initialized (near from its good value)

CYL_FORCE_CENTER 

Center is forced (an axis passing through Center should be found)

CYL_INIT_CENTER 

Center is initialized (near from its good position)

CYL_FORCE_DIRECTION 

Direction is forced (DirectionVector exactly)

CYL_INIT_DIRECTION 

Direction is approximately (DirectionVector nearly)

◆ FillCloudEnum

Enum to know which cloud(s) should be filled when separated from a feature or calculating a best feature.

Enumerator
FILL_ALL 

Both InCloud and OutCloud should be filled.

FILL_IN_ONLY 

Only Fills the InCloud.

FILL_OUT_ONLY 

Only Fills the OutCloud.

FILL_NONE 

Neither InCloud nor OutCloud should be filled.

◆ LineEnum

Enum to know which parameter(s) are forced and do not need to be computed.

Enumerator
LINE_FORCE_NOTHING 

Nothing is forced.

LINE_FORCE_POINT 

Average point is forced (a line passing by this point should be found)

LINE_FORCE_DIRECTION 

Line direction is forced (a line with this direction should be found)

◆ MeshingMode

Set various internal parameters to determine the number of triangles that will compose a mesh. A higher number of triangles means a more precise mesh, but at the cost of higher computation time.

Enumerator
LOW 

The computed mesh will be composed of a low number of triangles.

MEDIUM 

The computed mesh will be composed of an intermediate number of triangles.

HIGH 

The computed mesh will be composed of a high number of triangles.

◆ MethodBestCircleEnum

Method to measure the best circle.

Enumerator
BEST_CIRCLE 

Best element extracted from the cloud.

BEST_CIRCULARITY 

Circularity element extracted from the cloud.

◆ MethodBestSqSlotEnum

Method to measure the slot (best, inner, outer)

Enumerator
BEST_SQ_SLOT 

Best element extracted from the cloud.

◆ OutputCloudsTypeClippPlanesEnum

Specify which clouds are kept.

Enumerator
Clipped 

Keep only clipped clouds.

Unclipped 

Keep only unclipped clouds.

BothClipping 

Keep both clipped and unclipped clouds.

◆ OutputCloudsTypeInspectionValuesEnum

Specify which clouds are kept.

Enumerator
Inside 

Keep only clouds inside the range.

Outside 

Keep only outside the range.

Both 

Keep both inside and outside clouds.

◆ PlaneEnum

Enum to know which parameter(s) are forced and do not need to be computed.

Enumerator
PLANE_FORCE_NOTHING 

Nothing is forced.

PLANE_FORCE_POINT 

Average point is forced (a plane passing by this point should be found)

PLANE_FORCE_NORMAL 

Normal is forced (a plane with this normal should be found)

◆ SphereEnum

Enum to know which parameter(s) are forced and do not need to be computed.

Enumerator
SPHERE_FORCE_NOTHING 

Nothing is forced.

SPHERE_FORCE_RADIUS 

Radius is forced.

SPHERE_FORCE_CENTER 

Center is forced.

Constructor & Destructor Documentation

◆ SCloud() [1/2]

SCloud::SCloud ( )

Default constructor.

◆ SCloud() [2/2]

SCloud::SCloud ( SCloud  other)

Copy constructor.

Parameters
other(SCloud) SCloud to copy

Member Function Documentation

◆ AddPoint()

SCloud::AddPoint ( SPoint  pointToAdd)

Add a new point to the cloud.

Parameters
pointToAdd(SPoint) The point to add

◆ All()

static Array< SCloud > SCloud::All ( VisibilityEnum  visCrit = SComp.ANY_VISIBILITY)
static

Get all the SCloud in the document.

Parameters
visCrit(VisibilityEnum) Visible selection criteria
Returns
(Array<SCloud>) Array of all the SCloud contained in the document, that fulfill the visibility criteria

◆ BestCircle()

Object SCloud::BestCircle ( MethodBestCircleEnum  method = SCloud.BEST_CIRCLE,
number  nbPointElim = 0,
CircleEnum  force = SCloud.CIRCLE_FORCE_NOTHING,
SPoint  center = SPoint(),
SVector  normal = SVector(),
number  radius = 1,
FillCloudEnum  fillCloud = SCloud.FILL_ALL 
)

Compute the best circle fitting with the cloud in the mean squares sense.Best fit with all the points.

Parameters
method(MethodBestCircleEnum) Method to measure the circle (best, circularity)
nbPointElim(number) The number of points to eliminate. The worst points are eliminated. This number should not be greater than the total number of points -4
force(CircleEnum) Enum to know which option(s) is forced or selected.
center(SPoint) The first point of the center line.
normal(SVector) The normed Normal vector of the plane.
radius(number) The radius of the circle
fillCloud(FillCloudEnum) Which cloud should be filled: both, only one or none
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Circle(SCircle) The resulting best SCircle.
ret.StdDeviation(number) The standard deviation.
ret.DistWorstPt(number) The distance of the worst point to the best shape found.
ret.FormError(number) The form error. In this case, circularity.
ret.InCloud(SCloud) The extracted points. This option is only valid if the method selected is BEST_CIRCLE or BEST_CIRCULARITY
ret.OutCloud(SCloud) The cloud without the extracted points. This option is only valid if the method selected is BEST_CIRCLE or BEST_CIRCULARITY

◆ BestCone()

Object SCloud::BestCone ( FillCloudEnum  fillCloud = SCloud.FILL_ALL,
number  nbPointsElim = 0 
)

Compute the best cone fitting with the cloud.

Parameters
fillCloud(FillCloudEnum) Which cloud should be filled: both, only one or none
nbPointsElim(number) Optional number of points to eliminate or 0 if none
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Cone(SCone) The resulting best SCone.
ret.StdDeviation(number) The standard deviation.
ret.DistWorstPt(number) The distance of the worst point to the best shape found.
ret.FormError(number) The form error. In this case, conicity.
ret.InCloud(SCloud) The extracted points.
ret.OutCloud(SCloud) The cloud without the extracted points.

◆ BestCylinder()

Object SCloud::BestCylinder ( number  nbPointElim = 0,
CylinderEnum  force = SCloud.CYL_FORCE_NOTHING,
SPoint  center = SPoint(),
SVector  directionVector = SVector(),
number  radius = 1,
FillCloudEnum  fillCloud = SCloud.FILL_ALL 
)

Initialize a SCylinder using the best cylinder extracted from a cloud (inner, outer...)

Parameters
nbPointElim(number) The number of points to eliminate. The worst points are eliminated. This number should not be greater than the total number of points -4
force(CylinderEnum) Enum to know which parameter(s) is forced or initialized (initializing the computation provides a faster computation.
center(SPoint) The first point of the center line.
directionVector(SVector) The normed Normal vector of the plane.
radius(number) The radius of the circle
fillCloud(FillCloudEnum) Which cloud should be filled: both, only one or none
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Cylinder(SCylinder) The resulting best cylinder.
ret.StdDeviation(number) The standard deviation.
ret.DistWorstPt(number) The distance of the worst point to the best shape found.
ret.FormError(number) The form error. In this case, cylindricity.
ret.InCloud(SCloud) The extracted points.
ret.OutCloud(SCloud) The cloud without the extracted points.

◆ BestLine()

Object SCloud::BestLine ( number  nbPointElim = 0,
LineEnum  force = SCloud.LINE_FORCE_NOTHING,
SPoint  averagePoint = SPoint(),
SVector  directionVector = SVector(),
FillCloudEnum  fillCloud = SCloud.FILL_ALL 
)

Compute the best line fitting with the cloud.

Parameters
nbPointElim(number) The number of points to eliminate. The worst points are eliminated. This number should not be greater than the total number of points -3
force(LineEnum) Enum to know which parameter(s) are forced and do not need to be computed.
averagePoint(SPoint) The point of the cloud that the line pass through
directionVector(SVector) The normed direction vector of the line.
fillCloud(FillCloudEnum) Which cloud should be filled: both, only one or none
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Line(SLine) The resulting best SLine.
ret.StdDeviation(number) The standard deviation.
ret.DistWorstPt(number) The distance of the worst point to the best shape found.
ret.FormError(number) The form error. In this case, linearity.
ret.InCloud(SCloud) The extracted points.
ret.OutCloud(SCloud) The cloud without the extracted points.

◆ BestPlane()

Object SCloud::BestPlane ( number  nbPointElim = 0,
PlaneEnum  force = SCloud.PLANE_FORCE_NOTHING,
SPoint  ptToForce = SPoint(),
SVector  directionToForce = SVector(),
FillCloudEnum  fillCloud = SCloud.FILL_ALL 
)

Compute the best plane fitting with all points from the cloud.

Parameters
nbPointElim(number) The number of points to eliminate. The worst points are eliminated. This number should not be greater than the total number of points -3
force(PlaneEnum) Enum to know which parameter(s) are forced and do not need to be computed.
ptToForce(SPoint) The average point of the cloud to force
directionToForce(SVector) The normed Normal vector of the plane to force.
fillCloud(FillCloudEnum) Which cloud should be filled: both, only one or none. Plane size and orientation are optimized if the InCloud is filled
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Plane(SPlane) The resulting best SPlane.
ret.StdDeviation(number) The standard deviation.
ret.DistWorstPt(number) The distance of the worst point to the best shape found.
ret.FormError(number) The form error. In this case, flatness.
ret.InCloud(SCloud) The extracted points.
ret.OutCloud(SCloud) The cloud without the extracted points.

◆ BestSphere()

Object SCloud::BestSphere ( number  nbPointElim = 0,
SphereEnum  force = SCloud.SPHERE_FORCE_NOTHING,
SPoint  center = SPoint(),
number  radius = 0,
FillCloudEnum  fillCloud = SCloud.FILL_ALL 
)

Compute the best sphere fitting with the cloud.

Parameters
nbPointElim(number) The number of points to eliminate. The worst points are eliminated. This number should not be greater than the total number of points -4
force(SphereEnum) Enum to know which parameter(s) is forced
center(SPoint) The center of the sphere to force
radius(number) The radius of the sphere to force
fillCloud(FillCloudEnum) Which cloud should be filled: both, only one or none
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Sphere(SSphere) The resulting best SSphere.
ret.StdDeviation(number) The standard deviation.
ret.DistWorstPt(number) The distance of the worst point to the best shape found.
ret.FormError(number) The form error. In this case, sphericity.
ret.InCloud(SCloud) The extracted points.
ret.OutCloud(SCloud) The cloud without the extracted points.

◆ BestSqSlot()

Object SCloud::BestSqSlot ( MethodBestSqSlotEnum  method = SCloud.BEST_SQ_SLOT,
number  nbPointElim = 0,
BestRectangleForce  force = SCloud.NO_FORCE,
SPoint  center = SPoint(),
SVector  normal = SVector(),
SVector  mainDirection = SVector(),
number  length = 0,
number  width = 0,
FillCloudEnum  fillCloud = SCloud.FILL_ALL 
)

Compute the best square slot fitting with the cloud.

Parameters
method(MethodBestSqSlotEnum) Method to measure the slot (best, inner, outer)
nbPointElim(number) The number of points to eliminate. The worst points are eliminated. This number should not be greater than the total number of points -4
force(BestRectangleForce) Only with BEST_SQ_SLOT
Enum to know which parameter(s) is forced or initialized (initializing the computation provides a faster computation.
center(SPoint) The center of the rectangle.
normal(SVector) The normal to the rectangle
mainDirection(SVector) The main direction of the rectangle
length(number) The length of the rectangle
width(number) The width of the rectangle
fillCloud(FillCloudEnum) Which cloud should be filled: both, only one or none
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.SquareSlot(SSquareSlot) The resulting best SSquareSlot
ret.InCloud(SCloud) The extracted points. This option is only valid if the method selected is BEST_SQ_SLOT
ret.OutCloud(SCloud) The cloud without the extracted points. This option is only valid if the method selected is BEST_SQ_SLOT

◆ Chain()

Object SCloud::Chain ( number  chainingDist)

Chain the current point cloud and creates the shortest SMultiline(s).

Note
If several equal points (nearly to 1.E-5) are found, only one of them is copied inside the resulting SMultiline
Parameters
chainingDist(number) If the distance between two neighbor points is less than this value a segment is created. If <=0, no limit.
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.MultiTbl(Array<SMultiline>) The table of SMultiline.

◆ Classify()

static Object SCloud::Classify ( Array< SCloud clouds,
string  modelName 
)
static

Classify the point clouds using a trained model.

License
This function requires the license Survey or AEC.
Parameters
clouds(Array<SCloud>) The table of clouds to classify
modelName(string) The model name
Return values
ret.ErrorCode(number) The error codes:
  • 0: No error
  • 1: An error occurred
  • 2: An error occurred with the prerequisites
  • 3: The model does not exist
ret.CloudTbl(Array<SCloud>) Table of classified clouds

◆ CleanFeatureOrientation()

Object SCloud::CleanFeatureOrientation ( SFeature  featureType,
number  angle,
number  distanceTolerance,
boolean  useEstimatedDirection,
FillCloudEnum  fillCloud = SCloud.FILL_ALL 
)

Get all the points found to be scanned (or estimated) with an angle to the feature normal lower than a threshold.

Parameters
featureType(SFeature) The feature to use when dissociating the points in the cloud
angle(number) Angle (range 0-180) in degrees between the scanning direction/local normal of the cloud andlocal feature normal on which is projected the point. When compared to the scanning direction, a value of 90 degrees guaranties that the point could be scanned If no scanning direction is defined in the cloud, range of valid values is 0-90 degrees
distanceTolerance(number) The distance tolerance for the projection
  • <=0: All part of the feature can be considered as valid for projection
  • >0: Only the feature surface within the radius of DistanceTolerance around the point can be used to project the point
useEstimatedDirection(boolean) If true, the estimated normal of the point is used instead of the scan direction. However if no scan direction is available for the cloud, the estimated normal will be used regardless of the value of this parameter
fillCloud(FillCloudEnum) Which cloud should be filled: both, only one or none
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.InCloud(SCloud) The resulting points with a scan angle lower than the threshold when compared to the feature local normal.
ret.OutCloud(SCloud) The resulting points with a scan angle higher than the threshold when compared to the feature local normal.

◆ CleanPolyOrientation()

Object SCloud::CleanPolyOrientation ( SPoly  polyhedron,
number  angle,
number  distanceTolerance,
boolean  useEstimatedDirection,
boolean  checkForThinParts,
FillCloudEnum  fillCloud = SCloud.FILL_ALL 
)

Get all the points found inside (or outside) a SPoly.

Parameters
polyhedron(SPoly) The SPoly to use when dissociating the points in the cloud
angle(number) Angle (range 0-180) in degrees between the scanning direction of the cloud and the triangle normal on which is projected the point. When compared to the scanning direction, a value of 90 degrees guaranties that the point could be scanned If no scanning direction is defined in the cloud, range of valid values is 0-90 degrees
distanceTolerance(number) If <=0, all triangle can be considered as valid projection.
If >0 Only the triangle within the radius of DistanceTolerance around the point can be used to project the point.
useEstimatedDirection(boolean) If true, always use the estimated normal of the point instead of the scan direction
checkForThinParts(boolean) If true, the point projection will try to find a suitable triangle that both fit the maximum angle and the distance tolerance instead of the closest triangle. This option is useful if a thin part was scanned from both sides. This option is used only if the scan direction is used (and not the estimated point normal)
fillCloud(FillCloudEnum) Which cloud should be filled: both, only one or none
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.InCloud(SCloud) The resulting points found inside the SPoly
ret.OutCloud(SCloud) The resulting points found outside the SPoly

◆ CleanWithLocalNormal()

Object SCloud::CleanWithLocalNormal ( number  angle,
FillCloudEnum  fillCloud = SCloud.FILL_ALL 
)

Clean the cloud according to the angle between:
* the local estimated normal of one point.
* and the scanning direction of the point.

Parameters
angle(number) Angle (range 0-90) in degrees between the scanning direction of one point and its local estimated normal. This angle represents a threshold to fill the InCloud or the OutCloud
fillCloud(FillCloudEnum) Which cloud should be filled: both, only one or none
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.InCloud(SCloud) The resulting points valid according to the angular threshold
ret.OutCloud(SCloud) The resulting points filtered according to the angular threshold

◆ Clear()

SCloud::Clear ( )

Deallocate memory of the object.

◆ ClosestPoint()

Object SCloud::ClosestPoint ( SPoint  inputPt,
SPoint  centerPt = SPoint(),
number  distance = 0 
)

Find the point in the current cloud that is the closest from an input point and optionally inside a sphere.

See also
SCloud::ProjDir()
Parameters
inputPt(SPoint) The point from which the closest has to be found
centerPt(SPoint) If not null, center point: the point returned must be inside a sphere with this center. If null, inputPt is used as the center instead.
distance(number) Define the radius of the search sphere. Points outside of it will be ignored. If centerPt is not null, the distance must be >0. If centerPt is null, the distance can either be limited (>0) or not limited (=0)
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Point(SPoint) The closest point found.

◆ ColorAlongDir()

static Object SCloud::ColorAlongDir ( Array< SCloud clouds,
SVector  directionVect,
SPoint  origin = null 
)
static

Color the clouds along a direction with a gradient.

Note
The color used to display the clouds is spread on all clouds
Parameters
clouds(Array<SCloud>) The clouds to color
directionVect(SVector) The direction to use for coloring
origin(SPoint) The origin (the point at which the value should be zero)
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.CloudTbl(Array<SCloud>) The resulting colored clouds. This table contains the same number of clouds as the input table

◆ Compare()

Object SCloud::Compare ( SCloud  measuredCloud,
number  distMax,
SVector  direction = null,
boolean  checkBothDirection = false,
number  maxCosAngle = -2,
boolean  checkNormals = false 
)

Compute the distances between 2 point clouds.

Parameters
measuredCloud(SCloud) The SCloud considered as the measured object to project
distMax(number) Ignore point having a distance greater than this one
direction(SVector) Direction of the inspection. If it's a 3D inspection, no need of a vector direction
checkBothDirection(boolean) True to check direction in both side, false otherwise
maxCosAngle(number) The maximum cos value for angle (used to check orientation of normals and projection's direction)
checkNormals(boolean) True to check the normals, false otherwise
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Cloud(SCloud) The new SCloud, which is the result of the comparison
ret.ReportData(SReportData) The new SReportData, which contains the view set with the inspected component.

◆ ComputeDensityFromNearestPoints()

Object SCloud::ComputeDensityFromNearestPoints ( )

Compute the density around each point of the cloud.

This function will compute the local density around each point of the cloud. The local density is the radius of the minimal sphere, with the point as the center, that contains at maximum the 32 nearest neighbor points. The local density is converted to a number of points/<document unit>2 and added as inspection. The conversion formula is 32 / (radius * radius * pi).

Return values
ret.ErrorCode(number) The error code:
  • 0: Ok, no error occurred.
  • 1: An error occurred.
ret.Cloud(SCloud) A new cloud with inspection

◆ ComputeDensityFromSphere()

Object SCloud::ComputeDensityFromSphere ( number  NeighborhoodRadiusSize = 1)

Compute the density around each point of the cloud.

This function will compute the local density around each point of the cloud. The local density is the number of points that contains the sphere, with the point as the center and as radius the given one. The local density is converted to a number of points/<document unit>2 and added as inspection. The conversion formula is number of points / (NeighborhoodRadiusSize * NeighborhoodRadiusSize * pi).

Parameters
NeighborhoodRadiusSize(number) The radius of the sphere used to find the neighbors to compute the density.
Return values
ret.ErrorCode(number) The error code:
  • 0: Ok, no error occurred.
  • 1: An error occurred.
ret.Cloud(SCloud) A new cloud with inspection

◆ ComputeFlatAndCurvedAreas()

Object SCloud::ComputeFlatAndCurvedAreas ( number  neighborhoodRadius = 0,
number  optionMask = 0 
)

Compute the flat and curved areas on the cloud.

Note
The computed value is stored inside the color value of each point. Due to the multithread process, the result is not deterministic
Parameters
neighborhoodRadius(number) The radius of the sphere used to consider points as neighbors. If 0, an automatic value is computed according to the average distance between points ( 12 * GetMeanDistance(); )
optionMask(number) option bit mask
  • bit 0 (0x1): Normalize the curvature between 0 and 1
  • bit 1 (0x2): Process patch by patch
  • bit 2 (0x4): Check the scan directions
Return values
ret.ErrorCode(number) The error code.
  • 0: No error
  • 1: Cloud is empty
  • 2: Cloud format is not compatible
  • 3: An error occurred
ret.Cloud(SCloud) A new cloud with color & inspection, if successful

◆ ConvertInspectionToColor()

Object SCloud::ConvertInspectionToColor ( )

Convert the gradient of inspection into color for each point.

Note
If the cloud already has some colors, they are overwritten. If the cloud does not have colors, a color is added. After the conversion, the cloud can be represented with CLOUD_COLORED
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Cloud(SCloud) A new cloud with color & inspection

◆ Explode()

Object SCloud::Explode ( number  maxDistance = 0,
number  delNb = 0,
number  maxNb = 0 
)

Split a SCloud into a group of point SClouds based on the distance between the points.

Note
All points, which have at least one neighbor less or equal to _iMaxDistance, are placed in the same SCloud (cluster). The distance between two SClouds of the resulting list is greater than _iMaxDistance.
Parameters
maxDistance(number) The distance threshold, which determines if two points belong to the same cloud or not. If you enter zero, the function will take a default value of 3*(the average distance between points of the cloud. As this dimension is a statistic, it is meaningful only if the number of points is high (minimum 1000 points))
delNb(number) The delete threshold, or 0 if none. All clusters having a number of points less or equal to this value are deleted.
maxNb(number) The maximum number of clusters to return. If 0, taking the default value of 1000. Smallest cluster are automatically deleted so that the total number of component returned do not exceed this value.
Return values
ret.ErrorCode(number) The error code:
  • 0: Successful completion, no cluster deleted.
  • 1: Some cluster(s) have been deleted because the number of points was less than DelNb.
  • 2: Some cluster(s) have been deleted because the number of clusters was greater than MaxNb.
  • 3: Some cluster(s) have been deleted because the number of points was less than DelNb and because the number of clusters was greater than MaxNb.
  • 4: An exception occurred.
ret.CloudTbl(Array<SCloud>) The exploded SCloud table

◆ ExplodeByClass()

Object SCloud::ExplodeByClass ( )

Explode a classified cloud by class.

See also
SCloud.GetClassName()
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
  • 2: No class information in the cloud
ret.CloudTbl(Array<SCloud>) Table of the exploded clouds.
ret.ClassTbl(Array<number>) Table of classes. Each class correspond to the cloud with the same index in CloudTbl.

◆ ExplodeColor()

Object SCloud::ExplodeColor ( )

Explode a SCloud by inspection colors, or real colors if no inspection colors available.

See also
SCloud.Explode()
Return values
ret.ErrorCode(number) The error code:
  • 0: Successful completion, no cluster deleted.
  • 1: Impossible to explode because the cloud contains no inspection color.
  • 2: More than 1000 inspection colors, impossible to make complete explosion. Some clusters have been deleted.
  • 3: An exception occurred.
ret.CloudTbl(Array<SCloud>) The resulting list of component.

◆ ExplodeWithInspectionSteps()

Object SCloud::ExplodeWithInspectionSteps ( )

Split the cloud according to the inspection steps.

See also
SCloud.Explode(), SCloud.ExplodeColor()
Return values
ret.ErrorCode(number) The error code:
  • 0: Successful completion, no cluster deleted.
  • 1: Impossible to explode because the cloud contains no inspection steps.
  • 3: An exception occurred.
ret.CloudTbl(Array<SCloud>) The resulting list of component.

◆ Extract()

static Object SCloud::Extract ( Array< SComp tableSComp,
number  samplingDistance = 0,
boolean  generateColor = false 
)
static

Extract the cloud from an SComp array.

Note
This function can be used to merge several clouds, or SPoint in one SCloud.
var scompTable = new Array(existingCloud, anOtherCloud); // create an array composed of two SCloud or more
var cloudExtract = SCloud.Extract(scompTable); // return the merged SCloud cloudExtract")
Provide point cloud edition and creation methods.
Definition: Reshaper.h:2769
static Object Extract(Array< SComp > tableSComp, number samplingDistance=0, boolean generateColor=false)
Extract the cloud from an SComp array.
Parameters
tableSComp(Array<SComp>) The SComp array from which to extract the cloud
samplingDistance(number) The maximum sampling distance for the SPoly. If the sampling distance equals to zero, the cloud is filled only with the vertices of the polyhedron
generateColor(boolean) To generate the new color of the cloud, or not:
  • false: Ignore colors (use default color).
  • true: Keep colors (convert them into real colors).
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Cloud(SCloud) The SCloud merge from all the SComp.

◆ ExtractCylinder()

Object SCloud::ExtractCylinder ( Array< SPoint seedPoint,
number  tolerance,
CylinderEnum  force = SCloud.CYL_FORCE_NOTHING,
SPoint  center = SPoint(),
SVector  directionVector = SVector(),
number  radius = 0,
FillCloudEnum  fillCloud = SCloud.FILL_ALL 
)

Extract the cylinder region on the current cloud starting from seed point(s).

Parameters
seedPoint(Array<SPoint>) Seed points around which the cylindrical region should be extracted.
tolerance(number) Extract only the region that is inside the tolerance, that is: only the vertices whose distance with the ideal sphere is less than this threshold.
force(CylinderEnum) Enum to know which parameter(s) is forced or initialized (initializing the computation provides a faster computation).
center(SPoint) The first point of the center line.
directionVector(SVector) The normed Normal vector of the cylinder.
radius(number) The radius of the cylinder to force
fillCloud(FillCloudEnum) Which cloud should be filled: both, only one or none
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Cylinder(SCylinder) The resulting best SCylinder.
ret.StdDeviation(number) The standard deviation.
ret.DistWorstPt(number) The distance of the worst point to the best shape found.
ret.InCloud(SCloud) The extracted points.
ret.OutCloud(SCloud) The cloud without the extracted points.

◆ ExtractLine()

Object SCloud::ExtractLine ( SPoint  seedPoint,
number  tolerance,
LineEnum  force = SCloud.LINE_FORCE_NOTHING,
SPoint  passingPoint = SPoint(),
SVector  directionVector = SVector(),
FillCloudEnum  fillCloud = SCloud.FILL_ALL 
)

Extract the line on the current cloud, starting from seed point(s).

Parameters
seedPoint(SPoint) Seed point around which the line should be extracted.
tolerance(number) Extract only the region that is inside the tolerance, that is: only the vertices whose distance with the ideal line is less than this threshold.
force(LineEnum) Enum to know which parameter(s) are forced and do not need to be computed.
passingPoint(SPoint) A passing point of the line
directionVector(SVector) The normed direction of the line.
fillCloud(FillCloudEnum) Which cloud should be filled: both, only one or none
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Line(SLine) The resulting extracted SLine.
ret.StdDeviation(number) The standard deviation.
ret.DistWorstPt(number) The distance of the worst point to the best line found.
ret.InCloud(SCloud) The extracted points.
ret.OutCloud(SCloud) The cloud without the extracted points.

◆ ExtractMedianPointOnWhiteLine()

Object SCloud::ExtractMedianPointOnWhiteLine ( SPoint  seedPoint,
number  sphereRadius,
number  optionMask,
FillCloudEnum  fillCloud = SCloud.FILL_NONE 
)

Search a point on the median of the nearest white line of the seed point, in the area of a sphere with the given radius.

License
This function requires the license Survey.
Note
The white line detection is based on the reflectance value. The seed point can be on the white line or near the white line, but the sphere must encompass the white line and their borders in width. A good radius for the sphere is a bit more than the white line width / 2. If there is more than 1 white line in the sphere, the result may be wrong. If there is no white line in the sphere, the median point will be on the seed point.
Parameters
seedPoint(SPoint) The center of the sphere of research
sphereRadius(number) The radius of the sphere around the seed point where we search the white points
optionMask(number) Bit mask option
  • bit 0 (1): Do we try to reduce the noise by exploding the white points cloud and keeping the biggest? Explode uses 2 time the mean distance of the white points cloud found
  • bit 1 (2): Do we keep the points outside the white line in oSubResults?
  • bit 2 (4): Do we flip the intensities of the points inside the sphere?
fillCloud(FillCloudEnum) Which cloud should be filled : both, only one or none.
Return values
ret.ErrorCode(number) The error code:
  • 0: No error
  • 1: The original cloud has less than 10 points
  • 2: The radius for the sphere of research is <= 0
  • 3: An error occurred during the sphere selection
  • 4: Less than 10 points found for the cloud in the area of the sphere, process exited
  • 5: Error during the reflectance threshold calculation (maybe no reflectance variation in the selection)
  • 6: Less than 10 points found for the white line
  • 7: Error during 2D SPoly creation
  • 8: No contour found for the 2D SPoly
  • 9: Two opposed points on contour not found
  • 10: An other error occurred
ret.Point(SPoint) The median point found on the white line
ret.InCloud(SCloud) The white line points found in the research sphere
ret.OutCloud(SCloud) The other points found in the research sphere

◆ ExtractMultilineFromSeed()

Object SCloud::ExtractMultilineFromSeed ( SPoint  seedPoint,
number  tolerance,
number  cylinderLength,
number  searchRange,
boolean  chainOption 
)

Extract a polyline inside a section cloud, from a seed point.

Parameters
seedPoint(SPoint) The seed point around which the polyline will be extracted
tolerance(number) The extraction tolerance value. It corresponds to a cylinder diameter for the algorithm and thickness for the user
cylinderLength(number) The length of each cylindrical selection. It corresponds to the length of the smallest line which can be extracted
searchRange(number) The maximum distance between two lines of the same line section
chainOption(boolean) Chaining option
  • true: Chain sections
  • false: No chain
Return values
ret.ErrorCode(number) The error code.
  • 0: No error
  • 1: An error occurred
  • 2: Noisy points
  • 3: Wrong parameter
  • 4: Bad first line
ret.Multi(SMultiline) The extracted multiline
ret.LineTbl(Array<SLine>) Returned lines (can be unchained)
ret.InCloudTbl(Array<SCloud>) Table of clouds containing points used for each extraction
ret.OutCloud(SCloud) Cloud containing all points, except points used for the multiline extraction
ret.OutExtractedPtsCloud(SCloud) Cloud containing all points used for multiline extraction

◆ ExtractPlane()

Object SCloud::ExtractPlane ( Array< SPoint seedPoint,
number  tolerance,
PlaneEnum  force = SCloud.PLANE_FORCE_NOTHING,
SPoint  averagePoint = SPoint(),
SVector  directionVector = SVector(),
FillCloudEnum  fillCloud = SCloud.FILL_ALL 
)

Extract the planar region on the current cloud, starting from seed point(s).

Parameters
seedPoint(Array<SPoint>) Seed point(s) around which the planar region should be extracted.
tolerance(number) Extract only the region that is inside the tolerance, that is: only the vertices whose distance with the ideal plane is less than this threshold.
force(PlaneEnum) Enum to know which parameter(s) are forced and do not need to be computed.
averagePoint(SPoint) The average point of the cloud
directionVector(SVector) The normed Normal vector of the plane.
fillCloud(FillCloudEnum) Which cloud should be filled: both, only one or none
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Plane(SPlane) The resulting extracted SPlane.
ret.StdDeviation(number) The standard deviation.
ret.DistWorstPt(number) The distance of the worst point to the best shape found.
ret.InCloud(SCloud) The extracted points.
ret.OutCloud(SCloud) The cloud without the extracted points.

◆ ExtractSphere()

Object SCloud::ExtractSphere ( Array< SPoint seedPoint,
number  tolerance,
SphereEnum  force = SCloud.SPHERE_FORCE_NOTHING,
SPoint  center = SPoint(),
number  radius = 0,
FillCloudEnum  fillCloud = SCloud.FILL_ALL 
)

Extract the spherical region on the current cloud starting from seed point(s).

Parameters
seedPoint(Array<SPoint>) The seed point(s) around which the spherical region should be extracted.
tolerance(number) Extract only the region that is inside the tolerance that is: only the vertices whose distance with the ideal sphere is less than this threshold.
force(SphereEnum) Enum to know which parameter(s) is forced
center(SPoint) The center of the sphere to force
radius(number) The radius of the sphere to force
fillCloud(FillCloudEnum) Which cloud should be filled: both, only one or none
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Sphere(SSphere) The resulting best SSphere.
ret.StdDeviation(number) The standard deviation.
ret.DistWorstPt(number) The distance of the worst point to the best shape found.
ret.InCloud(SCloud) The extracted points.
ret.OutCloud(SCloud) The cloud without the extracted points.

◆ FilterByNormalDirection()

Object SCloud::FilterByNormalDirection ( SVector  direction,
number  minCosAngle,
boolean  isDirectionSigned 
)

Filter a cloud in function of the direction of the normals. The missing normals will be computed and stored in the extra data of the cloud.

Parameters
direction(SVector) The kept points must have a direction similar to this one.
minCosAngle(number) The angle threshold to filter the normals.
isDirectionSigned(boolean) True to check the sign of the direction, false otherwise
Return values
ret.ErrorCode(number) The error code.
  • 0: All the point normals were present on the cloud
  • 1: Some normals are missing

◆ FilterMovingObjects()

Object SCloud::FilterMovingObjects ( number  resolutionAt10m,
number  threshold 
)

Separate a cloud into two clouds, containing moving and fixed points respectively.

Parameters
resolutionAt10m(number) The resolution at 10 m.
threshold(number) The value under which two points are considered identical.
Return values
ret.InCloud(SCloud) The fixed points
ret.OutCloud(SCloud) The moving points
ret.ErrorCode(number) The error code.
  • 0: No error
  • 1: The input cloud does not have enough scanning positions
  • 2: An error occurred.

◆ FilterWithInspectionValues()

static Object SCloud::FilterWithInspectionValues ( Array< SCloud cloudOfPoints,
number  lowerThreshold,
number  upperThreshold,
OutputCloudsTypeInspectionValuesEnum  outputCloudsType = SCloud.Both 
)
static

Separate cloud(s) into 2 clouds according to inspection values.

The range is defined by iLowerThreshold and iUpperThreshold values. Good points correspond to points inside the range, bad points correspond to points outside the range.

Parameters
cloudOfPoints(Array<SCloud>) The table of clouds to filter
lowerThreshold(number) The lower threshold value
upperThreshold(number) The upper threshold value
outputCloudsType(OutputCloudsTypeInspectionValuesEnum) Output type
Return values
ret.CloudTbl(Array<SCloud>) The table containing the separated SClouds
ret.ErrorCode(number) The error code.
  • 0: No error
  • 1: An error occurred
  • 2: The SCloud doesn't have inspection information
  • 3: The InCloudTbl and OutCloudTbl are empty

◆ FlipIntensities()

Object SCloud::FlipIntensities ( )

Turn intensity values upside down.

See also
SCloud.HasInspection()
Return values
ret.ErrorCode(number) The error code.
  • 0: No error
  • 1: An error occurred while flipping values
  • 2: The cloud doesn't have inspection information
ret.Cloud(SCloud) The resulting reduced cloud

◆ FromAsciiFile()

static Object SCloud::FromAsciiFile ( string  fileName,
string  format,
number  nbPtToKeep = 0,
boolean  importScanDir = true 
)
static

Read an ascii point cloud.

Note
The file must contain lines and each line contains one point. Each line contains a set of numbers and the goal is to decode which number correspond to X, Y, Z, I, R, G and B. Other number(s) may be present and ignored depending on the Format you specify. Some of the numbers may also be absent.
If non numeric characters are found, they are eliminated.
See also
SCloud.FromFile()
Parameters
fileName(string) The file name path
format(string) if empty the format will be automatically recognized, provided the format is XY or XYZ or XYZI or XYZRGB of XYZIRGB. Characters must respect the convention as follows:
  • N: Point number (ignored, not implemented yet)
  • X: first coordinate.
  • Y: second coordinate.
  • Z: third coordinate.
  • I: Intensity (a number associated with the point)
  • R: red color as an integer between 0 and 255
  • r: red color as a floating point between 0 and 1
  • G: green color as an integer between 0 and 255
  • g: green color as a floating point between 0 and 1
  • B: blue color as an integer between 0 and 255
  • b: blue color as a floating point between 0 and 1
  • U: X direction of the scanning direction
  • V: Y direction of the scanning direction
  • W: Z direction of the scanning direction
  • space character: number to be ignored.
nbPtToKeep(number) The umber of points to keep in the reduced cloud
  • 0: Do not reduce the number of points.
  • else: Reduces the point cloud with points evenly spaced (as much as possible)
importScanDir(boolean) True to import the scanning directions, if they exist, false otherwise
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Cloud(SCloud) The loaded SCloud

◆ FromClick()

static Object SCloud::FromClick ( )
static

Launch an interaction to select a SCloud in the scene.

Warning
This function will pause the script, and wait for user interaction
Return values
ret.ErrorCode(number) The error code
  • 0: No error, the SCloud is selected.
  • 1: Nothing is selected.
  • 2: The ESCape key has been pressed
ret.Cloud(SCloud) The selected SCloud

◆ FromFile()

static Object SCloud::FromFile ( string  fileName,
CloudScriptTypesEnum  indexType = SCloud.AUTO_DETECT,
number  nbPtToKeep = 6000000 
)
static

Import clouds from a file. Authorized file extensions : .ac, .asc, .csv, .fls, .fws, .nsd, .ply, .psl, .pts, .ptx, .raw, .txt, .xyz, .yxz, .3pi.

Warning
When you write a '\' in string you need to double it '\\' or use '/' instead. Pay especially attention to this when writing file paths in your scripts.
var path = 'C:/Point.asc'; // valid syntax
var path = 'C:\\Point.asc'; // valid syntax
var path = 'C:\Point.asc'; // invalid syntax
See also
SCloud.FromAsciiFile()
Parameters
fileName(string) The file name path
indexType(CloudScriptTypesEnum) The file type, a SCloud.CloudScriptTypesEnum value (SCloud.AUTO_DETECT or another value for special file types)
nbPtToKeep(number) The maximum number of points to load (in case of memory save), or 0 if unlimited
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.CloudTbl(Array<SCloud>) The loaded array of SCloud

◆ FromName()

static Array< SCloud > SCloud::FromName ( string  name)
static

Search all the SCloud with the given name.

Parameters
name(string) The name to find
Returns
(Array<SCloud>) All the SCloud with the given name

◆ FromSel()

static Array< SCloud > SCloud::FromSel ( )
static

Get all the selected SCloud.

Returns
(Array<SCloud>) All the selected SCloud

◆ GetCategoriesInModel()

static Object SCloud::GetCategoriesInModel ( string  modelName)
static

Get the categories available in the given model.

Parameters
modelName(string) The model name
Return values
ret.ErrorCode(number) The error codes:
  • 0: No error
  • 1: An error occurred.
  • 2: An error occurred with the prerequisites
  • 3: The model does not exist
ret.StringTbl(Array<string>) The table of the categories name

◆ GetCentroid()

Object SCloud::GetCentroid ( )

Compute the Centroid of a point cloud.

Return values
ret.ErrorCode(number) The error code.
  • 0: No error
  • 1: Empty point cloud
ret.Point(SPoint) The SCloud centroid

◆ GetClassificationModels()

static Array< string > SCloud::GetClassificationModels ( )
static

Get a table of the names of all the classification models available.

Returns
(Array<string>) The classification models names

◆ GetClassName()

static Object SCloud::GetClassName ( number  classId)
static

Get the class name for a given class ID.

See also
SCloud.ExplodeByClass()
Parameters
classId(number) The class ID, in the 0-255 interval
Return values
ret.Name(string) The name of the class
ret.ErrorCode(number) The error code:
  • 0: No error
  • 1: Invalid class ID

◆ GetCloudRepresentation()

CloudRepresentationTypeEnum SCloud::GetCloudRepresentation ( )

Return the current representation of the cloud.

Returns
(CloudRepresentationTypeEnum) The current representation of the cloud

◆ GetColorGradient()

Object SCloud::GetColorGradient ( )

Get the color gradient of the SCloud.

Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: No color gradient associated to this SCloud
ret.Gradient(SColorGradient) The SColorGradient associated to the current SCloud

◆ GetConvexContour()

Object SCloud::GetConvexContour ( SVector  viewDirection = null,
SPoint  pointOnPlane = null,
boolean  is3dContour = false 
)

Compute the convex contour of the cloud according to a direction.

License
This function requires the license Cyclone 3DR Standard.
Parameters
viewDirection(SVector) The direction in which the computation must be done. If null, the direction is the normal to the best plane of the points.
pointOnPlane(SPoint) If a planar result is requested, a point of the plane. If null, the average point of the cloud is taken.
is3dContour(boolean) If false a planar contour is computed. If true a 3D contour is computed.
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Multi(SMultiline) The computed convex contour.

◆ GetConvexHull()

Object SCloud::GetConvexHull ( )

Compute the convex hull of a point cloud.

Return values
ret.ErrorCode(number) The error code.
  • 0 Success: The convex hull was correctly computed.
  • 1: InitializationError: there is an issue with the point cloud (hull was not initialized correctly).
  • 2: Properties error: the hull computed is not convex.
  • 3: An error occurred.
ret.Poly(SPoly) The computed convex hull.

◆ GetHighestPoint()

Object SCloud::GetHighestPoint ( SVector  direction)

Get the highest point according to a direction.

Parameters
direction(SVector) The direction in which the highest point must be found.
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Point(SPoint) The highest point found.

◆ GetIterator()

SCloudIterator SCloud::GetIterator ( )

Return an iterator on the current cloud. This iterator is initialized with a point of the cloud.

Returns
(SCloudIterator) An iterator on the current cloud.

◆ GetLowestPoint()

Object SCloud::GetLowestPoint ( SVector  direction)

Get the lowest point according to a direction.

Parameters
direction(SVector) The direction in which the lowest point must be found.
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Point(SPoint) The lowest point found.

◆ GetMeanDistance()

number SCloud::GetMeanDistance ( )

Compute the average distance between points of the cloud.

Note
This distance can be used to compute the default MaxDistance parameter for the function Explode.
Returns
(number) The statistic distance between points in the cloud. As this dimension is a statistic, it is meaningful only if the number of points is high (minimum 1000 points).

◆ GetNumber()

number SCloud::GetNumber ( )

Return the number of points in the cloud.

Returns
(number) The number of points in the cloud

◆ GetPointSize()

number SCloud::GetPointSize ( )

Return the current point size.

Returns
(number) The current point size

◆ GetScanningPositions()

Object SCloud::GetScanningPositions ( )

Extract the scanning positions of the cloud.

Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.PointTbl(Array<SPoint>) The table of points corresponding to the scan positions.

◆ GriddedInspection()

static Object SCloud::GriddedInspection ( SPoly  poly,
SPoint  origin,
SVector  projectionDir,
SVector  horizontalDir,
number  stepHorizontal,
number  stepVertical 
)
static

Compute the inspected grid cloud projected onto an inspected SPoly.

Parameters
poly(SPoly) The inspected SPoly on which the grid must be projected
origin(SPoint) The origin point of the grid
projectionDir(SVector) The direction of projection
horizontalDir(SVector) The horizontal direction of the grid
stepHorizontal(number) The horizontal step of the grid (in project unit)
stepVertical(number) The vertical step of the grid (in project unit)
Return values
ret.ErrorCode(number) The error code:
  • 0: No Error
  • 1: Projection issues, no output cloud
  • 2: Inspection issues
  • 3: Null pointer given, no output cloud
  • 4: An error occurred
ret.Cloud(SCloud) The inspected grid SCloud

◆ HasColor()

number SCloud::HasColor ( )

Check if the cloud has color information.

Returns
(number) True if the cloud contains color, false otherwise

◆ HasGriddedInformation()

number SCloud::HasGriddedInformation ( )

Check if points are organized as a gridded structure.

Returns
(number) True if the grid position is defined on all point of the cloud, false otherwise

◆ HasInspection()

number SCloud::HasInspection ( )

Check if the cloud has inspection information.

Returns
(number) True if the cloud contains inspection data, false otherwise

◆ HasScanDir()

boolean SCloud::HasScanDir ( )

Allow the user to know if the cloud contains a scanning direction.

Returns
(boolean) True if the scanning direction is defined for all points of the cloud, false otherwise

◆ hasScanDir()

boolean SCloud::hasScanDir ( )

Allow the user to know if the cloud contains a scanning direction.

Deprecated:
This function is deprecated. Use HasScanDir() instead.
Returns
(boolean) True if the scanning direction is defined for all points of the cloud, false otherwise

◆ LoadColorGradient()

Object SCloud::LoadColorGradient ( string  filePath)

Load the color gradient from a file (*.rsi binary file).

Warning
When you write a '\' in string you need to double it '\\' or use '/' instead. Pay especially attention to this when writing file paths in your scripts.
var path = 'C:/Point.asc'; // valid syntax
var path = 'C:\\Point.asc'; // valid syntax
var path = 'C:\Point.asc'; // invalid syntax
Parameters
filePath(string) The complete file path to load from
Return values
ret.ErrorCode(number) The error code.
  • 0: No error
  • 1: No color gradient associated to this SCloud
  • 2: An error occurred
ret.Gradient(SColorGradient) The color gradient associated to the current SCloud

◆ LocalizeValues()

Object SCloud::LocalizeValues ( number  min,
number  max 
)

Extract the minimum and maximum threshold values of an inspected cloud.

var cloudTbl = SCloud.FromSel();
var cloud = cloudTbl[0];
var gradient = cloud.GetColorGradient().Gradient;
var min = gradient.GetRange().Min;
var max = gradient.GetRange().Max;
var ret = cloud.LocalizeValues(min, max);
if( ret.ErrorCode != 0)
throw new Error( 'Failed to get extreme values' );
ret.Results.forEach(function(curResult)
{
curResult.Comp.AddToDoc();
curResult.Label.AddToDoc();
print('Threshold='+curResult.Threshold);
});
static Array< SCloud > FromSel()
Get all the selected SCloud.
Parameters
min(number) The minimum threshold
max(number) The maximum threshold
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: The cloud is not inspected
  • 2: An error occurred
ret.Results(Array<Object>) A table of result. Each result is a structure with the following members:
  • Comp (SComp): The point
  • Label (SLabel): The SLabel pointing on the point
  • Threshold (number): The threshold value associated

◆ Merge()

static Object SCloud::Merge ( Array< SCloud tableSCloud)
static

Merge an array of clouds into one single cloud.

Note
This function is similar to SCloud.Extract but limited to clouds and easier to find when looking for the function
Parameters
tableSCloud(Array<SCloud>) The SCloud array to merge all together
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Cloud(SCloud) The SCloud merge from all the SComp.

◆ New() [1/2]

static SCloud SCloud::New ( )
static

Default constructor.

Returns
(SCloud) The new SCloud.

◆ New() [2/2]

static SCloud SCloud::New ( SCloud  other)
static

Copy constructor.

Parameters
other(SCloud) SCloud to copy
Returns
(SCloud) The new SCloud.

◆ NoiseReductionSplit()

Object SCloud::NoiseReductionSplit ( number  threshold)

Split the cloud in 2 clouds according to a noise reduction threshold:
1) The "good" points.
2) The "bad" (noisy) points.
The technique used in this function supposes that the point density within the cloud is constant or nearly. The function will consider as noisy the points in the zone under a certain density threshold.

See also
SCloud.Explode()
Parameters
threshold(number) The noise reduction threshold, between [0-100]
Return values
ret.ErrorCode(number) The error code:
  • 0: No error
  • 1: An error occurred.
  • 2: Impossible operation: less than 2 points.
ret.GoodCloud(SCloud) The cloud containing the good points.
ret.BadCloud(SCloud) The cloud containing the bad points.

◆ ProjDir()

Object SCloud::ProjDir ( SPoint  pointToProject,
SVector  direction,
number  aperture,
boolean  isDirectionUnsigned = false 
)

Compute the projection of a point on a cloud.

Note
If more than one point is found (projection along a direction) the nearest point from the origin of the vector is the output.
See also
SCloud.ClosestPoint()
Parameters
pointToProject(SPoint) The point to project.
direction(SVector) The projection normalized vector
aperture(number) The distance around the ray that is used to find the point
isDirectionUnsigned(boolean) Whether the direction is considered as a signed or unsigned vector
  • false: Signed vector
  • true: Unsigned vector
Return values
ret.ErrorCode(number) The error code.
  • 0: No error
  • 1: No projection found
  • 2: An error occurred.
ret.Point(SPoint) The projection found: this point of the cloud is the nearest point along the direction

◆ ProjectGrid()

static Object SCloud::ProjectGrid ( SPoly  poly,
SPoint  origin,
SVector  projectionDir,
SVector  horizontalDir,
number  stepHorizontal,
number  stepVertical 
)
static

Compute the grid cloud projected onto a SPoly.

Parameters
poly(SPoly) The SPoly on which the grid must be projected
origin(SPoint) The origin point of the grid
projectionDir(SVector) The direction of projection
horizontalDir(SVector) The horizontal direction of the grid
stepHorizontal(number) The horizontal step of the grid (in project unit)
stepVertical(number) The vertical step of the grid (in project unit)
Return values
ret.MinCloud(SCloud) The SCloud of the grid minimum
ret.MaxCloud(SCloud) The SCloud of the grid maximum
ret.ErrorCode(number) The error code:
  • 0: No error
  • 1: The direction and horizontal vectors are collinear.
  • 2: An error occurred.

◆ ProjectOnPlane()

Object SCloud::ProjectOnPlane ( SPlane  plane)

Project the point cloud onto a plane.

Parameters
plane(SPlane) The plane on which to project the cloud
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Cloud(SCloud) The cloud projected onto the plane

◆ Reduce()

Object SCloud::Reduce ( number  numberOfPoints)

Compute a reduced point cloud with points evenly spaced (as much as possible).

Note
This point reduction feature is interesting in the case of very big point cloud and/or having very big difference of density.
Parameters
numberOfPoints(number) The number of points to keep in the reduced cloud
Return values
ret.ErrorCode(number) The error code:
  • 0: No error
  • 1: The number of points in the cloud is too small or the number of points to keep is too high.
  • 2: An error occurred.
ret.Cloud(SCloud) The resulting reduced SCloud.

◆ ReduceBest()

Object SCloud::ReduceBest ( number  minAverageDist,
number  maxAverageDist 
)

Compute a reduced point cloud keeping only the "best" points as much as possible evenly spaced.

Note
This point reduction feature is interesting in the case of very big point cloud and/or having very big difference of density.
The function project a "grid" on the shape represented by the cloud and takes ONLY the best points in each grid element.
See also
SCloud.Reduce()
Parameters
minAverageDist(number) The minimum average distance between points.
maxAverageDist(number) The maximum average distance between points, or zero if none. This parameter will reject points in the low density areas, which are suspected to be noisy. If not zero, this value should be at least twice MinAverageDist.
Return values
ret.ErrorCode(number) The error code:
  • 0: No error
  • 1: The number of points in the cloud is too small, or MinAverageDist or MaxAverageDist is not relevant.
  • 2: An exception occurred
ret.Cloud(SCloud) The resulting reduced SCloud.

◆ RegionGrowFreePolyline()

Object SCloud::RegionGrowFreePolyline ( SPoint  seedPoint,
number  samplingStep 
)

Extract polyline using a seed point on the line and a sampling step that includes the line.

License
This function requires the license Survey.
Note
The first segment is extracted from a sphere research, Then the next segments are researched with an oriented truncated cone in one direction and in the opposed direction The segment is created using BestLine function on the extracted cloud
If multiple lines become too close, the line found can deviate from the original line. Because the cone size depends of the distance between the best line and the farthest point.
Parameters
seedPoint(SPoint) point on the line to extract
samplingStep(number) The sampling step of the polyline to extract from the cloud The sampling step must be big enough to include line curvature and to have enough points in the cloud in a step size The sampling step must be small enough to have good accuracy and to avoid merging several lines Typically for electric lines or catenary wires detection a good value is between 0.5 and 2m
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: Invalid input parameters
  • 2: An error occurred
ret.Multi(SMultiline) The multiLine found

◆ Save()

Object SCloud::Save ( string  filePath,
string  decimalSeparator = ".",
boolean  exportScanDir = false,
SMatrix  coordinateSystemMatrix = SMatrix() 
)

Save the cloud into a file.

Note
Supported extensions :
.asc
.csv
.igs
.nsd
.pts
.ptx
Refer to SSurveyingFormat::ExportCloud() to save into .las or .laz format
Scanning direction compatibility
asc/csv: Yes (on demand)
nsd: Yes (mandatory)
ptx: Yes (mandatory)
pts: No
igs: No
Warning
When you write a '\' in string you need to double it '\\' or use '/' instead. Pay especially attention to this when writing file paths in your scripts.
var path = 'C:/Point.asc'; // valid syntax
var path = 'C:\\Point.asc'; // valid syntax
var path = 'C:\Point.asc'; // invalid syntax
Parameters
filePath(string) The complete file path to save into
decimalSeparator(string) The decimal separator in number representation
exportScanDir(boolean) If .asc or .csv formats and true: will export the scanning directions (in addition to XYZ and IRGB). If false, will only export XYZIRGB
Otherwise, this parameter is set automatically, thanks to format compatibility
coordinateSystemMatrix(SMatrix) The matrix to define a UCS used for the export (or identity to use the WCS)
Return values
ret.ErrorCode(number) The error code.
  • 0: No error
  • >0: The number of clouds which failed to be saved.
ret.IsScanDirAvailable(string) False if some clouds don't have Scanning directions to export, true otherwise
ret.isScanDirExported(string) True if the chosen format is compatible with Scanning directions, false otherwise

◆ SaveColorGradient()

Object SCloud::SaveColorGradient ( string  filePath)

Save the color gradient into a file (*.rsi binary file).

Warning
When you write a '\' in string you need to double it '\\' or use '/' instead. Pay especially attention to this when writing file paths in your scripts.
var path = 'C:/Point.asc'; // valid syntax
var path = 'C:\\Point.asc'; // valid syntax
var path = 'C:\Point.asc'; // invalid syntax
Parameters
filePath(string) The complete file path to save into
Return values
ret.ErrorCode(number) The error code.
  • 0: No error
  • 1: No color gradient associated to this SCloud
  • 2: An error occurred

◆ ScanToMesh()

Object SCloud::ScanToMesh ( MeshingMode  meshingMode,
boolean  textureFromCloud,
boolean  ignoreScanDir 
)

Create a SPoly from predefined settings.

Deprecated:
This function is deprecated. Use SPoly.ScanToMesh() instead.
Parameters
meshingMode(MeshingMode) Determine if the resulting SPoly will be composed of a Low, Medium or High number of triangles
  • SCloud.LOW: The computed mesh will be composed of a low number of triangles
  • SCloud.MEDIUM: The computed mesh will be composed of an intermediate number of triangles
  • SCloud.HIGH: The computed mesh will be composed of a high number of triangles
textureFromCloud(boolean) If true, create a textured SPoly from cloud color
ignoreScanDir(boolean) If true, ignore the scanning directions for computation
Return values
ret.ErrorCode(number) The error code:
  • 0: No error
  • 1: An exception occurred.
  • 2: Some part(s) failed during meshing.
  • 3: Some part(s) failed during texturing.
  • 4: Global computation failed.
ret.Poly(SPoly) The resulting SPoly

◆ SectionPlane()

Object SCloud::SectionPlane ( SVector  planesNormalVector,
SPoint  firstPlanePoint,
number  numberOfParallelPlanes,
number  distanceBetweenPlanes,
number  planeThickness,
number  chainingDistance,
boolean  doNoiseReduction 
)

Intersection of a point cloud by parallel planes.

Parameters
planesNormalVector(SVector) The normal vector of the planes
firstPlanePoint(SPoint) The point on the first plane
numberOfParallelPlanes(number) Number of parallel planes.
  • >0: The sections are done only in the way of the vector.
  • <=0: An infinity of parallel planes is assumed.
distanceBetweenPlanes(number) Distance between planes
planeThickness(number) The planes thickness. We consider that all points between two parallel planes belong to the section. Half of the thickness is taken on each side of each plane.
chainingDistance(number) If the distance between two neighbor points is less than this value a segment is created.
doNoiseReduction(boolean) Should we activate noise reduction?
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.MultiTbl(Array<SMultiline>) The resulting planar sections

◆ Separate()

Object SCloud::Separate ( SMultiline  closedContour,
SVector  direction,
SPoint  pntFirstPlane = SPoint(),
SPoint  pntSecondPlane = SPoint(),
FillCloudEnum  fillCloud = SCloud.FILL_ALL 
)

Make a copy of points found INside and/or OUTside the box and preserve the current cloud.

Parameters
closedContour(SMultiline) The closed polygonal contour that cuts the current cloud.
direction(SVector) The direction of the extrusion.
pntFirstPlane(SPoint) The point on the first plane of the box. The plane is normal to the Direction. If null, the extrusion is considered as unlimited.
pntSecondPlane(SPoint) The point on the second plane of the box. The plane is normal to the Direction. If null, the extrusion is considered as unlimited.
fillCloud(FillCloudEnum) Which cloud should be filled: both, only one or none
Return values
ret.ErrorCode(number) The error code, some information about the result
  • 0: Some points could be selected.
  • 1: No point found INside. All points are OUTside
  • 2: No point found OUTside. All points are INside
  • 3: The contour is invalid (auto-intersection, unclosed contour, etc ...)
ret.InCloud(SCloud) The SCloud with points found INside the box
ret.OutCloud(SCloud) The SCloud with points found OUTside the box

◆ SeparateFeature()

Object SCloud::SeparateFeature ( SFeature  featureType,
number  tolerance,
FillCloudEnum  fillCloud = SCloud.FILL_ALL 
)

Get all the points found INside (or OUTside) a feature (circle, cylinder, plane).

Parameters
featureType(SFeature) The feature to use when dissociating the points in the cloud
tolerance(number) If <= 0, option only valid for Surfacic features (plane, sphere and cylinders). In this case, the surface defines the border which will separate the points. If > 0 the feature is used as a skin and points lying at a distance lower than the Tolerance from the feature are output
fillCloud(FillCloudEnum) Which cloud should be filled: both, only one or none
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.InCloud(SCloud) The SCloud with points found INside the feature
ret.OutCloud(SCloud) The SCloud with points found OUTside the feature

◆ SeparateMultiline()

Object SCloud::SeparateMultiline ( SMultiline  multiline,
number  tolerance,
FillCloudEnum  fillCloud = SCloud.FILL_ALL 
)

Separate the points in two parts with an offset on both sides of the multiline.

Parameters
multiline(SMultiline) The multiline to use when dissociating the points in the cloud
tolerance(number) The multiline is used as a skin and points lying at a distance lower than the Tolerance from the multiline are inside
fillCloud(FillCloudEnum) Which cloud should be filled: both, only one or none
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.InCloud(SCloud) The SCloud with points found near the multiline
ret.OutCloud(SCloud) The SCloud with points found far the multiline

◆ SeparatePoly()

Object SCloud::SeparatePoly ( SPoly  polyhedron,
number  tolerance,
FillCloudEnum  fillCloud = SCloud.FILL_ALL 
)

Get all the points found INside (or OUTside) a SPoly.

Parameters
polyhedron(SPoly) The SPoly to use when dissociating the points in the cloud
tolerance(number) If <= 0, the surface defines the border which will separate the points. If > 0 the surface is used as a skin and points lying at a distance lower than the Tolerance from the surface are output
fillCloud(FillCloudEnum) Which cloud should be filled: both, only one or none
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.InCloud(SCloud) The SCloud with points found INside the SPoly
ret.OutCloud(SCloud) The SCloud with points found OUTside the SPoly

◆ SeparateWithClippingObjects()

static Object SCloud::SeparateWithClippingObjects ( Array< SCloud cloudOfPoints,
OutputCloudsTypeClippPlanesEnum  outputCloudsType = SCloud.BothClipping 
)
static

Separate cloud(s) according to active clipping objects.

Parameters
cloudOfPoints(Array<SCloud>) The table of clouds to filter
outputCloudsType(OutputCloudsTypeClippPlanesEnum) Output type:
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.CloudTbl(Array<SCloud>) This function returns a table of clouds

◆ SeparateWithRealColors()

static Object SCloud::SeparateWithRealColors ( Array< SCloud cloudOfPoints,
number  colorR,
number  colorG,
number  colorB,
number  tolerance 
)
static

Separate cloud(s) into 2 clouds according to real colors.

User has to define a RGB value, then, points with similar color will be separated.

Parameters
cloudOfPoints(Array<SCloud>) The table of clouds to filter
colorR(number) The red value of reference color to separate the clouds [0-255]
colorG(number) The green value of reference color to separate the clouds [0-255]
colorB(number) The blue value of reference color to separate the clouds [0-255]
tolerance(number) The tolerance to determine close and distant colors
  • 0: Strict
  • 20: Default
  • 40: Tolerant
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.CloudTbl(Array<SCloud>) The table of separated SClouds (even: inClouds; odd: outClouds)

◆ SeparateWithScanningPositions()

static Object SCloud::SeparateWithScanningPositions ( Array< SCloud clouds,
boolean  createCloudWithoutScanningPositions 
)
static

Separate cloud(s) into many clouds according to their scanning positions.

Parameters
clouds(Array<SCloud>) The table of clouds to filter
createCloudWithoutScanningPositions(boolean) Should we create a cloud containing all points without scanning position?
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.CloudTbl(Array<SCloud>) The table of separated SClouds

◆ SeparateWithScanPatches()

static Object SCloud::SeparateWithScanPatches ( Array< SCloud clouds,
boolean  createCloudWithoutScanPatches 
)
static

Separate cloud(s) into many clouds according to scan patches.

Parameters
clouds(Array<SCloud>) The table of clouds to filter
createCloudWithoutScanPatches(boolean) Should we create a cloud containing all points without scanning patch?
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.CloudTbl(Array<SCloud>) The table of separated SClouds

◆ SetCloudRepresentation()

SCloud::SetCloudRepresentation ( CloudRepresentationTypeEnum  representation)

Modify the representation of the component.

Parameters
representation(CloudRepresentationTypeEnum) The new SCloud representation type

◆ SetPointSize()

SCloud::SetPointSize ( number  pointSize)

Modify the point size.

Parameters
pointSize(number) The new point size

◆ ShowInspectionQuotations()

boolean SCloud::ShowInspectionQuotations ( boolean  showQuotations,
Object  options = {} 
)

Manage inspection quotations appearance.

User can set every display properties of the quotation. If you hide the quotations, options will be ignored.

Note
Inspection quotations are only visible in inspection representation mode.
// Example 1 : showing and customizing quotations
var options={
'highlightExtremeValues': false,
'nbDecimals': 1,
'useCustomFontColor': true,
'customFontColor': [255,0,0],
'displayBackground': true,
'backgroundColor': [255,255,0],
'backgroundOpacity': 50,
'showValuesOutsideRange': true
};
var result=myCloud.ShowInspectionQuotations(true,options);
// Example 2 : hiding quotations
var result=myCloud.ShowInspectionQuotations(false);
Parameters
showQuotations(boolean) True to show quotations
options(Object) Customize appearance of quotations
  • highlightExtremeValues (boolean): True to highlight min & max values
  • nbDecimals (number): Number of decimals (value between 0 and 6, clamped if needed)
  • useCustomFontColor (boolean): If True, all texts will have same color, otherwise texts will get the color fitting the value according to the gradient
  • customFontColor (Array<number>): The RGB color of the font if custom color is used (values between 0 and 255, ignored otherwise)
  • displayBackground (boolean): True to display a background
  • backgroundColor (Array<number>): The RGB color of the background (values between 0 and 255, ignored otherwise)
  • backgroundOpacity (number): The opacity of the background (value between 0 = transparent and 100 = opaque, clamped if needed)
  • showValuesOutsideRange (boolean): True to add quotations to values that aren't inside the gradient range
Returns
(boolean) False if the cloud has no valid gradient, true otherwise.

◆ toString()

string SCloud::toString ( )

Get the type of the variable.

Returns
(string) The type name

◆ ValuesToString()

string SCloud::ValuesToString ( )

Get a debug string representation of the cloud.

Returns
(string) A debug string representing the cloud