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

Class to store a multiline, that is: an ordered list of points. The SMultiline creation can be done by calling the static functions:
. More...

#include <SMultiLine.h>

Inheritance diagram for SMultiline:
SComp SObject

Public Types

enum  MultilineRepresentationTypeEnum { MULTILINE_SEGMENTS , MULTILINE_VERTICES , MULTILINE_INSPECTION }
 The different representation types for multilines.
Use SMultiline.FLAT. More...
 
enum  OffsetSideEnum { OTHER_SIDE , SAME_SIDE }
 To know on which side the offset is computing depending of a define point. More...
 
enum  RepairAutoIntersectionPolicyEnum { SUPPRESS_SMALL_LOOPS_FIRST , SUPPRESS_LONG_LOOPS_FIRST , SUPPRESS_IN_VERTEX_ORDER }
 Enum the autointersection reparation policy. More...
 
enum  SmoothEnum { SMOOTH_TYPE1 , SMOOTH_TYPE2 , SMOOTH_BSPLINE }
 Enum the smoothing type. 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

 AddArrows (Boolean Reverse)
 Add two arrows at the extremities of the SMultiline. More...
 
 AddArrows (Number NbArrow, Number Position)
 Add some arrows along the SMultiline. More...
 
static Array All (Number VisCrit)
 To get all the SComp in the document. More...
 
static Array Chain (Array< SMultiline > TableLine, Number MaxiSegmentLength, Number Accuracy, Boolean Close)
 Chain all the SMultiline by creating new segments between nearest SMultiline extremities.
Optional try to close it.
. More...
 
 Clear ()
 Clear to deallocate memory. More...
 
 Close ()
 Close a MultiLine. More...
 
Array ClosestPoint (SPoint iPoint)
 Finds the point in the current multiline that is the closest from an input point. More...
 
Array CloseWithCurvedJunction (Number nPoints, Boolean makePlanarJunction)
 Close a MultiLine with a curved junction. More...
 
Array Compare (SMultiline iMeasuredMulti, Number DistMax, SVector ProjectionDir={}, Number MappingObject, Boolean IgnoreEdge, Boolean PtToPt, Boolean InPlane)
 Calculates the distances between 2 SMultilines for further inspection purpose (color mapping). More...
 
static Array ComputeNeutralAxis (SComp iTubularShape, SComp iHelpLine, Boolean iIsCircle, Number iApproxDiameter, Number iApproxWidth, Number iApproxLength, SVector iDirection, Number iCalculationAccuracy, Boolean iDetectAbsurdPoints, Number iSmoothNeutralAxis, Boolean iReconstructPipe)
 This function is used to compute the neutral axis of a SCloud or SPoly or surfacic SShape. More...
 
static Array ComputeNeutralAxis (SComp iTubularShape, SComp iHelpLine, Boolean iIsCircle, Number iApproxDiameter, Number iApproxWidth, Number iApproxLength, SVector iDirection, Number iCalculationAccuracy, Number iSmoothNeutralAxis, Boolean iReconstructPipe)
 This function is used to compute the neutral axis of a SCloud or SPoly or surfacic SShape. More...
 
static Array CurvedJunction (SMultiline iFirstMultiline, SMultiline iSecondMultiline, Number nPoints, Boolean makePlanarJunction, Boolean chainWithInput)
 Creates a curved junction between two SMultiline.
. More...
 
static Array Cut (SMultiline TheSelEdge, SPoint iPoint)
 Cut all the SMultiline by creating new segments between nearest SMultiline extremities.
. More...
 
static Array FromClick ()
 Launches a click interaction to select a SComp in the scene. More...
 
Array FromFile (String FileName)
 
static Array FromName (String Name)
 Search all the component with the given name. More...
 
static Array FromSel ()
 To get all the selected SComp. More...
 
Number GetArea (SVector ProjDir)
 Computes the area of a closed SMultiline projected with a direction. More...
 
Array GetAutoIntersections (Number iLenghtTol)
 Check whether a multiline contains autointersections. More...
 
SPoint GetCentroidLinear ()
 Returns the barycenter of the current line considering the line having a constant linear density all along the polyline. More...
 
Array GetColorGradient ()
 To get the color gradient of the SMultiline. More...
 
Array GetDeviation (Number iIndex)
 
Array GetDeviations ()
 return all deviation values of the multiline More...
 
Number GetLength ()
 
Array GetNormal ()
 Calculates the normal plane of the current SMultiline. More...
 
Number GetNumber ()
 
SPoint GetPoint (unsigned Index)
 
Array GetPointAtDistance (Number DistanceToOrigin, Boolean InterpolateOnSegments)
 Returns the point at a given distance on the current SMultiline. More...
 
Array InsertFirst (SPoint iPointToCopy, Number AbsoluteAccuracy)
 A point is added at the END of the multiline. More...
 
Array InsertLast (SPoint iPointToCopy, Number AbsoluteAccuracy)
 A point is added at the END of the multiline. More...
 
Array IntersectionWithMesh (SPoly iPoly)
 Calculate intersections with 1 poly. More...
 
Array IntersectionWithOtherPlanarMulti (SMultiline iMulti)
 Calculate intersections between 2 planar multilines. More...
 
Array IntersectionWithPlane (SPlane iPlane)
 Calculate intersection with 1 plane. More...
 
Boolean IsClosed ()
 
Boolean IsPlanar ()
 
Array LoadColorGradient (String FilePath)
 Loads the color gradient from a file (*.rsi binary file). More...
 
static Array MedianLine (Array< SMultiline > TableMulti, Number NbPt)
 To compute the median line between two lines. More...
 
Array MultilineArea (SVector iProjDir)
 Computes the area of a closed SMultiline projected with a direction. More...
 
static Array MultilinesIntersections (Array< SMultiline > TableMulti, Number DesiredAccuracy)
 Function to compute the set of intersections between an arbitrary number of Multilines. More...
 
static SMultiline New ()
 Default constructor to create an empty new SMultiline. More...
 
static SMultiline New (SMultiline iOther)
 Constructs an SMultiline by copying the SMultiline Other. More...
 
Array Offset (SVector Direction, Number DistOffset, OffsetSideEnum GoodSide, SPoint iSidePt)
 Computes the parallel contour of a SMultiline according to a direction. More...
 
Array Proj3D (SPoint iPoint)
 Search the closest 3D projection of a 3D Point this MultiLine. The projection can occur on a segment or a vertex. More...
 
Array ProjDir (SPoint iThePnt, SVector ProjDir, Number Aperture)
 Search the closest projection along a direction on this MultiLine. The projection can occur on a segment or a vertex. More...
 
Array Reduce (unsigned NbPoint, Number MaxDeviation, Boolean OptimizePosition)
 Reduces the current SMultiline to have a certain number of points while keeping the best points. More...
 
Array RepairAutoIntersections (Number iLengthTol, Number iLoopMaxLength=-1, RepairAutoIntersectionPolicyEnum iPolicy)
 Repair the autointersections if there were by suppressing the smallest loop bounded by autointersection point. More...
 
 Reverse ()
 Reverse the current multiline. More...
 
Array RightAngle (Number Threshold)
 Modifies the vertex of the SMultiline in order to get Right angles on the SMultiline. More...
 
Array Save (String FilePath, SMatrix CoordinateSystemMatrix={})
 Saves the Multiline into a file. More...
 
Array SaveColorGradient (String FilePath)
 Saves the color gradient into a file (*.rsi binary file). More...
 
 SetLineWidth (Number width)
 Change the thickness of the line. More...
 
 SetMultilineRepresentation (MultilineRepresentationTypeEnum Representation)
 The representation of the component is modified. More...
 
 ShowName (Boolean iShowName)
 Control whether the name of the multiline is shown or not in the scene. More...
 
Array Smooth (Number Para1, Number SmoothIntens, SmoothEnum SmoothingType, Number MaxiDeviation)
 Recalculates new vertices to smooth the current SMultiLine. More...
 
Array SuppressSmallLines (Number iLengthTol)
 Define a multiline suppressing the lines which have a length smaller than a tolerance length. 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 ()
 Launches a click interaction to select a 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 ()
 The component containing folder's name. More...
 
String GetName ()
 The component's name. More...
 
String GetPath ()
 To get the full path of a comp in the tree. More...
 
 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

Class to store a multiline, that is: an ordered list of points. The SMultiline creation can be done by calling the static functions:
.

  • New() to create your own empty SMultiline and manually add new points.
    var myMulti = SMultiline.New(); // Empty multiline creation
    myMulti.InsertFirst(SPoint.New(1, 2, 3)); // add a point at the begining of the multiline
    myMulti.InsertFirst(SPoint.New(2, 4, 8)); // add a point at the begining of the multiline
    myMulti.InsertLast(SPoint.New(12, 2, 5)); // add a point at the end of the multiline
    myMulti.InsertLast(SPoint.New(12, 2, 5)); // this point will not be added
    var nbPt = myMulti.GetNumber(); // nbPt = 3
  • New() to copy an existing SMultiline.

Member Enumeration Documentation

◆ MultilineRepresentationTypeEnum

The different representation types for multilines.
Use SMultiline.FLAT.

Enumerator
MULTILINE_SEGMENTS 
MULTILINE_VERTICES 
MULTILINE_INSPECTION 

◆ OffsetSideEnum

To know on which side the offset is computing depending of a define point.

Enumerator
OTHER_SIDE 
SAME_SIDE 

◆ RepairAutoIntersectionPolicyEnum

Enum the autointersection reparation policy.

Enumerator
SUPPRESS_SMALL_LOOPS_FIRST 
SUPPRESS_LONG_LOOPS_FIRST 
SUPPRESS_IN_VERTEX_ORDER 

◆ SmoothEnum

Enum the smoothing type.

Enumerator
SMOOTH_TYPE1 
SMOOTH_TYPE2 
SMOOTH_BSPLINE 

Member Function Documentation

◆ AddArrows [1/2]

SMultiline::AddArrows ( Boolean  Reverse)
slot

Add two arrows at the extremities of the SMultiline.

Parameters
[in]ReverseTo know if arrows are reversed or not.
  • false means <===>
  • true means >===<

◆ AddArrows [2/2]

SMultiline::AddArrows ( Number  NbArrow,
Number  Position 
)
slot

Add some arrows along the SMultiline.

Parameters
NbArrowNumber of arrows to be drawn. Negative value means on each segment.
PositionThe place where arrow should be displayed inside [0 1].
  • 0 or less means at the start of the segment. 1 or greater means the end of the segment.

◆ All

static Array SMultiline::All ( Number  VisCrit)
inlinestaticslot

To get all the SComp in the document.

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

◆ Chain

static Array SMultiline::Chain ( Array< SMultiline TableLine,
Number  MaxiSegmentLength,
Number  Accuracy,
Boolean  Close 
)
staticslot

Chain all the SMultiline by creating new segments between nearest SMultiline extremities.
Optional try to close it.
.

Note
The original SMultiline are not modified, but a copy is done.
See also
SMultiline::CurvedJunction, SCloud::Chain
Return values
Array.ErrorCodeThe error code:
  • 0: No error.
  • 1: An error occurred.
Array.MultiTblAn SMultiline table with contours, else if the SMultilines are impossible to chain returns an empty Array
Parameters
[in]TableLineThe SMultiline table to chain
[in]MaxiSegmentLengthThe maximum size of new segments created to make junctions between polylines. If 0, no size limit.
[in]AccuracyThe comparison "equality" accuracy. If 0, the comparison value used is 1.e-5.
[in]CloseTry to close the polylines.

◆ Clear

SMultiline::Clear ( )
slot

Clear to deallocate memory.

◆ Close

SMultiline::Close ( )
slot

Close a MultiLine.

◆ ClosestPoint

Array SMultiline::ClosestPoint ( SPoint  iPoint)
slot

Finds the point in the current multiline that is the closest from an input point.

Return values
Array.ErrorCodeThe error code.
  • 0 Success: a point could be found
  • 1 Failed to find a point
Array.IndexThe index number (0 <= index < Number) of the closest vertex from the InitialPoint.
Array.SqDistanceThe square distance found.
See also
SMultiline.Proj3D(), SMultiline.ProjDir()
Parameters
[in]iPointThe point from which the closest has to be found

◆ CloseWithCurvedJunction

Array SMultiline::CloseWithCurvedJunction ( Number  nPoints,
Boolean  makePlanarJunction 
)
slot

Close a MultiLine with a curved junction.

Return values
Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 An error occurred.
Parameters
[in]nPointsthe number of points that should be created on the junction
[in]makePlanarJunctionshould the junction be planar?

◆ Compare

Array SMultiline::Compare ( SMultiline  iMeasuredMulti,
Number  DistMax,
SVector  ProjectionDir = {},
Number  MappingObject,
Boolean  IgnoreEdge,
Boolean  PtToPt,
Boolean  InPlane 
)
slot

Calculates the distances between 2 SMultilines for further inspection purpose (color mapping).

Note
The distance is measured by projecting SMultiline iMeasuredMulti on this.
This picture shows an example of inspection between two SMultiline. The color is used here to represent distance.
Return values
Array.ErrorCodeThe error code
  • 0 No error.
  • 1 An error occurred.
Array.MultiThe new SMultiline, which is the result of the comparison. Each point of the output SMultiline has an associated value , which is the distance found between the two vertices, or undefined if this distance could not be computed or is not relevant.
Array.ReportDataThe new SReportData, which contains the view set with the inspected component.
Parameters
[in]iMeasuredMultiSMultiline considered as the measured object to project on this
[in]DistMaxignore point having a distance greater than this one.
[in]ProjectionDirthe direction of the 2D comparison (requires both polylines in a same plane)
[in]MappingObject1 means color mapping is done on 'this', else 2 the color mapping is done on iMeasuredMulti.
[in]IgnoreEdgeWhat should be done with points on edges ?
  • false Project all points.
  • true Ignore points having their projection on edge.
[in]PtToPtWARNING: if true the two SMultilines MUST have the same point number. Project each point on it corresponding point.
[in]InPlanetrue if the inspection can be done in a plane, so the result can be signed

◆ ComputeNeutralAxis [1/2]

static Array SMultiline::ComputeNeutralAxis ( SComp  iTubularShape,
SComp  iHelpLine,
Boolean  iIsCircle,
Number  iApproxDiameter,
Number  iApproxWidth,
Number  iApproxLength,
SVector  iDirection,
Number  iCalculationAccuracy,
Boolean  iDetectAbsurdPoints,
Number  iSmoothNeutralAxis,
Boolean  iReconstructPipe 
)
staticslot

This function is used to compute the neutral axis of a SCloud or SPoly or surfacic SShape.

Note
You need a valid AEC license to access this feature.
Return values
Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 Nothing computed
MultiThe smoothed neutral axis
CompThe reconstructed pipe
Deprecated:
This function is deprecated, use the other version of ComputeNeutralAxis
Parameters
[in]iTubularShapeThe SCloud, SPoly or surfacic SShape on which the neutral axis is computed
[in]iHelpLineHelp line (SMultiLine, linear SShape) used to create sections on object to compute neutral axis, if null, then it is automatically computed
[in]iIsCircleTrue : Circle, false : SquareSlot
[in]iApproxDiameterEstimation of the diameter of the circle. if <= 0.0 the diameter is automatically computed
[in]iApproxWidthEstimation of the width of the square slot. if <= 0.0 the width is automatically computed
[in]iApproxLengthEstimation of the length of the square slot. if <= 0.0 the length is automatically computed
[in]iDirectionEstimation of the direction of the length of the square slot. if nullptr the direction is automatically computed
[in]iCalculationAccuracyNumber of section along the polyline between 10 - 500
[in]iDetectAbsurdPointsTrue : allow detection of absurd points on the tubular shape
[in]iSmoothNeutralAxisThe smoothing value between 0 - 15
[in]iReconstructPipeTrue : Pipe will be reconstructed according to the computed neutral axis

◆ ComputeNeutralAxis [2/2]

static Array SMultiline::ComputeNeutralAxis ( SComp  iTubularShape,
SComp  iHelpLine,
Boolean  iIsCircle,
Number  iApproxDiameter,
Number  iApproxWidth,
Number  iApproxLength,
SVector  iDirection,
Number  iCalculationAccuracy,
Number  iSmoothNeutralAxis,
Boolean  iReconstructPipe 
)
staticslot

This function is used to compute the neutral axis of a SCloud or SPoly or surfacic SShape.

Note
You need a valid AEC license to access this feature.
Return values
Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 Nothing computed
MultiThe smoothed neutral axis
CompThe reconstructed pipe
Parameters
[in]iTubularShapeThe SCloud, SPoly or surfacic SShape on which the neutral axis is computed
[in]iHelpLineHelp line (SMultiLine, linear SShape) used to create sections on object to compute neutral axis, if null, then it is automatically computed
[in]iIsCircleTrue : Circle, false : SquareSlot
[in]iApproxDiameterEstimation of the diameter of the circle. if <= 0.0 the diameter is automatically computed
[in]iApproxWidthEstimation of the width of the square slot. if <= 0.0 the width is automatically computed
[in]iApproxLengthEstimation of the length of the square slot. if <= 0.0 the length is automatically computed
[in]iDirectionEstimation of the direction of the length of the square slot. if nullptr the direction is automatically computed
[in]iCalculationAccuracyNumber of section along the polyline between 10 - 500
[in]iSmoothNeutralAxisThe smoothing value between 0 - 15
[in]iReconstructPipeTrue : Pipe will be reconstructed according to the computed neutral axis

◆ CurvedJunction

static Array SMultiline::CurvedJunction ( SMultiline  iFirstMultiline,
SMultiline  iSecondMultiline,
Number  nPoints,
Boolean  makePlanarJunction,
Boolean  chainWithInput 
)
staticslot

Creates a curved junction between two SMultiline.
.

Note
Which extremity of the polylines should be joined are automatically identified as the 2 points which are the closest from each other among the 4 possibilities.
See also
SMultiLine::Chain
Return values
Array.ErrorCodeThe error code:
  • 0: No error.
  • 1: An error occurred.
Array.MultiThe result SMultiline, else if an error occured, returns an empty Array
Parameters
[in]iFirstMultilineThe first SMultiline to join
[in]iSecondMultilineThe second SMultiline to join
[in]nPointsthe number of points that should be created on the junction
[in]makePlanarJunctionshould the junction be planar?
[in]chainWithInputshould the result SMultiline be chained with the input multilines?

◆ Cut

static Array SMultiline::Cut ( SMultiline  TheSelEdge,
SPoint  iPoint 
)
staticslot

Cut all the SMultiline by creating new segments between nearest SMultiline extremities.
.

Return values
Array.ErrorCodeThe error code:
  • 0: No error.
  • 1: An error occurred.
Array.MultiTblA SMultiline table with all resulting polylines

◆ FromClick

static Array SMultiline::FromClick ( )
inlinestaticslot

Launches a click interaction to select a 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.Multithe SMultiline selected

◆ FromFile

Array SMultiline::FromFile ( String  FileName)
slot

Function to import a SMultiline, and create new SMultilines from a file. Authorized file extensions : .asc, .mli

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 = SMultiline.FromFile( 'C:/Multi.asc' ); // Valid syntax\n
var res2 = SMultiline.FromFile( 'C:\\Multi.asc' ); // Valid syntax\n
var res3 = SMultiline.FromFile( 'C:\Multi.asc' ); // Invalid syntax
Class to store a multiline, that is: an ordered list of points. The SMultiline creation can be done b...
Definition: SMultiLine.h:24
Array FromFile(String FileName)
Return values
Array.ErrorCodeThe error code:
  • 0 No error occurred.
  • 1 An error occurred.
Array.MultiTblThe loaded SMultiline array
Parameters
[in]FileNameThe file name path

◆ FromName

static Array SMultiline::FromName ( String  Name)
inlinestaticslot

Search all the component with the given name.

Return values
Arrayall the SMultiline with the given name

◆ FromSel

static Array SMultiline::FromSel ( )
staticslot

To get all the selected SComp.

Return values
Arrayall the SMultiline selected

◆ GetArea

Number SMultiline::GetArea ( SVector  ProjDir)
slot

Computes the area of a closed SMultiline projected with a direction.

Note
If the contour has auto-intersections (along the direction). The value returned is the sum of the loops turning in the trigo way minus the sum of the loops turning clockwise.
See also
GetNormal, GetBoundingBox, GetLength, GetCentroidLinear
Return values
>0The contour turns in the trigo way
0The SMultiline is not closed.
<0The contour turns clockwise.
Deprecated:
This function is deprecated, use MultilineArea instead.
Parameters
[in]ProjDirProjection direction

◆ GetAutoIntersections

Array SMultiline::GetAutoIntersections ( Number  iLenghtTol)
slot

Check whether a multiline contains autointersections.

Return values
Array.ErrorCodeThe error code
  • 0 Success
  • 1 Failed
Array.PointTblthe list of points at autointersection
Parameters
[in]iLenghtTolthe tolerance to detect autointersections. An intersection is detected when the lines have their bounding boxes intersecting and their distances less than iLengthTol

◆ GetCentroidLinear

SPoint SMultiline::GetCentroidLinear ( )
slot

Returns the barycenter of the current line considering the line having a constant linear density all along the polyline.

Note
If the SMultiline is not closed, the function returns the length of the SMultiline
If the SMultiline has no point the point returned is on the origin (0, 0, 0).

◆ GetColorGradient

Array SMultiline::GetColorGradient ( )
inlineslot

To get the color gradient of the SMultiline.

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

◆ GetDeviation

Array SMultiline::GetDeviation ( Number  iIndex)
slot
Return values
Returnsdeviation of the point
If no deviation is stored in the cloud GetDeviation will return an UndefinedValue
Parameters
[in]iIndexindex of the point for which the deviation value will be returned

◆ GetDeviations

Array SMultiline::GetDeviations ( )
slot

return all deviation values of the multiline

Return values
Array.ErrorCodeThe error code.
  • 0 Success
  • 1 Failed
Array.ValueTblThe deviation values

◆ GetLength

Number SMultiline::GetLength ( )
slot
Returns
The length of the current 3D SMultiline.
Note
If the SMultiline is closed, the function returns the perimeter of the SMultiline.

◆ GetNormal

Array SMultiline::GetNormal ( )
slot

Calculates the normal plane of the current SMultiline.

Return values
Array.ErrorCodeThe error code:
  • 0 OK, the SMultiline is a plane
  • 1 The SMultiline is not a plane but the best plane has been calculated.
  • 2 Nothing could be calculated.
Array.VectorThe normal of the SMultiline.
Array.PointA point on the plane.

◆ GetNumber

Number SMultiline::GetNumber ( )
slot
Returns
The number of vertices inside the SMultiline

◆ GetPoint

SPoint SMultiline::GetPoint ( unsigned  Index)
slot
Returns
The point coordinates at position "Index"; 0<= Index < Number

◆ GetPointAtDistance

Array SMultiline::GetPointAtDistance ( Number  DistanceToOrigin,
Boolean  InterpolateOnSegments 
)
slot

Returns the point at a given distance on the current SMultiline.

Return values
Array.ErrorCodeThe error code:
  • 0 the input distance is valid.
  • 1 Error: the input distance is greater than the current SMultiline length.
  • 2 Error: An error occurred during the computation.
Array.PointThe point on the current SMultiline at the expected distance.
Array.VectorThe tangent of the SMultiline at the expected distance.
Parameters
[in]DistanceToOriginthe distance from the origin of the SMultiline
[in]InterpolateOnSegmentsInterpolate the tangent on segments. If false, the tangent of a segment will be its direction

◆ InsertFirst

Array SMultiline::InsertFirst ( SPoint  iPointToCopy,
Number  AbsoluteAccuracy 
)
slot

A point is added at the END of the multiline.

Return values
Array.ErrorCodeThe error code:
  • 0 Point has been inserted.
  • 1 Point already exist (not inserted).
See also
InsertLast
Parameters
[in]iPointToCopyThe point to add at the beginning of the multiline.
[in]AbsoluteAccuracyThe comparison's "equality" accuracy. Two points are considered as equal if their distance is less than this value. If Accuracy, the comparison value is by 1.e-5.

◆ InsertLast

Array SMultiline::InsertLast ( SPoint  iPointToCopy,
Number  AbsoluteAccuracy 
)
slot

A point is added at the END of the multiline.

Return values
Array.ErrorCodeThe error code:
  • 0 Point has been inserted.
  • 1 Point already exist (not inserted).
See also
InsertFirst
Parameters
[in]iPointToCopyThe point to add at the end of the multiline.
[in]AbsoluteAccuracyThe comparison's "equality" accuracy. Two points are considered as equal if their distance is less than this value. If Accuracy, the comparison value is by 1.e-5.

◆ IntersectionWithMesh

Array SMultiline::IntersectionWithMesh ( SPoly  iPoly)
slot

Calculate intersections with 1 poly.

Return values
Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 An error occurred.
Array.PointTblan array containing the intersection points (SPoint).
Parameters
[in]iPolythe poly to calculate intersections with

◆ IntersectionWithOtherPlanarMulti

Array SMultiline::IntersectionWithOtherPlanarMulti ( SMultiline  iMulti)
slot

Calculate intersections between 2 planar multilines.

Return values
Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 An error occurred.
Array.PointTblan array containing the intersection points (SPoint).
Parameters
[in]iMultithe multi to calculate intersections with

◆ IntersectionWithPlane

Array SMultiline::IntersectionWithPlane ( SPlane  iPlane)
slot

Calculate intersection with 1 plane.

Return values
Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 An error occurred.
Array.PointTblan array containing the intersection points (SPoint).
Parameters
[in]iPlanethe plane to calculate intersections with

◆ IsClosed

Boolean SMultiline::IsClosed ( )
slot
Returns
TRUE if the SMultiLine is closed

◆ IsPlanar

Boolean SMultiline::IsPlanar ( )
slot
Returns
TRUE if the SMultiLine is planar

◆ LoadColorGradient

Array SMultiline::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 SMultiline
Parameters
FilePathThe complete file path to load from

◆ MedianLine

static Array SMultiline::MedianLine ( Array< SMultiline TableMulti,
Number  NbPt 
)
staticslot

To compute the median line between two lines.

Return values
Array.ErrorCodeThe error code:
  • 0: No error, the median line is compute..
  • 1: An error occurred. One of the input line has less than 2 points, or length is inferior to AbsoluteAccuracyGet().
Array.MultiThe computed median line if ErrorCode is 0.
Parameters
TableMultiTable of multilines
NbPtNumber of point of the final median line
  • 0 or 1 means all points of the multilines are used to compute the median line

◆ MultilineArea

Array SMultiline::MultilineArea ( SVector  iProjDir)
slot

Computes the area of a closed SMultiline projected with a direction.

See also
GetNormal, GetBoundingBox, GetLength, GetCentroidLinear
Return values
Array.ErrorCodeThe error code:
  • 0 Success.
  • 1 Multiline is empty.
  • 2 Multiline not closed.
  • 3 Projection direction is invalid.
  • 4 An error occurred.
Array.SurfaceThe area of the multiline.
Array.ValueThe direction of the multiline.
  • < 0 The multiline turns clockwise.
  • 0 The multiline turns in the trigo way and clockwise in an equivalent way.
  • > 0 The multiline turns in the trigo way.

◆ MultilinesIntersections

static Array SMultiline::MultilinesIntersections ( Array< SMultiline TableMulti,
Number  DesiredAccuracy 
)
staticslot

Function to compute the set of intersections between an arbitrary number of Multilines.

Return values
Array.ErrorCode
  • 0: No error,
  • 1 An error occurred.
Array.IntersectionTblTable of point containing the intersection points.
Parameters
TableMultiCollection of SMultiline between which the intersections are computed.
DesiredAccuracyDistance under which two segments are considered intersecting.

◆ New [1/2]

static SMultiline SMultiline::New ( )
staticslot

Default constructor to create an empty new SMultiline.

◆ New [2/2]

static SMultiline SMultiline::New ( SMultiline  iOther)
staticslot

Constructs an SMultiline by copying the SMultiline Other.

◆ Offset

Array SMultiline::Offset ( SVector  Direction,
Number  DistOffset,
OffsetSideEnum  GoodSide,
SPoint  iSidePt 
)
slot

Computes the parallel contour of a SMultiline according to a direction.

Note
If the offset value is small, two solutions may exist: one solution on each side of the SMultiline. You can choose which solution must be kept using SidePt and GoodSide. If the contour is closed, one solution is inside and the other one is outside. However if the offset value is to large, the inside solution may not exist. In this case the outside solution is always returned independently of the parameters SidePt and GoodSide.
Return values
Array.ErrorCodeThe error code
  • 0 No error.
  • 1 An error occurred.
Array.MultiThe resulting offset contour.
Parameters
[in]DirectionThe offset is computed in the plane normal to this vector. This means that each point of the SMultiline is moved in a direction normal to this vector. If 0, the plane is assumed to be the best plane of the current SMultiline.
[in]DistOffsetThe offset distance
[in]GoodSideTo know which offset side is ? OTHER_SIDE: The side where SidePt is not. SAME_SIDE: The side where SidePt is.
[in]iSidePta point to know the side of the offset.

◆ Proj3D

Array SMultiline::Proj3D ( SPoint  iPoint)
slot

Search the closest 3D projection of a 3D Point this MultiLine. The projection can occur on a segment or a vertex.

Return values
Array.ErrorCodeThe error code.
  • 0 Success: a point could be found
  • 1 Failed to find a point
Array.IndexThe index number (0 <= index < Number) of the closest segment or point.
  • If projection occurs on a segment, the point found is between point index and index+1.
Array.PointReturn here the projected point found.
See also
SMultiline.ClosestPoint(), SMultiline.ProjDir()
Parameters
[in]iPointThe point to project.

◆ ProjDir

Array SMultiline::ProjDir ( SPoint  iThePnt,
SVector  ProjDir,
Number  Aperture 
)
slot

Search the closest projection along a direction on this MultiLine. The projection can occur on a segment or a vertex.

Return values
Array.ErrorCodeThe error code.
  • 0 Success: a point could be found
  • 1 Failed to find a point
Array.IndexThe index number (0 <= index < Number) of the closest segment or point.
  • If projection occurs on a segment, the point found is between point index and index+1.
  • If Aperture is not zero, -1 can be returned if no point is valid.
Array.PointReturn here the projected point found.
See also
SMultiline.ClosestPoint(), SMultiline.Proj3D()
Parameters
[in]iThePntThe point to project.
[in]ProjDirprojection direction
[in]Aperturethe aperture distance. Significant only if computation occurs in a plane.
Points are valid only if they are inside a cylinder of axis defined by ThePnt and ProjDir and a radius equal by this value.

◆ Reduce

Array SMultiline::Reduce ( unsigned  NbPoint,
Number  MaxDeviation,
Boolean  OptimizePosition 
)
slot

Reduces the current SMultiline to have a certain number of points while keeping the best points.

Return values
Array.ErrorCodeThe error code:
  • 0: No error.
  • 1: An error occurred.
Parameters
[in]NbPointNumber of points to get after reducing if input is 0, only the max deviation criterion is taken into account
[in]MaxDeviationThe maximum deviation allowed. If very high, there is no chance that this criterion is taken into account when reducing (default behavior)
[in]OptimizePositionIf true, optimization of points positions. Else reduce the line using existing points.

◆ RepairAutoIntersections

Array SMultiline::RepairAutoIntersections ( Number  iLengthTol,
Number  iLoopMaxLength = -1,
RepairAutoIntersectionPolicyEnum  iPolicy 
)
slot

Repair the autointersections if there were by suppressing the smallest loop bounded by autointersection point.

Return values
Array.ErrorCodeThe error code
  • 0 Success
  • 1 Failed
Array.Value
  • the number of suppressed loops used to suppress them.
Array.Multithe repaired multiline.
Parameters
[in]iLoopMaxLengththe tolerance to detect autointersections. An intersection is detected when the lines have their bounding boxes intersecting and their distances less than iLengthTol [in] the maximal length of the loop which can be suppressed (-1 means 1/4 of the perimeter of the multiline)
[in]iPolicypolicy to suppress the loops between autointersections (SUPPRESS_SMALL_LOOPS_FIRST is the default policy).

◆ Reverse

SMultiline::Reverse ( )
slot

Reverse the current multiline.

◆ RightAngle

Array SMultiline::RightAngle ( Number  Threshold)
slot

Modifies the vertex of the SMultiline in order to get Right angles on the SMultiline.

Note
a threshold < 45 degrees is required
Return values
Array.ErrorCodeThe error code:
  • -1: Wrong parameters or an error occurred.
  • 0: OK, all angles in the threshold could be made to 90 degrees.
Parameters
ThresholdThreshold in degrees under which an angle is modified

◆ Save

Array SMultiline::Save ( String  FilePath,
SMatrix  CoordinateSystemMatrix = {} 
)
slot

Saves the Multiline into a file.

Supported extensions :

  • .igs : IGES format
  • .asc : Ascii XYZ 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 = TheMulti.Save( 'C:/Multi.asc' ); // Valid syntax\n
var res2 = TheMulti.Save( 'C:\\\\Multi.asc' ); // Valid syntax\n
var res3 = TheMulti.Save( 'C:\\Multi.asc' ); // Invalid syntax
Return values
Array.ErrorCodeThe error code.
  • 0 : No error.
  • 1 : An error occured.
Array.IsDemoVersionIndicates if this is a demonstration version or not
Parameters
FilePathThe complete file path to save into
CoordinateSystemMatrixthe matrix to define a UCS used for the export (or identity to use the WCS)

◆ SaveColorGradient

Array SMultiline::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 SMultiline
  • 2 An error occurred
Array.IsDemoVersionIndicates if this is a demonstration version or not
Parameters
FilePathThe complete file path to save into

◆ SetLineWidth

SMultiline::SetLineWidth ( Number  width)
slot

Change the thickness of the line.

Note
the value must upper to 0, else 1 is set
Parameters
widthThe width to set

◆ SetMultilineRepresentation

SMultiline::SetMultilineRepresentation ( MultilineRepresentationTypeEnum  Representation)
slot

The representation of the component is modified.

Parameters
[in]RepresentationThe multiline representation type

◆ ShowName

SMultiline::ShowName ( Boolean  iShowName)
slot

Control whether the name of the multiline is shown or not in the scene.

Parameters
[in]iShowNamethe new visibility state of the multiline

◆ Smooth

Array SMultiline::Smooth ( Number  Para1,
Number  SmoothIntens,
SmoothEnum  SmoothingType,
Number  MaxiDeviation 
)
slot

Recalculates new vertices to smooth the current SMultiLine.

Return values
Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 An error occurred.
Parameters
[in]Para1This parameter has two meaning depending on the value of SmoothingType
  • If SmoothingType=SMOOTH_TYPE1 or SMOOTH_TYPE2
    This parameter is tunning whether the smoothing is local or global. The value should be between 0 and 1. We advice you to take always 1.
  • If SmoothingType=SMOOTH_BSPLINE
    This parameter is the number of points that the line should have after B-spline re-sampling. If less that 2, taking the same number as input polyline.
[in]SmoothIntensThe smoothing intensity. Should be between 1 and 20.
[in]SmoothingTypeFilter type
  • SMOOTH_TYPE1: order 1 filter. Very smooth filter. The small radii are becoming greater. Smoothing an opened SMultiLine with a very high SmoothIntens will converge to a straight segment between first and last point. Smoothing a closed SMultiLine with a very high SmoothIntens will converge to a point, which is the gravity center of the SMultiLine.
  • SMOOTH_TYPE2: order 2 filter. More complex filter based on first derivative that allows to limit as much as possible increasing the radii. Smoothing an opened SMultiLine with a very high SmoothIntens will NOT converge to a straight segment. Smoothing a closed SMultiLine with a very high SmoothIntens will NOT converge to a point.
  • SMOOTH_BSPLINE: B-spline smoothing.
[in]MaxiDeviationMaximum deviation if smoothing type SMOOTH_TYPE1 or SMOOTH_TYPE2 is selected. If not null, the distance between the vertices before and after smoothing must not exceed this value (after all the smoothing loops). If SmoothingType, this parameter is not used.

◆ SuppressSmallLines

Array SMultiline::SuppressSmallLines ( Number  iLengthTol)
slot

Define a multiline suppressing the lines which have a length smaller than a tolerance length.

Return values
Array.ErrorCodeThe error code
  • 0 Success
  • 1 Failed
Array.Value
  • The number of suppressed segments.
Array.MultiThe repaired multiline.
Parameters
[in]iLengthToliLengthTol The tolerance length defines the maximum length a segment can have to be suppressed.

◆ toString [1/2]

String SMultiline::toString ( )
slot

Get the type of the variable.

◆ toString [2/2]

static String SMultiline::toString ( )
staticslot

Get the type of the variable.