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

Provide line edition and creation methods. More...

Inheritance diagram for SLine:
SFeature SComp

Public Member Functions

Object BestRevolutionAxis (SComp selComp)
 Compute the best revolution axis of a cloud or mesh (using an initial axis necessary to find the best one) More...
 
Object Discretize (number deflection=0, number meanPointDistance=0)
 Convert the line into a discretized SMultiline.Only one parameter must be specified at a time:To use the deflection, set a positive value and set 0 to meanPointDistance.To use the mean distance between points, set a positive value and set 0 to deflection. More...
 
number Distance (SPoint point)
 Return the distance between a point and the line. More...
 
SPoint GetFirstPoint ()
 Return the first point of the line. More...
 
SPoint GetLastPoint ()
 Return the last point of the line. More...
 
number GetLength ()
 Return the length of the line. More...
 
number GetPerimeter ()
 Return the perimeter of the line. More...
 
Object IntersectionBetween2Lines (SLine secondLine)
 Calculate the intersection with another line. More...
 
 SetLength (number length)
 Set the length. More...
 
 SLine ()
 Default constructor to create an empty new SLine. More...
 
 SLine (SLine other)
 Construct a SLine by copying another SLine. More...
 
 SLine (SPoint center, SVector normal, number length)
 Construct a new SLine from a given point, normal direction and length. More...
 
 SLine (SPoint point1, SPoint point2)
 Construct a new SLine by 2 points. More...
 
string toString ()
 Get the type of the variable. More...
 
- Public Member Functions inherited from SFeature
Object Compare (SCloud measCloud, number distMax, number mappingObject=1, number maxCosAngle=-2)
 Calculate the distances between 2 components for further inspection purpose (color mapping) More...
 
SPoint GetCenter ()
 Return the center of the feature. More...
 
SVector GetNormal ()
 Return the normal of the feature. More...
 
 SetCenter (SPoint center)
 Set the center. More...
 
 SetNormal (SVector normal)
 Set the normal. More...
 
string toString ()
 Get the type of the variable. More...
 
- Public Member Functions inherited from SComp
 AddToDoc ()
 Add the object to the document. More...
 
 ApplyTransformation (SMatrix matrix)
 Apply a geometric transformation to the current object by making a product with the given matrix. More...
 
Object GetBoundingBox ()
 Calculate the bounding box of the object. More...
 
Object GetColors ()
 Get the colors of the object. More...
 
string GetFolderName ()
 Get the name of the folder containing the object. More...
 
string GetName ()
 Return the object's name. More...
 
string GetPath ()
 Return the full path of a SComp in the tree. More...
 
 Invert ()
 Invert the normal of the object. More...
 
boolean IsInDoc ()
 Return if the object is in the document or not. More...
 
boolean IsVisible ()
 Get the visibility of the object. More...
 
 MoveToGroup (string groupPath, boolean moveInsideTopParent=true)
 Move the object to the document group represent by the given path. If some groups, in the path, don't exist, they will be created. More...
 
 RemoveFromDoc ()
 Remove the object from the document. More...
 
 SetClippable (boolean clipping)
 Set clippable or not. More...
 
 SetColors (number red, number green, number blue)
 Set the colors of the object. More...
 
 SetName (string objectName)
 Set the object's name. More...
 
 SetTransparency (number alpha)
 Set the transparency of the object. More...
 
 SetVisibility (boolean visible)
 Set the object to be visible, or not visible. More...
 
string toString ()
 Get the type of the variable. More...
 
 Translate (SVector vector)
 Make a translation of the current object with an SVector. More...
 

Static Public Member Functions

static Array< SLineAll (VisibilityEnum visCrit=SComp.ANY_VISIBILITY)
 Get all the SLine in the document. More...
 
static Object FromClick ()
 Launch an interaction to select a SLine in the scene. More...
 
static Array< SLineFromName (string name)
 Search all the SLine with the given name. More...
 
static Array< SLineFromSel ()
 Get all the selected SLine. More...
 
static SLine New ()
 Default constructor to create an empty new SLine. More...
 
static SLine New (SLine other)
 Construct a SLine by copying another SLine. More...
 
static SLine New (SPoint center, SVector normal, number length)
 Construct a new SLine from a given point, normal direction and length. More...
 
static SLine New (SPoint point1, SPoint point2)
 Construct a new SLine by 2 points. More...
 
- Static Public Member Functions inherited from SFeature
static Array< SFeatureAll (VisibilityEnum visCrit=SComp.ANY_VISIBILITY)
 Get all the SFeature in the document. More...
 
static Object FromBfcFile (string filePath)
 Load a .bfc file. More...
 
static Object FromClick ()
 Launch an interaction to select a SFeature in the scene. More...
 
static Array< SFeatureFromName (string name)
 Search all the SFeature with the given name. More...
 
static Array< SFeatureFromSel ()
 Get all the selected SFeature. More...
 
- Static Public Member Functions inherited from SComp
static Array< SCompAll (VisibilityEnum visCrit=SComp.ANY_VISIBILITY)
 Get all the SComp in the document. More...
 
static Object FromClick ()
 Launch an interaction to select a SComp in the scene. More...
 
static Array< SCompFromName (string name)
 Search all the SComp with the given name. More...
 
static Array< SCompFromSel ()
 Get all the selected SComp. More...
 

Additional Inherited Members

- Public Types inherited from SComp
enum  VisibilityEnum { HIDDEN_ONLY = 0 , VISIBLE_ONLY = 1 , ANY_VISIBILITY = 2 }
 Visible criteria. More...
 

Detailed Description

Provide line edition and creation methods.

Constructor & Destructor Documentation

◆ SLine() [1/4]

SLine::SLine ( )

Default constructor to create an empty new SLine.

◆ SLine() [2/4]

SLine::SLine ( SLine  other)

Construct a SLine by copying another SLine.

Parameters
other(SLine) The SLine to copy

◆ SLine() [3/4]

SLine::SLine ( SPoint  center,
SVector  normal,
number  length 
)

Construct a new SLine from a given point, normal direction and length.

Parameters
center(SPoint) Line center
normal(SVector) Line normal
length(number) Line length

◆ SLine() [4/4]

SLine::SLine ( SPoint  point1,
SPoint  point2 
)

Construct a new SLine by 2 points.

Note
The 2 points must be not identical.If you want to construct a line with more than 2 points, use SCloud.BestLine().
Parameters
point1(SPoint) First extremity of the line
point2(SPoint) Second extremity of the line

Member Function Documentation

◆ All()

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

Get all the SLine in the document.

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

◆ BestRevolutionAxis()

Object SLine::BestRevolutionAxis ( SComp  selComp)

Compute the best revolution axis of a cloud or mesh (using an initial axis necessary to find the best one)

Parameters
selComp(SComp) The cloud or mesh on which we must compute the best revolution axis
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Line(SLine) The best revolution axis

◆ Discretize()

Object SLine::Discretize ( number  deflection = 0,
number  meanPointDistance = 0 
)

Convert the line into a discretized SMultiline.Only one parameter must be specified at a time:To use the deflection, set a positive value and set 0 to meanPointDistance.To use the mean distance between points, set a positive value and set 0 to deflection.

Parameters
deflection(number) Max deviation between the ideal shape and the discretized element
meanPointDistance(number) Mean distance between points/vertices
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Multi(SMultiline) The discretized SMultiline

◆ Distance()

number SLine::Distance ( SPoint  point)

Return the distance between a point and the line.

Parameters
point(SPoint) The point from which the distance to the feature has to be calculated
Return values
<0Below/inside the feature
>0Above/outside the feature

◆ FromClick()

static Object SLine::FromClick ( )
static

Launch an interaction to select a SLine in the scene.

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

◆ FromName()

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

Search all the SLine with the given name.

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

◆ FromSel()

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

Get all the selected SLine.

Returns
(Array<SLine>) All the selected SLine

◆ GetFirstPoint()

SPoint SLine::GetFirstPoint ( )

Return the first point of the line.

Returns
(SPoint) The first point of the line

◆ GetLastPoint()

SPoint SLine::GetLastPoint ( )

Return the last point of the line.

Returns
(SPoint) The last point of the line

◆ GetLength()

number SLine::GetLength ( )

Return the length of the line.

Returns
(number) The length of the line

◆ GetPerimeter()

number SLine::GetPerimeter ( )

Return the perimeter of the line.

Returns
(number) The perimeter of the line

◆ IntersectionBetween2Lines()

Object SLine::IntersectionBetween2Lines ( SLine  secondLine)

Calculate the intersection with another line.

Parameters
secondLine(SLine) The second line to calculate intersection with
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Point(SPoint) The intersection point or the nearest point from the two lines

◆ New() [1/4]

static SLine SLine::New ( )
static

Default constructor to create an empty new SLine.

Returns
(SLine) The new SLine.

◆ New() [2/4]

static SLine SLine::New ( SLine  other)
static

Construct a SLine by copying another SLine.

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

◆ New() [3/4]

static SLine SLine::New ( SPoint  center,
SVector  normal,
number  length 
)
static

Construct a new SLine from a given point, normal direction and length.

Parameters
center(SPoint) Line center
normal(SVector) Line normal
length(number) Line length
Returns
(SLine) The new SLine.

◆ New() [4/4]

static SLine SLine::New ( SPoint  point1,
SPoint  point2 
)
static

Construct a new SLine by 2 points.

Note
The 2 points must be not identical.If you want to construct a line with more than 2 points, use SCloud.BestLine().
Parameters
point1(SPoint) First extremity of the line
point2(SPoint) Second extremity of the line
Returns
(SLine) The new SLine.

◆ SetLength()

SLine::SetLength ( number  length)

Set the length.

Parameters
length(number) The length to set

◆ toString()

string SLine::toString ( )

Get the type of the variable.

Returns
(string) The type name