Cyclone 3DR Script
from Technodigit, part of Hexagon. Copyright 1997-2021.
SCloud Class Reference

The SCloud class provides point cloud manipulation.
The SCloud creation can be done by calling the static functions:
. More...

Inheritance diagram for SCloud:
SComp SObject

Public Types

enum  BestRectangleForce {
  NO_FORCE , FORCE_NORMAL , FORCE_PLANE , FORCE_MAIN_DIRECTION ,
  FORCE_LENGTH , FORCE_WIDTH , FORCE_SQUARE , FORCE_IN_BEST_PLANE ,
  FORCE_CENTER
}
 How the best square slot is forced. More...
 
enum  CircleEnum { CIRCLE_FORCE_NOTHING , CIRCLE_FORCE_RADIUS , CIRCLE_FORCE_CENTER , CIRCLE_FORCE_NORMAL }
 Bit mask to know which parameter(s) are forced and do not need to be computed. More...
 
enum  CloudRepresentationTypeEnum {
  CLOUD_FLAT , CLOUD_SMOOTH , CLOUD_SMOOTH_BACK , CLOUD_COLORED ,
  CLOUD_INSPECTION , CLOUD_SURFACIC , CLOUD_CLASSIFICATION , CLOUD_DEBUG_SPLATTING_SMOOTH ,
  CLOUD_DEBUG_SPLATTING_COLORED
}
 The different representation types for clouds.
Use SCloud.FLAT. More...
 
enum  CloudScriptTypesEnum {
  _3PI , _3PI_TRANSF , ASC_ESRI , ASC_SCAN ,
  CSV_ASCII , CSV_CSLM , GSN_TRANF , AUTO_DETECT
}
 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. More...
 
enum  CylinderEnum {
  CYL_FORCE_NOTHING , CYL_FORCE_RADIUS , CYL_INIT_RADIUS , CYL_FORCE_CENTER ,
  CYL_INIT_CENTER , CYL_FORCE_DIRECTION , CYL_INIT_DIRECTION
}
 Bit mask to know which parameter(s) are forced and do not need to be computed. More...
 
enum  FillCloudEnum { FILL_ALL , FILL_IN_ONLY , FILL_OUT_ONLY , FILL_NONE }
 Bit mask to know which cloud(s) should be filled when separated from a feature or calculating a best feature. More...
 
enum  LineEnum { LINE_FORCE_NOTHING , LINE_FORCE_POINT , LINE_FORCE_DIRECTION }
 Bit mask to know which parameter(s) are forced and do not need to be computed. More...
 
enum  MethodBestCircleEnum { BEST_CIRCLE , BEST_CIRCULARITY }
 
enum  MethodBestSqSlotEnum { BEST_SQ_SLOT }
 method to measure the slot (best, inner, outer) More...
 
enum class  OutputCloudsTypeClippPlanesEnum { Clipped , Unclipped , Both }
 
enum class  OutputCloudsTypeInspectionValuesEnum { Inside , Outside , Both }
 
enum  PlaneEnum { PLANE_FORCE_NOTHING , PLANE_FORCE_POINT , PLANE_FORCE_NORMAL }
 Bit mask to know which parameter(s) are forced and do not need to be computed. More...
 
enum  SphereEnum { SPHERE_FORCE_NOTHING , SPHERE_FORCE_RADIUS , SPHERE_FORCE_CENTER }
 Bit mask to know which parameter(s) are forced and do not need to be computed. More...
 
- Public Types inherited from SComp
enum  RepresentationTypeEnum {
  SMOOTH , FLAT , WIRE , SMOOTH_WIRE ,
  FLAT_WIRE , SMOOTH_ROTWIRE , FLAT_ROTWIRE , TEXTURE ,
  INSPECTION
}
 The different representation types for inherited classes.
Use (inherited class).SMOOTH. Example: for a cloud, use SCloud.SMOOTH. More...
 

Public Slots

 AddPoint (SPoint PointToAdd)
 Add a new point to the cloud. More...
 
static Array All (Number VisCrit)
 To get all the SComp in the document. More...
 
Array BestCircle (MethodBestCircleEnum Method, Number NbPointElim, CircleEnum Force, SPoint iCenter={}, SVector Normal={}, Number Radius, FillCloudEnum fillCloud)
 Calculates the best circle fitting with the cloud in the mean squares sense.
Best fit with all the points. More...
 
Array BestCone (FillCloudEnum fillCloud, Number nbPointsElim)
 Calculates the best cone fitting with the cloud. More...
 
Array BestCylinder (Number NbPointElim, CylinderEnum Force, SPoint iCenter={}, SVector DirectionVector={}, Number Radius, FillCloudEnum fillCloud)
 Initialise a slot using the best slot extracted from a cloud (inner, outer...) More...
 
Array BestLine (Number NbPointElim, LineEnum Force, SPoint iAveragePoint={}, SVector DirectionVector={}, FillCloudEnum fillCloud)
 Calculates the best line fitting with the cloud. More...
 
Array BestPlane (Number NbPointElim, PlaneEnum Force, SPoint iPtToForce={}, SVector DirectionToForce={}, FillCloudEnum fillCloud)
 Calculates the best plane fitting with all points from the cloud. More...
 
Array BestSphere (Number NbPointElim, SphereEnum Force, SPoint iCenter={}, Number Radius, FillCloudEnum fillCloud)
 Calculates the best sphere fitting with the cloud. More...
 
Array BestSqSlot (MethodBestSqSlotEnum method, Number NbPointElim, BestRectangleForce Force, SPoint iCenter={}, SVector Normal={}, SVector MainDirection={}, Number Length, Number Width, FillCloudEnum fillCloud)
 Calculates the best square slot fitting with the cloud. More...
 
Array Chain (Number ChainingDist)
 Chains the current point cloud and creates the shortest SMultiline(s). More...
 
static Array Classify (Array< SCloud > iClouds, String iModelName)
 Classify the point clouds using a trained model. More...
 
Array CleanFeatureOrientation (SComp FeatureType, Number Angle, Number DistanceTolerance, Boolean useEstimatedDirection, FillCloudEnum fillCloud)
 Gets all the points found to be scanned (or estimated) with an angle to the feature normal lower than a threshold. More...
 
Array CleanPolyOrientation (SPoly Polyhedron, Number Angle, Number DistanceTolerance, Boolean useEstimatedDirection, Boolean checkForThinParts, FillCloudEnum fillCloud)
 Gets all the points found inside (or outside) a SPoly. More...
 
Array CleanWithLocalNormal (Number Angle, FillCloudEnum fillCloud)
 Cleans the cloud according to the angle between:
. More...
 
 Clear ()
 To deallocate memory of the object. More...
 
Array ClosestPoint (SPoint iInputPt, SPoint CenterPt, Number Distance)
 Finds the point in the current cloud that is the closest from an input point and optionally inside a sphere. More...
 
static Array ColorAlongDir (Array< SCloud > Clouds, SVector DirectionVect, SPoint iOrigin)
 Color the clouds along a direction with a gradient. More...
 
Array Compare (SCloud MeasuredCloud, Number DistMax, SVector Direction, Boolean checkBothDirection, Number maxCosAngle=-2, Boolean checkNormals)
 Calculates the distances between 2 point clouds. More...
 
Array ComputeFlatAndCurvedAreas (Number iNeighborhoodRadius=0.0, Number iOptionMask=0)
 Computes the flat and curved areas on the cloud. More...
 
Array ConvertInspectionToColor ()
 Convert the gradient of inspection into color for each point. More...
 
Array Explode (Number MaxDistance, Number DelNb, Number MaxNb)
 Splits a SCloud into a group of point SClouds based on the distance between the points. More...
 
Array ExplodeByClass ()
 Explode a classified cloud by class. More...
 
static Array ExplodeCloudClassification (SCloud iCloud)
 Split a point cloud that has been classified into several clouds according the point classes. More...
 
Array ExplodeColor ()
 Explodes a SCloud by inspection colors or real colors if no inspection colors. More...
 
Array ExplodeWithInspectionSteps ()
 Splits the cloud according to the inspection steps. More...
 
static Array Extract (Array< SComp > TableSComp, Number SamplingDistance, Boolean GenerateColor)
 To extract the cloud from an SComp array. More...
 
Array ExtractCylinder (Array< SPoint > SeedPoint, Number Tolerance, CylinderEnum Force, SPoint iCenter={}, SVector DirectionVector={}, Number Radius, FillCloudEnum fillCloud)
 Extract the cylinder region on the current cloud starting from seed point(s). More...
 
Array ExtractMedianPointOnWhiteLine (SPoint iSeedPoint, Number iSphereRadius, Number iOptionMask, FillCloudEnum iFillCloud=FILL_NONE)
 This function searches 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...
 
Array ExtractMultilineFromSeed (SPoint iSeedPoint, Number iTolerance, Number iCylinderLength, Number iSearchRange, Boolean iChainOption)
 Extract a polyline inside a section cloud, from a seed point. More...
 
Array ExtractPlane (Array< SPoint > SeedPoint, Number Tolerance, PlaneEnum Force, SPoint iAveragePoint={}, SVector DirectionVector={}, FillCloudEnum fillCloud)
 Extract the planar region on the current cloud starting from seed point(s). More...
 
Array ExtractSphere (Array< SPoint > SeedPoint, Number Tolerance, SphereEnum Force, SPoint iCenter={}, Number Radius, FillCloudEnum fillCloud)
 Extract the spherical region on the current cloud starting from seed point(s). More...
 
Array FilterByNormalDirection (SVector iDirection, Number iMinCosAngle, 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...
 
Array FilterMovingObjects (Number iResolutionAt10m, Number iThreshold)
 Function allowing to separate point cloud into moving and fixed points. More...
 
static Array FilterWithInspectionValues (Array< SCloud > iCloudOfPoints, Number iLowerThreshold, Number iUpperThreshold, OutputCloudsTypeInspectionValuesEnum iOutputCloudsType)
 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. More...
 
Array FlipIntensities ()
 Turns intensity values upside down. More...
 
static Array FromAsciiFile (String iFileName, String iFormat, Number iNbPtToKeep, Boolean iImportScanDir)
 Reads an ascii point cloud. More...
 
static Array FromClick ()
 Displays a dialog box to select an SComp in the scene. More...
 
static Array FromFile (String FileName, CloudScriptTypesEnum IndexType, Number NbPtToKeep, Boolean ImportScanDir)
 Imports clouds from a file. Authorized file extensions : .ac, .asc, .csv, .fls, .fws, .gsn, .iso, .nsd, .ply, .psl, .pts, .ptx, .raw, .stl, .txt, .xyz, .yxz, .3pi. More...
 
static Array FromName (String Name)
 Search all the component with the given name. More...
 
static Array FromSel ()
 To get all the selected SComp. More...
 
static Array GetCategoriesInModel (String iModelName)
 Get the categories available in the given model. More...
 
Array GetCentroid ()
 To compute the Centroid of a point cloud. More...
 
static Array GetClassificationModels ()
 Get a table of the names of all the classification models available. More...
 
static Array GetClassName (Number iClassId)
 Get the class name for a given class ID. More...
 
CloudRepresentationTypeEnum GetCloudRepresentation ()
 Return the current representation. More...
 
Array GetColorGradient ()
 To get the color gradient of the SCloud. More...
 
Array GetConvexContour (SVector ViewDirection, SPoint PointOnPlane, Boolean Is3dContour)
 Computes the convex contour of the cloud according to a direction. More...
 
Array GetConvexHull ()
 Compute the convex hull of a point cloud. More...
 
Array GetHighestPoint (SVector Direction)
 Get the highest point according to the Direction. More...
 
SCloudIterator GetIterator ()
 
Array GetLowestPoint (SVector Direction)
 Get the lowest point according to the Direction. More...
 
Number GetMeanDistance ()
 Calculate the average distance between points of the cloud. More...
 
Number GetNumber ()
 
Number GetPointSize ()
 Return the current point size. More...
 
Array 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 ()
 Allows the user to know if the cloud contains a scanning direction. More...
 
Array LoadColorGradient (String FilePath)
 Loads the color gradient from a file (*.rsi binary file). More...
 
Array LocalizeValues (Number iMin, Number iMax)
 Extract the minimum and maximum threshold values of an inspected cloud. More...
 
static Array Merge (Array< SCloud > TableSCloud)
 To merge an array of clouds into one single cloud. More...
 
static SCloud New ()
 Default constructor to create an empty new SCloud. More...
 
static SCloud New (SCloud Other)
 Constructs an SCloud by copying the SCloud _iOther. More...
 
Array NoiseReductionSplit (unsigned Threshold)
 The goal of noise reduction is to split the cloud in 2 clouds according to a noise reduction threshold: 1) The "good" points. 2) The "bad" points (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...
 
Array ProjDir (SPoint iPointToProject, SVector Direction, Number Aperture, Boolean DirectionUnsigned)
 Calculates the projection of a point on a cloud. More...
 
static Array ProjectGrid (SPoly iPoly, SPoint iOrigin, SVector iProjectionDir, SVector iHorizontalDir, Number iStepHorizontal, Number iStepVertical)
 Calculate the grid cloud projected onto a mesh. More...
 
Array ProjectOnPlane (SPlane iPlane)
 Projects the point cloud onto a plane. More...
 
Array Reduce (unsigned NumberOfPoints)
 Calculates a reduced point cloud with points evenly spaced (as much as possible). More...
 
Array ReduceBest (Number MiniAverageDist, Number MaxAverageDist)
 Calculates a reduced point cloud keeping only the "best" points as much as possible evenly spaced. More...
 
Array RegionGrowFreePolyline (SPoint iSeedPoint, Number iSamplingStep)
 Extract polyline using a seed point on the line and a sampling step that includes the line. More...
 
Array Save (String FilePath, QChar decimalSeparator='.', Boolean EXPORT_SCAN_DIR, SMatrix CoordinateSystemMatrix={})
 Saves the cloud into a file. Supported extensions : .asc, .csv, .igs, .nsd, .pts, .ptx. Refer to SSurveyingFormat::ExportCloud() to save into .las or .laz format. More...
 
Array SaveColorGradient (String FilePath)
 Saves the color gradient into a file (*.rsi binary file). More...
 
Array SectionPlane (SVector NormalVectorOfThePlanes, SPoint iPointOnTheFirstPlane, Number NumberOfParallelPlanes, Number DistanceBeetweenParallelPlanes, Number PlaneThickness, Number ChainingDist, Boolean NoiseReduction)
 Intersection of a point cloud by parallel planes. More...
 
Array Separate (SMultiline iClosedContour, SVector Direction, SPoint PntFirstPlane, SPoint PntSecondPlane, FillCloudEnum fillCloud)
 Makes a copy of points found INside and (or) OUTside the box and preserve the current cloud. More...
 
Array SeparateFeature (SComp FeatureType, Number Tolerance, FillCloudEnum fillCloud)
 Gets all the points found inside (or outside) a feature (circle, cylinder, plane). More...
 
Array SeparateMultiline (SMultiline Multiline, Number Tolerance, FillCloudEnum fillCloud)
 Separates the points in two parts with an offset on both sides of the multiline. More...
 
Array SeparatePoly (SPoly Polyhedron, Number Tolerance, FillCloudEnum fillCloud)
 Gets all the points found inside (or outside) a SPoly. More...
 
static Array SeparateWithClippingObjects (Array< SCloud > iCloudOfPoints, OutputCloudsTypeClippPlanesEnum iOutputCloudsType)
 Separate cloud(s) according to active clipping objects. More...
 
static Array SeparateWithRealColors (Array< SCloud > iCloudOfPoints, Number iColorR, Number iColorG, Number iColorB, Number iTolerance)
 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. More...
 
static Array SeparateWithScanningPositions (Array< SCloud > iClouds, Boolean CreateCloudWithoutScanningPositions)
 Separate cloud(s) into many clouds according to their scanning positions. More...
 
static Array SeparateWithScanPatches (Array< SCloud > iClouds, Boolean CreateCloudWithoutScanPatches)
 Separate cloud(s) into many clouds according to scan patches. More...
 
 SetCloudRepresentation (CloudRepresentationTypeEnum Representation)
 The representation of the component is modified. More...
 
 SetPointSize (Number pointSize)
 New point size. More...
 
String toString ()
 Get the type of the variable. More...
 
static String toString ()
 Get the type of the variable. More...
 
- Public Slots inherited from SComp
 AddToDoc ()
 To add the object to the document. More...
 
static Array All (Number VisCrit)
 To get all the SComp in the document. More...
 
 ApplyTransformation (SMatrix iMatrix)
 To apply a geometric transformation to the current object by making a product with the given matrix. More...
 
 Clear ()
 To deallocate object memory. More...
 
static Array FromClick ()
 Displays a dialog box to select an SComp in the scene. More...
 
static Array FromName (String Name)
 Search all the component with the given name. More...
 
static Array FromSel ()
 To get all the selected SComp. More...
 
Array GetBoundingBox ()
 Calculates the bounding box of the component. More...
 
Array GetColors ()
 To get the colors of the component. More...
 
String GetFolderName ()
 
String GetName ()
 
 Invert ()
 Normal of the component is inverted. More...
 
Boolean IsInDoc ()
 Return if the component is in the document or not. More...
 
Boolean IsVisible ()
 
 MoveToGroup (String GroupPath, Boolean MoveInsideTopParent)
 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 ()
 To remove the object from the document. More...
 
 SetClippable (Boolean clipping)
 Set clippable or not. More...
 
 SetColors (Number Red, Number Green, Number Blue)
 Sets the colors of the component. More...
 
 SetName (String ComponentName)
 To set the component's name. More...
 
 SetRepresentationType (RepresentationTypeEnum Representation)
 The shading type of the component is modified. More...
 
 SetTransparency (Number Alpha)
 Sets the transparency of the component. More...
 
 SetVisibility (Boolean Visible)
 Sets the component to be visible, or not visible. More...
 
String toString ()
 Get the type of the variable. More...
 
String toString ()
 Get the type of the variable. More...
 
 Translate (SVector Vector)
 To make a translation of the current object with an SVector. More...
 
- Public Slots inherited from SObject
 Clear ()
 To deallocate memory of the object. More...
 
String toString ()
 Get the type of the variable. More...
 

Detailed Description

The SCloud class provides point cloud manipulation.
The SCloud creation can be done by calling the static functions:
.

  • New() to create your own empty SCloud and manually adding your point.
    var myCloud = SCloud.New(); // Empty cloud creation
    myCloud.AddPoint(SPoint.New(1, 2, 3)); // Add a point in the cloud
    myCloud.AddPoint(SPoint.New(2, 4, 8));
    //etc
  • New() to copy an existing SCloud.

  • FromFile() to load the SCloud contained inside a file.
    Supported file extensions are:
    .asc, .3pi, .csv, .nsd, .iso, .stl, .ply, .yxz, .dxf, .raw, .dms, .gsn, .pts, .ac, .las, .fls, .fws, .psl

    Warning
    In Javascript, when you write strings the '\' character is an escape character, you need to use '\\' or '/' instead. Pay especially attention to this when writing file paths in your scripts. For example :
    var res = SCloud.FromFile( 'C:/Cloud.nsd' ); // Valid syntax\n
    var res2 = SCloud.FromFile( 'C:\\Cloud.nsd' ); // Valid syntax\n
    var res3 = SCloud.FromFile( 'C:\Cloud.nsd' ); // Invalid syntax
    The SCloud class provides point cloud manipulation. The SCloud creation can be done by calling the st...
    Definition: SCloud.h:43
    static Array FromFile(String FileName, CloudScriptTypesEnum IndexType, Number NbPtToKeep, Boolean ImportScanDir)
    Imports clouds from a file. Authorized file extensions : .ac, .asc, .csv, .fls, .fws,...
  • Extract() to extract a cloud from an SComp array.
    Example you can extract the SCloud corresponding to an SPoly.
    var scompTable = new Array(existingPoly, anOtherPoly); // create an array composed of two SPoly
    var cloudExtract = SCloud.Extract(scompTable); // extract the two polyhedron vertices and merge them in one SCloud
    existingPoly.Clear(); // existingPoly and anOtherPoly will not be used after
    anOtherPoly.Clear();
    Note
    This function can be used to merge several clouds into a single one. \nIf you want to parse your cloud you can take a look on the SCloudIterator class

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 

the rectangle is forced to a square, width and length will have same value. If FORCE_LENGTH and FORCE_WIDTH are used too, the length value will be used to define side square.

FORCE_IN_BEST_PLANE 

to force rectangle in the best plane, normal and point on the rectangle is compute If FORCE_NORMAL, FORCE_CENTER or FORCE_PLANE are used, they will have no influence

FORCE_CENTER 

to force rectangle center

◆ CircleEnum

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

Enumerator
CIRCLE_FORCE_NOTHING 
CIRCLE_FORCE_RADIUS 
CIRCLE_FORCE_CENTER 
CIRCLE_FORCE_NORMAL 

◆ CloudRepresentationTypeEnum

The different representation types for clouds.
Use SCloud.FLAT.

Enumerator
CLOUD_FLAT 
CLOUD_SMOOTH 
CLOUD_SMOOTH_BACK 
CLOUD_COLORED 
CLOUD_INSPECTION 
CLOUD_SURFACIC 
CLOUD_CLASSIFICATION 
CLOUD_DEBUG_SPLATTING_SMOOTH 
CLOUD_DEBUG_SPLATTING_COLORED 

◆ 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 
_3PI_TRANSF 
ASC_ESRI 
ASC_SCAN 
CSV_ASCII 
CSV_CSLM 
GSN_TRANF 
AUTO_DETECT 

◆ CylinderEnum

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

Enumerator
CYL_FORCE_NOTHING 
CYL_FORCE_RADIUS 
CYL_INIT_RADIUS 
CYL_FORCE_CENTER 
CYL_INIT_CENTER 
CYL_FORCE_DIRECTION 
CYL_INIT_DIRECTION 

◆ FillCloudEnum

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

Enumerator
FILL_ALL 
FILL_IN_ONLY 
FILL_OUT_ONLY 
FILL_NONE 

◆ LineEnum

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

Enumerator
LINE_FORCE_NOTHING 
LINE_FORCE_POINT 
LINE_FORCE_DIRECTION 

◆ MethodBestCircleEnum

Enumerator
BEST_CIRCLE 
BEST_CIRCULARITY 

◆ MethodBestSqSlotEnum

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

Enumerator
BEST_SQ_SLOT 

◆ OutputCloudsTypeClippPlanesEnum

Enumerator
Clipped 
Unclipped 
Both 

◆ OutputCloudsTypeInspectionValuesEnum

Enumerator
Inside 
Outside 
Both 

◆ PlaneEnum

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

Enumerator
PLANE_FORCE_NOTHING 
PLANE_FORCE_POINT 
PLANE_FORCE_NORMAL 

◆ SphereEnum

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

Enumerator
SPHERE_FORCE_NOTHING 
SPHERE_FORCE_RADIUS 
SPHERE_FORCE_CENTER 

Member Function Documentation

◆ AddPoint

SCloud::AddPoint ( SPoint  PointToAdd)
slot

Add a new point to the cloud.

Parameters
[in]PointToAddThe point to add

◆ All

static Array SCloud::All ( Number  VisCrit)
inlinestaticslot

To get all the SComp in the document.

Return values
Arrayall the SCloud contained in the document
Parameters
[in]VisCritVisible selection criteria
  • 0 Keep if not visible
  • 1 Keep if visible
  • 2 (Default) Indifferent

◆ BestCircle

Array SCloud::BestCircle ( MethodBestCircleEnum  Method,
Number  NbPointElim,
CircleEnum  Force,
SPoint  iCenter = {},
SVector  Normal = {},
Number  Radius,
FillCloudEnum  fillCloud 
)
slot

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

Return values
Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 An error occurred. In this case, results are not available.
Array.CircleThe resulting best SCircle.
Array.StdDeviationThe standard deviation.
Array.DistWorstPtThe distance of the worst point to the best shape found.
Array.FormErrorThe form error. In this case, circularity.
Array.InCloudThe extracted points. THIS OPTION IS ONLY VALID IF THE METHOD SELECTED IS BEST OR CIRCULARITY
Array.OutCloudThe cloud without the extracted points. THIS OPTION IS ONLY VALID IF THE METHOD SELECTED IS BEST_CIRCLE OR BEST_CIRCULARITY
Parameters
[in]Methodmethod to measure the circle (best, circularity)
[in]NbPointElimThe number of points to eliminate. The worst points are eliminated. This number should not be greater than the total number of points -4
[in]ForceBit mask to know which option(s) is forced or selected.
CIRCLE_FORCE_RADIUS (ForceOption & CIRCLE_FORCE_RADIUS) Radius is forced (using the value of the current circle)
CIRCLE_FORCE_CENTER (ForceOption & CIRCLE_FORCE_CENTER) Center is forced (using the value of the current circle)
CIRCLE_FORCE_NORMAL (ForceOption & CIRCLE_FORCE_NORMAL) Normal vector is forced (using the value of the current circle)
THIS VALUE WILL NOT BE USED IF THE METHOD SELECTED IS MAX INSCRIBED OR MIN CIRCUMSCRIBED
[in]iCenterFirst point of the center line.
[in]NormalNormed Normal vector of the plane.
[in]RadiusRadius of the circle
[in]fillCloudWhich cloud should be filled: both, only one or none

◆ BestCone

Array SCloud::BestCone ( FillCloudEnum  fillCloud,
Number  nbPointsElim 
)
slot

Calculates the best cone fitting with the cloud.

Return values
Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 An error occurred. In this case, results are not available.
Array.ConeThe resulting best SCone.
Array.StdDeviationThe standard deviation.
Array.DistWorstPtThe distance of the worst point to the best shape found.
Array.FormErrorThe form error. In this case, conicity.
Array.InCloudThe extracted points.
Array.OutCloudThe cloud without the extracted points.
Parameters
[in]fillCloudWhich cloud should be filled: both, only one or none
[in]nbPointsElimoptional number of points to eliminate or 0 if none

◆ BestCylinder

Array SCloud::BestCylinder ( Number  NbPointElim,
CylinderEnum  Force,
SPoint  iCenter = {},
SVector  DirectionVector = {},
Number  Radius,
FillCloudEnum  fillCloud 
)
slot

Initialise a slot using the best slot extracted from a cloud (inner, outer...)

Return values
Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 An error occurred. In this case, results are not available.
Array.CylinderThe resulting best cylinder.
Array.StdDeviationThe standard deviation.
Array.DistWorstPtThe distance of the worst point to the best shape found.
Array.FormErrorThe form error. In this case, cylindricity.
Array.InCloudThe extracted points.
Array.OutCloudThe cloud without the extracted points.
Parameters
[in]NbPointElimThe number of points to eliminate. The worst points are eliminated. This number should not be greater than the total number of points -4
[in]ForceBit mask to know which parameter(s) is forced or initialized (initializing the computation provides a more rapid computation.
CYL_FORCE_RADIUS (Force & CYL_FORCE_RADIUS) Radius is forced
CYL_INIT_RADIUS (Force & CYL_INIT_RADIUS) Radius is initialized (near from its good value)
CYL_FORCE_CENTER (Force & CYL_FORCE_CENTER) Center is forced (an axis passing through Center should be found)
CYL_INIT_CENTER (Force & CYL_INIT_CENTER) Center is initialized (near from its good position)
CYL_FORCE_DIRECTION (Force & CYL_FORCE_DIRECTION) Direction is forced (DirectionVector exactly)
CYL_INIT_DIRECTION (Force & CYL_INIT_DIRECTION) Direction is approximately (DirectionVector nearly)
[in]iCenterFirst point of the center line.
[in]DirectionVectorNormed Normal vector of the plane.
[in]RadiusRadius of the circle
[in]fillCloudWhich cloud should be filled: both, only one or none

◆ BestLine

Array SCloud::BestLine ( Number  NbPointElim,
LineEnum  Force,
SPoint  iAveragePoint = {},
SVector  DirectionVector = {},
FillCloudEnum  fillCloud 
)
slot

Calculates the best line fitting with the cloud.

Return values
Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 An error occurred. In this case, the results are not available.
Array.LineThe resulting best SLine.
Array.StdDeviationThe standard deviation.
Array.DistWorstPtThe distance of the worst point to the best shape found.
Array.FormErrorThe form error. In this case, linearity.
Array.InCloudThe extracted points.
Array.OutCloudThe cloud without the extracted points.
Parameters
[in]NbPointElimThe number of points to eliminate. The worst points are eliminated. This number should not be greater than the total number of points -3
[in]ForceBit mask to know which parameter(s) are forced and do not need to be computed.
LINE_FORCE_POINT (Force & LINE_FORCE_POINT) Average point is forced (a line passing by this point should be found)
LINE_FORCE_DIRECTION (Force & LINE_FORCE_DIRECTION) Line direction is forced (a line with this direction should be found)
[in]iAveragePointThe point of the cloud that the line pass through
[in]DirectionVectorNormed direction vector of the line.
[in]fillCloudWhich cloud should be filled: both, only one or none

◆ BestPlane

Array SCloud::BestPlane ( Number  NbPointElim,
PlaneEnum  Force,
SPoint  iPtToForce = {},
SVector  DirectionToForce = {},
FillCloudEnum  fillCloud 
)
slot

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

Return values
Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 An error occurred. In this case, results are not available.
Array.PlaneThe resulting best SPlane.
Array.StdDeviationThe standard deviation.
Array.DistWorstPtThe distance of the worst point to the best shape found.
Array.FormErrorThe form error. In this case, flatness.
Array.InCloudThe extracted points.
Array.OutCloudThe cloud without the extracted points.
Parameters
[in]NbPointElimThe number of points to eliminate. The worst points are eliminated. This number should not be greater than the total number of points -3
[in]ForceBit mask to know which parameter(s) are forced and do not need to be computed.
PLANE_FORCE_POINT (Force & PLANE_FORCE_POINT) Average point is forced (a plane passing by this point should be found)
PLANE_FORCE_NORMAL (Force & PLANE_FORCE_NORMAL) Normal is forced (a plane with this normal should be found)
[in]iPtToForceThe average point of the cloud to force
[in]DirectionToForceNormed Normal vector of the plane to force.
[in]fillCloudWhich cloud should be filled: both, only one or none
Note
: plane size and orientation are optimized if the InCloud is filled

◆ BestSphere

Array SCloud::BestSphere ( Number  NbPointElim,
SphereEnum  Force,
SPoint  iCenter = {},
Number  Radius,
FillCloudEnum  fillCloud 
)
slot

Calculates the best sphere fitting with the cloud.

Return values
Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 An error occurred. In this case, results are not available.
Array.SphereThe resulting best SSphere.
Array.StdDeviationThe standard deviation.
Array.DistWorstPtThe distance of the worst point to the best shape found.
Array.FormErrorThe form error. In this case, sphericity.
Array.InCloudThe extracted points.
Array.OutCloudThe cloud without the extracted points.
Parameters
[in]NbPointElimThe number of points to eliminate. The worst points are eliminated. This number should not be greater than the total number of points -4
[in]ForceBit mask to know which parameter(s) is forced
SPHERE_FORCE_RADIUS (Force & SPHERE_FORCE_RADIUS) Radius is forced
SPHERE_FORCE_CENTER (Force & SPHERE_FORCE_CENTER) Center is forced
[in]iCenterThe center of the sphere to force
[in]RadiusRadius of the sphere to force
[in]fillCloudWhich cloud should be filled: both, only one or none

◆ BestSqSlot

Array SCloud::BestSqSlot ( MethodBestSqSlotEnum  method,
Number  NbPointElim,
BestRectangleForce  Force,
SPoint  iCenter = {},
SVector  Normal = {},
SVector  MainDirection = {},
Number  Length,
Number  Width,
FillCloudEnum  fillCloud 
)
slot

Calculates the best square slot fitting with the cloud.

Return values
Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 An error occurred. In this case, results are not available.
Array.SquareSlotThe resulting best SSquareSlot
Array.InCloudThe extracted points. THIS OPTION IS ONLY VALID IF THE METHOD SELECTED IS BEST_SQ_SLOT
Array.OutCloudThe cloud without the extracted points. THIS OPTION IS ONLY VALID IF THE METHOD SELECTED IS BEST_SQ_SLOT
Parameters
[in]methodmethod to measure the slot (best, inner, outer)
[in]NbPointElimThe number of points to eliminate. The worst points are eliminated. This number should not be greater than the total number of points -4
[in]ForceOnly with BEST_SQ_SLOT
Bit mask to know which parameter(s) is forced or initialized (initializing the computation provides a more rapid computation. NO_FORCE (Force & NO_FORCE) nothing is forced
FORCE_NORMAL (Force & FORCE_NORMAL) to force only the normal, translation along this axis allowed
FORCE_PLANE (Force & FORCE_PLANE) to force rectangle plane, only rotation and translation in the plane is allowed
FORCE_MAIN_DIRECTION (Force & FORCE_MAIN_DIRECTION) to force the main direction of the rectangle
FORCE_LENGTH (Force & FORCE_LENGTH) to force rectangle length
FORCE_WIDTH (Force & FORCE_WIDTH) to force rectangle width
FORCE_SQUARE (Force & FORCE_SQUARE) the rectangle is forced to a square, width and length will have same value. If FORCE_LENGTH and FORCE_WIDTH are used too, the length value will be used to define side square.
FORCE_IN_BEST_PLANE (Force & FORCE_IN_BEST_PLANE) to force rectangle in the best plane, normal and point on the rectangle is compute. If FORCE_NORMAL, FORCE_CENTER or FORCE_PLANE are used, they will have no influence
FORCE_CENTER (Force & FORCE_CENTER) to force rectangle center
[in,out]iCenterCenter of the rectangle.
[in,out]NormalNormal to the rectangle
[in,out]MainDirectionmain direction of the rectangle
[in,out]Lengthlength of the rectangle
[in,out]Widthwidth of the rectangle
[in]fillCloudWhich cloud should be filled: both, only one or none

◆ Chain

Array SCloud::Chain ( Number  ChainingDist)
slot

Chains 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
Return values
Array.ErrorCodeThe error code:
  • 0: No error.
  • 1: An error occurred or no point in the cloud.
Array.MultiTblthe table of SMultiline.
Parameters
[in]ChainingDistIf the distance between two neighbor points is less than this value a segment is created. If <=0, no limit.

◆ Classify

static Array SCloud::Classify ( Array< SCloud iClouds,
String  iModelName 
)
staticslot

Classify the point clouds using a trained model.

Parameters
[in]iCloudsThe table of clouds to classify
[in]iModelNameThe model name
Return values
Array.CloudTblTable of classified clouds
Array.ErrorCodeThe error codes:
  • 0 Succeed.
  • 1 An error occurred.
  • 2 An error occurred with the prerequisites
  • 3 The model does not exist

◆ CleanFeatureOrientation

Array SCloud::CleanFeatureOrientation ( SComp  FeatureType,
Number  Angle,
Number  DistanceTolerance,
Boolean  useEstimatedDirection,
FillCloudEnum  fillCloud 
)
slot

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

Return values
Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 An error occurred. In this case, the results are not available.
Array.InCloudThe resulting points with a scan angle lower than the threshold when compared to the feature local normal.
Array.OutCloudThe resulting points with a scan angle higher than the threshold when compared to the feature local normal.
Parameters
[in]FeatureTypeThe feature to use when dissociating the points in the cloud
[in]AngleAngle (range 0-180) in degrees between the scanning direction/local normal of the cloud and
DistanceTolerancelocal 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
Note
If no scanning direction is defined in the cloud, range of valid values is 0-90 degrees [in] distance tolerance If <=0, all part of the feature can be considered as valid for projection. If >0 Only the feature surface within the radius of DistanceTolerance around the point can be used to project the point.
Parameters
[in]useEstimatedDirectionthis boolean is set to 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
[in]fillCloudWhich cloud should be filled: both, only one or none

◆ CleanPolyOrientation

Array SCloud::CleanPolyOrientation ( SPoly  Polyhedron,
Number  Angle,
Number  DistanceTolerance,
Boolean  useEstimatedDirection,
Boolean  checkForThinParts,
FillCloudEnum  fillCloud 
)
slot

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

Return values
Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 An error occurred. In this case, the results are not available.
Array.InCloudThe resulting points found inside the SPoly
Array.OutCloudThe resulting points found outside the SPoly
Parameters
[in]PolyhedronThe SPoly to use when dissociating the points in the cloud
[in]AngleAngle (range 0-180) in degrees between the scanning direction of the cloud and the triangle normal
DistanceToleranceon which is projected the point.
When compared to the scanning direction, a value of 90 degrees guaranties that the point could be scanned
Note
If no scanning direction is defined in the cloud, range of valid values is 0-90 degrees [in] distance tolerance 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.
Parameters
[in]useEstimatedDirectionif this boolean is set to true we always use the estimated normal of the point instead of the scan direction
[in]checkForThinPartsif this boolean is set to 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)
[in]fillCloudWhich cloud should be filled: both, only one or none

◆ CleanWithLocalNormal

Array SCloud::CleanWithLocalNormal ( Number  Angle,
FillCloudEnum  fillCloud 
)
slot

Cleans the cloud according to the angle between:
.

  • the local estimated normal of one point
  • and the scanning direction of the point
    Return values
    Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 An error occurred. In this case, the results are not available.
    Return values
    Array.InCloudThe resulting points found valid according to the angular threshold
    Array.OutCloudThe resulting points found NOT valid according to the angular threshold
Parameters
[in]AngleAngle (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
[in]fillCloudWhich cloud should be filled: both, only one or none

◆ Clear

SCloud::Clear ( )
slot

To deallocate memory of the object.

◆ ClosestPoint

Array SCloud::ClosestPoint ( SPoint  iInputPt,
SPoint  CenterPt,
Number  Distance 
)
slot

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

Return values
Array.ErrorCodeThe error code.
  • 0 Success: a point could be found in the neighborhood
  • 1 Failed to find a point
Array.PointThe closest point found.
See also
SCloud.ProjDir()
Parameters
[in]iInputPtThe point from which the closest has to be found
[in]CenterPtIf not null, center point: the point returned must be inside a sphere with this center.
[in]DistanceIf not null, the point returned must have a distance from the center less than this value. The center is iCenterPt, if not null or InputPt otherwise.

◆ ColorAlongDir

static Array SCloud::ColorAlongDir ( Array< SCloud Clouds,
SVector  DirectionVect,
SPoint  iOrigin 
)
staticslot

Color the clouds along a direction with a gradient.

Note
The color used to display the clouds is spread on all clouds
Return values
Array.ErrorCodeThe error code:
  • 0: No error.
  • 1: An error occurred.
Array.CloudTblThe resulting colored clouds
This table contains the same number of clouds as the input table
Parameters
CloudsClouds to color
DirectionVectDirection to use for coloring
[in]iOriginthe origin (the point at which the value should be zero)

◆ Compare

Array SCloud::Compare ( SCloud  MeasuredCloud,
Number  DistMax,
SVector  Direction,
Boolean  checkBothDirection,
Number  maxCosAngle = -2,
Boolean  checkNormals 
)
slot

Calculates the distances between 2 point clouds.

Return values
Array.ErrorCodeThe error code.
  • 0 No error.
  • 1 An error occurred.
Array.CloudThe new SCloud, which is the result of the comparison
Array.ReportDataThe new SReportData, which contains the view set with the inspected component.
Parameters
[in]MeasuredCloudSCloud considered as the measured object to project
[in]DistMaxignore point having a distance greater than this one.
[in]DirectionThe direction of the inspection
  • 0 if it's a 3D inspection not need of a vector direction
[in]checkBothDirectiondo we have to check direction in both side?
[in]maxCosAnglemax cos value for angle (used to check orientation of normals and directions of projections)
[in]checkNormalsdo we have to take care of normals?

◆ ComputeFlatAndCurvedAreas

Array SCloud::ComputeFlatAndCurvedAreas ( Number  iNeighborhoodRadius = 0.0,
Number  iOptionMask = 0 
)
slot

Computes the flat and curved areas on the cloud.

Note
Curvature license should be active to run this command
the computed value is stored inside the colorvalue of each point. Due to the multithread process, the result is not deterministic
Parameters
iNeighborhoodRadius[in] Radius of the sphere used to consider points as neighbors if 0.0, an automatic value is computed according to the average distance between points ( 12.0 * GetMeanDistance(); )
iOptionMask[in] option bit mask
  • bit 0 (0x1) : Do we normalize the curvature between 0 and 1 ?
  • bit 1 (0x2) : Do we process patch by patch ?
  • bit 2 (0x4) : Do we check the scan directions ?
Return values
Array.ErrorCode: * 0 Success
  • 1 Cloud is empty
  • 2 Cloud format is not compatible
  • 3 An error occurred
Array.Clouda new cloud with color & inspection if successful

◆ ConvertInspectionToColor

Array SCloud::ConvertInspectionToColor ( )
slot

Convert the gradient of inspection into color for each point.

Return values
Array.ErrorCodeThe error code.
  • 0 No error
  • 1 An error occurred. In this case, the results are not available.
Array.Clouda new cloud with color & inspection
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

◆ Explode

Array SCloud::Explode ( Number  MaxDistance,
Number  DelNb,
Number  MaxNb 
)
slot

Splits 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.
Return values
Array.ErrorCodeThe error code:
  • 0 OK, 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.
Array.CloudTblThe exploded SCloud table
Parameters
[in]MaxDistanceDistance 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 dimention is a statistic, it is meaningful only if the number of points is high (minimum 1000 points))
[in]DelNbDelete threshold or 0 if none. All clusters having a number of points less or equal to this value are deleted.
[in]MaxNbMaximum 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.

◆ ExplodeByClass

Array SCloud::ExplodeByClass ( )
slot

Explode a classified cloud by class.

Return values
Array.ErrorCodeThe error code
  • 0 Success
  • 1 Error
  • 2 No class information in the cloud
Array.CloudTblTable of the exploded clouds.
Array.ClassTblTable of classes. Each class correspond to the cloud with the same index in CloudTbl.
See also
SCloud.GetClassName()

◆ ExplodeCloudClassification

static Array SCloud::ExplodeCloudClassification ( SCloud  iCloud)
staticslot

Split a point cloud that has been classified into several clouds according the point classes.

Parameters
[in]iCloudThe cloud to split.
Return values
Array.ErrorCodeThe error code.
  • 0 No error
  • 1 An error occurred. In this case, the results are not available.
Array.CloudTblAn array with one cloud per classification classes present in the cloud.
Deprecated:
This function is deprecated, use SCloud.ExplodeByClass() instead.

◆ ExplodeColor

Array SCloud::ExplodeColor ( )
slot

Explodes a SCloud by inspection colors or real colors if no inspection colors.

See also
Explode, ExplodeWithValues, GetType
Return values
Array.ErrorCodeThe error code:
  • 0 OK, 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.
  • 4 An exception occurred.
Array.CloudTblThe resulting list of component.

◆ ExplodeWithInspectionSteps

Array SCloud::ExplodeWithInspectionSteps ( )
slot

Splits the cloud according to the inspection steps.

See also
Explode, ExplodeWithValues, GetType, ExplodeColor
Return values
Array.ErrorCodeThe error code:
  • 0 OK, successful completion, no cluster deleted.
  • 1 Impossible to explode because the cloud contains no inspection steps.
  • 4 An exception occurred.
Array.CloudTblThe resulting list of component.

◆ Extract

static Array SCloud::Extract ( Array< SComp TableSComp,
Number  SamplingDistance,
Boolean  GenerateColor 
)
staticslot

To 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
Return values
Array.ErrorCodeThe error code:
  • 0: No error.
  • 1: An error occurred.
Array.CloudThe SCloud merge from all the SComp.
Parameters
[in]TableSCompThe SComp array from which to extract the cloud
[in]SamplingDistanceThe maxi sampling distance for the SPoly. If the sampling distance equals to zero, the cloud is filled only with the vertices of the polyhedron
[in]GenerateColorTo generate the new color of the cloud, or not:
  • false Ignore colors (use default color).
  • true Keep colors (convert them into real colors).

◆ ExtractCylinder

Array SCloud::ExtractCylinder ( Array< SPoint SeedPoint,
Number  Tolerance,
CylinderEnum  Force,
SPoint  iCenter = {},
SVector  DirectionVector = {},
Number  Radius,
FillCloudEnum  fillCloud 
)
slot

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

Return values
Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 An error occurred. In this case, results are not available.
Array.CylinderThe resulting best SCylinder.
Array.StdDeviationThe standard deviation.
Array.DistWorstPtThe distance of the worst point to the best shape found.
Array.InCloudThe extracted points.
Array.OutCloudThe cloud without the extracted points.
Parameters
[in]SeedPointSeed points around which the cylindrical region should be extracted.
[in]ToleranceExtract only the region that is inside the tolerance that is: only the vertices whose distance with the ideal sphere is less than this threshold.
[in]ForceBit mask to know which parameter(s) is forced or initialized (initializing the computation provides a more rapid computation.
CYL_FORCE_RADIUS (Force & CYL_FORCE_RADIUS) Radius is forced
CYL_INIT_RADIUS (Force & CYL_INIT_RADIUS) Radius is initialized (near from its good value)
CYL_FORCE_CENTER (Force & CYL_FORCE_CENTER) Center is forced (an axis passing through Center should be found)
CYL_INIT_CENTER (Force & CYL_INIT_CENTER) Center is initialized (near from its good position)
CYL_FORCE_DIRECTION (Force & CYL_FORCE_DIRECTION) Direction is forced (DirectionVector exactly)
CYL_INIT_DIRECTION (Force & CYL_INIT_DIRECTION) Direction is approximately (DirectionVector nearly)
[in]iCenterFirst point of the center line.
[out]DirectionVectorNormed Normal vector of the cylinder.
[in]RadiusRadius of the cylinder to force
[in]fillCloudWhich cloud should be filled: both, only one or none

◆ ExtractMedianPointOnWhiteLine

Array SCloud::ExtractMedianPointOnWhiteLine ( SPoint  iSeedPoint,
Number  iSphereRadius,
Number  iOptionMask,
FillCloudEnum  iFillCloud = FILL_NONE 
)
slot

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

Note
You must have the license LIC3DR_Surveying to execute this function. See License::ValidLicense for more information.
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
iSeedPoint[in] seed point, center of the sphere of research
iSphereRadius[in] radius of the sphere around seed point where we search the white points
iOptionMask[in] option bit mask
  • bit 0 (1): Do we try to reduce the noise by exploding the white points cloud and keeping the biggest ? Explode uses 2 * 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 ?
iFillCloud[in] Which cloud should be filled : both, only one or none In : white line points in the sphere of research Out : the other points in the sphere of research
Return values
Array.ErrorCodeThe error code:
  • 0 No problem
  • 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 mesh creation
  • 8 No contour found for the 2D mesh
  • 9 Two opposed points on contour not found
  • 10 An other error occurred
Array.PointThe median point found on the white line
Array.InCloudThe white line points found in the research sphere
Array.OutCloudThe other points found in the research sphere

◆ ExtractMultilineFromSeed

Array SCloud::ExtractMultilineFromSeed ( SPoint  iSeedPoint,
Number  iTolerance,
Number  iCylinderLength,
Number  iSearchRange,
Boolean  iChainOption 
)
slot

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

Parameters
iSeedPoint[in] Seed point around which the polyline will be extracted
iTolerance[in] Extraction tolerance value. It corresponds to a cylinder diameter for the algorithm and thickness for the user
iCylinderLength[in] Length of each cylindrical selection. It corresponds to the length of the smallest line which can be extracted, divided by two
iSearchRange[in] Maximum distance between two lines of the same line section
iChainOption[in] true : Chain sections, false : no chain
Return values
Array.MultiThe extracted multiline
Array.LineTblReturned lines useful because lines can be unchained
Array.InCloudTblTable of clouds containing points used for each extraction
Array.OutCloudCloud containing all points except points used for the multiline extraction
Array.OutExtractedPtsCloudCloud containing all points used for multiline extraction
Array.ErrorCodeThe error code.
  • 0 Success,
  • 1 Error
  • 2 NoisePoint
  • 3 BadParameter
  • 4 BadFirstLine

◆ ExtractPlane

Array SCloud::ExtractPlane ( Array< SPoint SeedPoint,
Number  Tolerance,
PlaneEnum  Force,
SPoint  iAveragePoint = {},
SVector  DirectionVector = {},
FillCloudEnum  fillCloud 
)
slot

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

Return values
Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 An error occurred. In this case, results are not available.
Array.PlaneThe resulting extracted SPlane.
Array.StdDeviationThe standard deviation.
Array.DistWorstPtThe distance of the worst point to the best shape found.
Array.InCloudThe extracted points.
Array.OutCloudThe cloud without the extracted points.
Parameters
[in]SeedPointSeed point(s) around which the planar region should be extracted.
[in]ToleranceExtract only the region that is inside the tolerance that is: only the vertices whose distance with the ideal plane is less than this threshold.
[in]ForceBit mask to know which parameter(s) are forced and do not need to be computed.
PLANE_FORCE_POINT (Force & PLANE_FORCE_POINT) Average point is forced (a plane passing by this point should be found)
PLANE_FORCE_NORMAL (Force & PLANE_FORCE_NORMAL) Normal is forced (a plane with this normal should be found)
[in]iAveragePointThe average point of the cloud
[in]DirectionVectorNormed Normal vector of the plane.
[in]fillCloudWhich cloud should be filled: both, only one or none

◆ ExtractSphere

Array SCloud::ExtractSphere ( Array< SPoint SeedPoint,
Number  Tolerance,
SphereEnum  Force,
SPoint  iCenter = {},
Number  Radius,
FillCloudEnum  fillCloud 
)
slot

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

Return values
Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 An error occurred. In this case, results are not available.
Array.SphereThe resulting best SSphere.
Array.StdDeviationThe standard deviation.
Array.DistWorstPtThe distance of the worst point to the best shape found.
Array.InCloudThe extracted points.
Array.OutCloudThe cloud without the extracted points.
Parameters
[in]SeedPointSeed points around which the spherical region should be extracted.
[in]ToleranceExtract only the region that is inside the tolerance that is: only the vertices whose distance with the ideal sphere is less than this threshold.
[in]ForceBit mask to know which parameter(s) is forced
SPHERE_FORCE_RADIUS (Force & SPHERE_FORCE_RADIUS) Radius is forced
SPHERE_FORCE_CENTER (Force & SPHERE_FORCE_CENTER) Center is forced
[in]iCenterThe center of the sphere to force
[in]RadiusRadius of the sphere to force
[in]fillCloudWhich cloud should be filled: both, only one or none

◆ FilterByNormalDirection

Array SCloud::FilterByNormalDirection ( SVector  iDirection,
Number  iMinCosAngle,
Boolean  isDirectionSigned 
)
slot

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
[in]iDirectionThe kept points must have this similar direction.
[in]iMinCosAngleThe angle threshold to filter the normals.
[in]isDirectionSignedDo we check the sign of the direction ?
Return values
Array.ErrorCode
  • 0 if all the point normals were present on the cloud,
  • 1 if some normals are missing.

◆ FilterMovingObjects

Array SCloud::FilterMovingObjects ( Number  iResolutionAt10m,
Number  iThreshold 
)
slot

Function allowing to separate point cloud into moving and fixed points.

Parameters
[in]iResolutionAt10mResolution at 10 m.
[in]iThresholdvalue under which two points are considered identical.
Return values
Array.InCloud=> Cloud containing fixed objects.
Array.OutCloud=> Cloud containing moving objects.
Array.ErrorCode
  • 0 Success,
  • 1 the input cloud does not have enough scanning positions,
  • 2 An error occurred.

◆ FilterWithInspectionValues

static Array SCloud::FilterWithInspectionValues ( Array< SCloud iCloudOfPoints,
Number  iLowerThreshold,
Number  iUpperThreshold,
OutputCloudsTypeInspectionValuesEnum  iOutputCloudsType 
)
staticslot

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.

Return values
Array.CloudTblThis function returns a table of clouds
Array.ErrorCodeThe error code:
  • 0 No error occurred.
  • 1 An error occurred.
Parameters
[in]iCloudOfPointsThe table of clouds to filter
[in]iLowerThresholdThe lower threshold value
[in]iUpperThresholdThe upper threshold value
[in]iOutputCloudsTypeOutput type Inside : Keep only clouds inside the range Outside : Keep only outside the range Both : Keep both inside and outside clouds

◆ FlipIntensities

Array SCloud::FlipIntensities ( )
slot

Turns intensity values upside down.

Return values
Array.ErrorCodeThe error code.
  • 0 No error
  • 1 An error occurred while flipping values
  • 2 The cloud doesn't have inspection information
Array.CloudThe resulting reduced cloud.
See also
HasInspection

◆ FromAsciiFile

static Array SCloud::FromAsciiFile ( String  iFileName,
String  iFormat,
Number  iNbPtToKeep,
Boolean  iImportScanDir 
)
staticslot

Reads 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.
Return values
Array.ErrorCodeThe error code:
  • 0: No error.
  • 1: An error occurred.
Array.CloudThe loaded SCloud
See also
SCloud.FromFile()
Parameters
iFileNameThe file name path
[in]iFormatif 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.
[in]iNbPtToKeepNumber of points to keep in the reduced cloud
  • 0: Do not reduce the number of points.
  • else: Reduces the point cloud with points envely spaced (as much as possible)
[in]iImportScanDirShould we import scanning direction if exists?

◆ FromClick

static Array SCloud::FromClick ( )
inlinestaticslot

Displays a dialog box to select an SComp in the scene.

Warning
This function will break the script, and wait for user interaction.
Return values
Array.ErrorCodeThe error code
  • 0: Success, the SComp is selected.
  • 1: Nothing is selected.
  • 2: The ESCape key has been pressed
Array.Cloudthe SCloud selected

◆ FromFile

static Array SCloud::FromFile ( String  FileName,
CloudScriptTypesEnum  IndexType,
Number  NbPtToKeep,
Boolean  ImportScanDir 
)
staticslot

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

Warning
In Javascript, when you write strings the '\' character is an escape character, you need to use '\\' or '/' instead. Pay especially attention to this when writing file paths in your scripts. For example :
var res = SCloud.FromFile( 'C:/Cloud.nsd' ); // Valid syntax\n
var res2 = SCloud.FromFile( 'C:\\Cloud.nsd' ); // Valid syntax\n
var res3 = SCloud.FromFile( 'C:\Cloud.nsd' ); // Invalid syntax
Return values
Array.ErrorCodeThe error code:
  • 0: No error.
  • 1: An error occurred.
Array.CloudTblThe loaded array of SCloud
See also
SCloud.FromAsciiFile()
Parameters
[in]FileNameThe file name path
[in]IndexTypeThe file type, a CloudScriptTypesEnum value (AUTO_DETECT or another value for special file types)
[in]NbPtToKeepThe maximum number of points to load (in case of memory save), or 0 if unlimited. Defaults to 6,000,000 if unspecified.
[in]ImportScanDirShould we import scanning direction if exists?

◆ FromName

static Array SCloud::FromName ( String  Name)
inlinestaticslot

Search all the component with the given name.

Return values
Arrayall the SCloud with the given name

◆ FromSel

static Array SCloud::FromSel ( )
staticslot

To get all the selected SComp.

Return values
Arrayall the SCloud selected

◆ GetCategoriesInModel

static Array SCloud::GetCategoriesInModel ( String  iModelName)
staticslot

Get the categories available in the given model.

Parameters
[in]iModelNameThe model name
Return values
Array.StringTblTable of the name of the categories
Array.ErrorCodeThe error codes:
  • 0 Succeed.
  • 1 An error occurred.
  • 2 An error occurred with the prerequisites
  • 3 The model does not exist

◆ GetCentroid

Array SCloud::GetCentroid ( )
slot

To compute the Centroid of a point cloud.

Return values
Array.ErrorCodeThe error code.
  • 0 OK, no error
  • 1 Empty point cloud
Array.PointCloud centroid

◆ GetClassificationModels

static Array SCloud::GetClassificationModels ( )
staticslot

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

◆ GetClassName

static Array SCloud::GetClassName ( Number  iClassId)
staticslot

Get the class name for a given class ID.

Parameters
[in]iClassIdTee class ID, in the 0-255 interval
Return values
Array.NameThe name of the class
Array.ErrorCodeThe error code:
  • 0 Success
  • 1 Invalid class ID
See also
SCloud.ExplodeByClass()

◆ GetCloudRepresentation

CloudRepresentationTypeEnum SCloud::GetCloudRepresentation ( )
slot

Return the current representation.

◆ GetColorGradient

Array SCloud::GetColorGradient ( )
inlineslot

To get the color gradient of the SCloud.

Return values
Array.ErrorCodeThe error code.
  • 0 OK, no error
  • 1 No color gradient associated to this SCloud
Array.Gradientthe SColorGradient associated to the current SCloud

◆ GetConvexContour

Array SCloud::GetConvexContour ( SVector  ViewDirection,
SPoint  PointOnPlane,
Boolean  Is3dContour 
)
slot

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

Note
You must have the license LIC3DR_Contour to execute this function.
Return values
Array.ErrorCodeThe error code.
  • 0 No error
  • 1 An error occurred. In this case, the results are not available.
Array.MultiThe computed convex contour.
Parameters
[in]ViewDirectionDirection in which the computation must be done. If null, the direction is the normal to the best plane of the points.
[in]PointOnPlaneIf a planar result is requested, a point of the plane. If null, the average point of the cloud is taken.
[in]Is3dContourif false a planar contour is computed. if true a 3D contour is computed.

◆ GetConvexHull

Array SCloud::GetConvexHull ( )
slot

Compute the convex hull of a point cloud.

Return values
Array.ErrorCodeThe 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.
Array.PolyThe computed convex hull.

◆ GetHighestPoint

Array SCloud::GetHighestPoint ( SVector  Direction)
slot

Get the highest point according to the Direction.

Return values
Array.ErrorCodeThe error code.
  • 0 Success: a point could be found along the direction
  • 1 Failed to find a point
Array.PointThe highest point found.
Parameters
[in]DirectionDirection in which the highest point must be found.

◆ GetIterator

SCloudIterator SCloud::GetIterator ( )
slot
Returns
Iterator on the current cloud
This iterator is initialized with a point of the cloud

◆ GetLowestPoint

Array SCloud::GetLowestPoint ( SVector  Direction)
slot

Get the lowest point according to the Direction.

Return values
Array.ErrorCodeThe error code.
  • 0 Success: a point could be found along the direction
  • 1 Failed to find a point
Array.PointThe lowest point found.
Parameters
[in]DirectionDirection in which the highest point must be found.

◆ GetMeanDistance

Number SCloud::GetMeanDistance ( )
slot

Calculate the average distance between points of the cloud.

Note
This distance can be used to calculate the default MaxDistance parameter for the function Explode.
Return values
Thestatistic 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 ( )
slot
Returns
Returns the number of points in the cloud.

◆ GetPointSize

Number SCloud::GetPointSize ( )
slot

Return the current point size.

◆ GetScanningPositions

Array SCloud::GetScanningPositions ( )
slot

Extract the scanning positions of the cloud.

Return values
Array.ErrorCodeThe error code.
  • 0 OK, no error
  • 1: An error occurred.
Array.PointTblTable of points corresponding to the scan positions.

◆ HasColor

Number SCloud::HasColor ( )
slot

Check if the cloud has color information.

◆ HasGriddedInformation

Number SCloud::HasGriddedInformation ( )
slot

Check if points are organized as a gridded structure.

◆ HasInspection

Number SCloud::HasInspection ( )
slot

Check if the cloud has inspection information.

◆ hasScanDir

Boolean SCloud::hasScanDir ( )
slot

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

◆ LoadColorGradient

Array SCloud::LoadColorGradient ( String  FilePath)
inlineslot

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

Warning
In Javascript, when you write strings the '\' character is an escape character, you need to use '\\' or '/' instead. Pay especially attention to this when writing file paths in your scripts. For example :
var res = TheGradient.Load( 'C:/Gradient.rsi' ); // Valid syntax\n
var res2 = TheGradient.Load( 'C:\\\\Gradient.rsi' ); // Valid syntax\n
var res3 = TheGradient.Load( 'C:\\Gradient.rsi' ); // Invalid syntax
Return values
Array.ErrorCodeThe error code.
  • 0 OK, no error
  • 1 No color gradient associated to this SPoly
  • 2 An error occurred
Array.GradientThe color gradient associated to the current SCloud
Parameters
FilePathThe complete file path to load from

◆ LocalizeValues

Array SCloud::LocalizeValues ( Number  iMin,
Number  iMax 
)
slot

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

Return values
Array.ErrorCodeThe error code
  • 0 No error
  • 1 The cloud is not inspected
  • 2 An error occurred
Array.ResultsA table of result. Each result is a structure with the following members:
  • result.Comp (SComp) The point
  • result.Label (SLabel) A label pointing on the point
  • result.Threshold (real) The threshold value associated
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 extremum values' );;
ret.Results.forEach(function(curResult)
{
curResult.Comp.AddToDoc();
curResult.Label.AddToDoc();
print('Threshold='+curResult.Threshold);
}
);
static Array FromSel()
To get all the selected SComp.
Parameters
[in]iMinMinimum threshold
[in]iMaxMaximum threshold

◆ Merge

static Array SCloud::Merge ( Array< SCloud TableSCloud)
staticslot

To 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
Return values
Array.ErrorCodeThe error code:
  • 0: No error.
  • 1: An error occurred.
Array.CloudThe SCloud merge from all the SComp.
Parameters
[in]TableSCloudThe SCloud array to merge all together

◆ New [1/2]

static SCloud SCloud::New ( )
staticslot

Default constructor to create an empty new SCloud.

◆ New [2/2]

static SCloud SCloud::New ( SCloud  Other)
staticslot

Constructs an SCloud by copying the SCloud _iOther.

◆ NoiseReductionSplit

Array SCloud::NoiseReductionSplit ( unsigned  Threshold)
slot

The goal of noise reduction is to split the cloud in 2 clouds according to a noise reduction threshold: 1) The "good" points. 2) The "bad" points (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
Explode.
Return values
Array.ErrorCodeThe error code:
  • 0 OK.
  • 1 An error occurred.
  • 2 Error impossible operation: less than 2 points.
Array.GoodCloudThe cloud containing the good points.
Array.BadCloudThe cloud containing the bad points.
Parameters
ThresholdNoise reduction threshold : 0 <= Threshold <= 100

◆ ProjDir

Array SCloud::ProjDir ( SPoint  iPointToProject,
SVector  Direction,
Number  Aperture,
Boolean  DirectionUnsigned 
)
slot

Calculates 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 output.
Return values
Array.ErrorCodeThe error code.
  • 0 OK, no error
  • 1 No projection found
  • 2 An error occurred.
Array.PointThe projection found : this point of the cloud is the nearest point along Direction
See also
SCloud.ClosestPoint()
Parameters
[in]iPointToProjectThe point to project.
[in]DirectionProjection normalized vector
[in]Aperturethe distance around the ray that is used to find the point
[in]DirectionUnsignedtrue: Direction is considered as an unsigned vector
  • false: as a signed vector

◆ ProjectGrid

static Array SCloud::ProjectGrid ( SPoly  iPoly,
SPoint  iOrigin,
SVector  iProjectionDir,
SVector  iHorizontalDir,
Number  iStepHorizontal,
Number  iStepVertical 
)
staticslot

Calculate the grid cloud projected onto a mesh.

Parameters
[in]iPolyMesh on which the grid must be projected
[in]iOriginThe origin point of the grid
[in]iProjectionDirThe direction of projection
[in]iHorizontalDirThe horizontal direction of the grid
[in]iStepHorizontalHorizontal step of the grid (in project unit)
[in]iStepVerticalVertical step of the grid (in project unit)
Return values
Array.MinCloudCloud of the grid minimum
Array.MaxCloudCloud of the grid maximum
Array.ErrorCodeThe error code:
  • 0 No error occurred.
  • 1 Direction and horizontal vectors are collinear.
  • 2 An error occurred.

◆ ProjectOnPlane

Array SCloud::ProjectOnPlane ( SPlane  iPlane)
slot

Projects the point cloud onto a plane.

Return values
Array.ErrorCodeThe error code.
  • 0 OK, no error
  • 1 An error occurred.
Array.CloudThe cloud projected ont the plane
Parameters
[in]iPlanethe plane on which to project

◆ Reduce

Array SCloud::Reduce ( unsigned  NumberOfPoints)
slot

Calculates 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 (>10 million points) and (or) having very big difference of density.
Return values
Array.ErrorCodeThe error code:
  • 0 OK.
  • 1 The number of points in the cloud is two small or the number of points to keep is too high.
  • 2 An exception occurred.
Array.CloudThe resulting reduced cloud.
Parameters
[in]NumberOfPointsNumber of points to keep in the reduced cloud

◆ ReduceBest

Array SCloud::ReduceBest ( Number  MiniAverageDist,
Number  MaxAverageDist 
)
slot

Calculates 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 (>10 million points) 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
Reduce
Return values
Array.ErrorCodeThe error code:
  • 0 OK.
  • 1 The number of points in the cloud is two small or MiniAverageDist or MaxAverageDist is not relevant.
  • 2 An exception occurred
Array.CloudThe resulting reduced cloud.
Parameters
[in]MiniAverageDistMini average distance between points.
[in]MaxAverageDistMaxi 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 MiniAverageDist.

◆ RegionGrowFreePolyline

Array SCloud::RegionGrowFreePolyline ( SPoint  iSeedPoint,
Number  iSamplingStep 
)
slot

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

Note
You must have the license LIC3DR_Surveying to execute this function. See License::ValidLicense for more information.
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
iSeedPoint[in] point on the line to extract
iSamplingStep[in] 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
Array.ErrorCode
  • 0 No problem
  • 1 Invalid input parameters
  • 2 An error occurred
Array.Multithe multiLine found

◆ Save

Array SCloud::Save ( String  FilePath,
QChar  decimalSeparator = '.',
Boolean  EXPORT_SCAN_DIR,
SMatrix  CoordinateSystemMatrix = {} 
)
slot

Saves the cloud into a file. Supported extensions : .asc, .csv, .igs, .nsd, .pts, .ptx. Refer to SSurveyingFormat::ExportCloud() to save into .las or .laz format.

Warning
In Javascript, when you write strings the '\' character is an escape character, you need to use '\\' or '/' instead. Pay especially attention to this when writing file paths in your scripts. For example :
var res = theCloud.Save( 'C:/Cloud.nsd' ); // Valid syntax\n
var res2 = theCloud.Save( 'C:\\\\Cloud.nsd' ); // Valid syntax\n
var res3 = theCloud.Save( 'C:\\Cloud.nsd' ); // Invalid syntax
Note
Scanning direction compatibility
  • asc/csv: Yes (on demand)
  • nsd: Yes (mandatory)
  • ptx: Yes (mandatory)
  • pts: No
  • igs: No
Return values
Array.ErrorCodeThe error code.
  • 0 : No error.
  • >0 : Number of clouds which failed to be saved.
Array.IsDemoVersionIndicates if this is a demo version or not
Array.IsScanDirAvailable
  • true : no error
  • false : some clouds don't have Scanning direction to export
Array.IsScanDirExportedIndicates if the chosen format is compatible with Scanning directions
Parameters
[in]FilePathThe complete file path to save into
[in]decimalSeparatorDecimal separator in number representation
[in]EXPORT_SCAN_DIRIf .asc or .csv formats: true will export the scanning directions (in addition to XYZ and IRGB), false will only export XYZIRGB
Otherwise, this parameter is set automatically, thanks to format compatibility
[in]CoordinateSystemMatrixThe matrix to define a UCS used for the export (or identity to use the WCS)

◆ SaveColorGradient

Array SCloud::SaveColorGradient ( String  FilePath)
inlineslot

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

Warning
In Javascript, when you write strings the '\' character is an escape character, you need to use '\\' or '/' instead. Pay especially attention to this when writing file paths in your scripts. For example :
var res = TheGradient.Save( 'C:/Gradient.rsi' ); // Valid syntax\n
var res2 = TheGradient.Save( 'C:\\\\Gradient.rsi' ); // Valid syntax\n
var res3 = TheGradient.Save( 'C:\\Gradient.rsi' ); // Invalid syntax
Return values
Array.ErrorCodeThe error code.
  • 0 OK, no error
  • 1 No color gradient associated to this SCloud
  • 2 An error occurred
Array.IsDemoVersionIndicates if this is a demonstration version or not
Parameters
FilePathThe complete file path to save into

◆ SectionPlane

Array SCloud::SectionPlane ( SVector  NormalVectorOfThePlanes,
SPoint  iPointOnTheFirstPlane,
Number  NumberOfParallelPlanes,
Number  DistanceBeetweenParallelPlanes,
Number  PlaneThickness,
Number  ChainingDist,
Boolean  NoiseReduction 
)
slot

Intersection of a point cloud by parallel planes.

Return values
Array.ErrorCodeThe error code:
  • 0: No error
  • 1: An error occurred
Array.MultiTblThe resulting planar sections
Parameters
NormalVectorOfThePlanesNormal vector of the plane
iPointOnTheFirstPlanePoint on the first plane
NumberOfParallelPlanesNumber of parallel planes.
  • If > 0 the sections are done only in the way of the vector.
  • If < 0, an infinity of parallel planes is assumed.
DistanceBeetweenParallelPlanesDistance between planes
PlaneThicknessPlane 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.
ChainingDistIf the distance between two neighbor points is less than this value a segment is created.
NoiseReductionShould we activate noise reduction ?

◆ Separate

Array SCloud::Separate ( SMultiline  iClosedContour,
SVector  Direction,
SPoint  PntFirstPlane,
SPoint  PntSecondPlane,
FillCloudEnum  fillCloud 
)
slot

Makes a copy of points found INside and (or) OUTside the box and preserve the current cloud.

Return values
Array.ErrorCodeThe 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 ...)
Array.InCloudCloud with points INside the box
Array.OutCloudCloud with points OUTside the box
Parameters
[in]iClosedContourClosed polygonal contour that cuts the current cloud.
[in]DirectionDirection of the extrusion.
[in]PntFirstPlanePoint on the first plane of the box. The plane is normal to the ViewDirection. If 0 the extrusion in considered as unlimited.
[in]PntSecondPlanePoint on the second plane of the box. The plane is normal to the ViewDirection. If 0 the extrusion in considered as unlimited.
[in]fillCloudWhich cloud should be filled: both, only one or none

◆ SeparateFeature

Array SCloud::SeparateFeature ( SComp  FeatureType,
Number  Tolerance,
FillCloudEnum  fillCloud 
)
slot

Gets all the points found inside (or outside) a feature (circle, cylinder, plane).

Return values
Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 An error occurred. In this case, the results are not available.
Array.InCloudThe resulting points found inside the feature
Array.OutCloudThe resulting points found outside the feature
Parameters
[in]FeatureTypeThe feature to use when dissociating the points in the cloud
[in]ToleranceTolerance 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
[in]fillCloudWhich cloud should be filled: both, only one or none

◆ SeparateMultiline

Array SCloud::SeparateMultiline ( SMultiline  Multiline,
Number  Tolerance,
FillCloudEnum  fillCloud 
)
slot

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

Return values
Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 An error occurred. In this case, the results are not available.
Array.InCloudThe resulting points found near the multiline
Array.OutCloudThe resulting points found far the multiline
Parameters
[in]MultilineThe multiline to use when dissociating the points in the cloud
[in]ToleranceTolerance The multiline is used as a skin and points lying at a distance lower than the Tolerance from the multiline are inside
[in]fillCloudWhich cloud should be filled: both, only one or none

◆ SeparatePoly

Array SCloud::SeparatePoly ( SPoly  Polyhedron,
Number  Tolerance,
FillCloudEnum  fillCloud 
)
slot

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

Return values
Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 An error occurred. In this case, results are not available.
Array.InCloudThe resulting points found inside the SPoly
Array.OutCloudThe resulting points found outside the SPoly
Parameters
[in]PolyhedronThe SPoly to use when dissociating the points in the cloud
[in]ToleranceTolerance 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
[in]fillCloudWhich cloud should be filled: both, only one or none

◆ SeparateWithClippingObjects

static Array SCloud::SeparateWithClippingObjects ( Array< SCloud iCloudOfPoints,
OutputCloudsTypeClippPlanesEnum  iOutputCloudsType 
)
staticslot

Separate cloud(s) according to active clipping objects.

Return values
Array.CloudTblThis function returns a table of clouds
Array.ErrorCodeThe error code:
  • 0 No error occurred.
  • 1 An error occurred.
Parameters
[in]iCloudOfPointsThe table of clouds to filter
[in]iOutputCloudsTypeOutput type Clipped : Keep only visible clouds Unclipped : Keep only invisible clouds Both : Keep visible and invisible clouds

◆ SeparateWithRealColors

static Array SCloud::SeparateWithRealColors ( Array< SCloud iCloudOfPoints,
Number  iColorR,
Number  iColorG,
Number  iColorB,
Number  iTolerance 
)
staticslot

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.

Return values
Array.CloudTblThis function returns a table of clouds (even: inClouds; odd: outClouds)
Array.ErrorCodeThe error code:
  • 0 No error occurred.
  • 1 An error occurred.
Parameters
[in]iCloudOfPointsThe table of clouds to filter
[in]iColorRR value of reference color to separate the clouds [0-255]
[in]iColorGG value of reference color to separate the clouds [0-255]
[in]iColorBB value of reference color to separate the clouds [0-255]
[in]iToleranceTolerance to determine close and distant colors
  • 0 : Strict
  • 20 : Default
  • 40 : Tolerant

◆ SeparateWithScanningPositions

static Array SCloud::SeparateWithScanningPositions ( Array< SCloud iClouds,
Boolean  CreateCloudWithoutScanningPositions 
)
staticslot

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

Return values
Array.CloudTblThis function returns a table of clouds
Array.ErrorCodeThe error code:
  • 0 No error occurred.
  • 1 An error occurred.
Parameters
[in]iCloudsThe table of clouds to filter
[in]CreateCloudWithoutScanningPositionsShould we create a cloud containing all points without scanning position?

◆ SeparateWithScanPatches

static Array SCloud::SeparateWithScanPatches ( Array< SCloud iClouds,
Boolean  CreateCloudWithoutScanPatches 
)
staticslot

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

Return values
Array.CloudTblThis function returns a table of clouds
Array.ErrorCodeThe error code:
  • 0 No error occurred.
  • 1 An error occurred.
Parameters
[in]iCloudsThe table of clouds to filter
[in]CreateCloudWithoutScanPatchesShould we create a cloud containing all points without scanning patch?

◆ SetCloudRepresentation

SCloud::SetCloudRepresentation ( CloudRepresentationTypeEnum  Representation)
slot

The representation of the component is modified.

Parameters
[in]RepresentationThe cloud representation type

◆ SetPointSize

SCloud::SetPointSize ( Number  pointSize)
slot

New point size.

Parameters
[in]pointSizeThe new point size

◆ toString [1/2]

String SCloud::toString ( )
slot

Get the type of the variable.

◆ toString [2/2]

static String SCloud::toString ( )
staticslot

Get the type of the variable.