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

Line manipulation class. The SLine creation can be done by calling the static functions:
. More...

Inheritance diagram for SLine:
SFeature SComp SObject

Public Slots

static Array All (Number VisCrit)
 To get all the SComp in the document. More...
 
Array BestRevolutionAxis (SComp iSelComp)
 Compute the best revolution axis of a cloud or mesh (using an initial axis necessary to find the best one) More...
 
Array Discretize (Number deflection, Number meanPointDistance)
 To convert the continuous feature into a discretized SMultiline. To use the deflection, put a positive value and set -1 to meanPointDistance To use the mean distance between points, put a positive value and set 0 to deflection To use default value, set 0 in deflection or meanPointDistance. More...
 
Number Distance (SPoint iPoint)
 Returns the distance between a point and the feature <0 if below/inside the feature >0 if above/outside the feature. 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...
 
SPoint GetFirstPoint ()
 Returns the first point of the feature. More...
 
SPoint GetLastPoint ()
 Returns the second point of the feature. More...
 
Number GetLength ()
 Returns the length. More...
 
Number GetPerimeter ()
 Returns the perimeter of the feature. More...
 
Array IntersectionBetween2Lines (SLine iSecondLine)
 Calculate intersection with another line. More...
 
static SLine New ()
 Default constructor to create an empty new SLine. More...
 
static SLine New (SLine Other)
 Constructs an SLine by copying Other. More...
 
static SLine New (SPoint Center, SVector Normal, Number Length)
 Constructs a new SLine by defining its data. More...
 
static SLine New (SPoint Point1, SPoint Point2)
 Constructs a new SLine by 2 points. More...
 
 SetLength (Number iLength)
 Setter for the 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 SFeature
static Array All (Number VisCrit)
 To get all the SComp in the document. More...
 
Array Compare (SCloud iMeasCloud, Number DistMax, Number MappingObject, Number maxCosAngle=-2)
 Calculates the distances between 2 components for further inspection purpose (color mapping) More...
 
static Array FromBfcFile (String iFilePath)
 To load a .bfc file. 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...
 
SPoint GetCenter ()
 
SVector GetNormal ()
 
 SetCenter (SPoint iCenter)
 To set a new center to the SFeature. More...
 
 SetNormal (SVector Normal)
 To set a new normal to the SFeature. 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...
 

Additional Inherited Members

- 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...
 

Detailed Description

Line manipulation class. The SLine creation can be done by calling the static functions:
.

  • New() to create your own empty SLine.
  • New() to copy an existing SLine.
  • New() to create a new SLine by defining its center, normal and length.
  • New() to create a new SLine by defining its two extremities.
    var center = SPoint.New(1, 1, 2);
    var normal = SVector.New(0, 1, 0);
    var length = 12;
    var firstPt = SPoint.New(-1, -1, -1);
    var secondPt = SPoint.New(1, 1, 1);
    var emptyLine = SLine.New();
    var myLine = SLine.New(center, normal, length);
    var myLineCopy = SLine.New(myLine);
    var myLine2 = SLine.New(firstPt, secondPt);

Member Function Documentation

◆ All

static Array SLine::All ( Number  VisCrit)
inlinestaticslot

To get all the SComp in the document.

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

◆ BestRevolutionAxis

Array SLine::BestRevolutionAxis ( SComp  iSelComp)
slot

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

◆ Discretize

Array SLine::Discretize ( Number  deflection,
Number  meanPointDistance 
)
slot

To convert the continuous feature into a discretized SMultiline. To use the deflection, put a positive value and set -1 to meanPointDistance To use the mean distance between points, put a positive value and set 0 to deflection To use default value, set 0 in deflection or meanPointDistance.

Return values
Array.ErrorCodeThe error code:
  • 0: No error
  • 1: An error occurred
Array.MultiThe discretized SMultiline
Parameters
[in]deflectionmax deviation between the ideal shape and the discretized element
[in]meanPointDistanceMean distance between points/vertices

◆ Distance

Number SLine::Distance ( SPoint  iPoint)
slot

Returns the distance between a point and the feature <0 if below/inside the feature >0 if above/outside the feature.

Parameters
[in]iPointthe point from which the distance to the feature has to be calculated

◆ FromClick

static Array SLine::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.Linethe SLine selected

◆ FromName

static Array SLine::FromName ( String  Name)
inlinestaticslot

Search all the component with the given name.

Return values
Arrayall the SLine with the given name

◆ FromSel

static Array SLine::FromSel ( )
inlinestaticslot

To get all the selected SComp.

Return values
Arrayall the SLine selected

◆ GetFirstPoint

SPoint SLine::GetFirstPoint ( )
slot

Returns the first point of the feature.

◆ GetLastPoint

SPoint SLine::GetLastPoint ( )
slot

Returns the second point of the feature.

◆ GetLength

Number SLine::GetLength ( )
slot

Returns the length.

◆ GetPerimeter

Number SLine::GetPerimeter ( )
slot

Returns the perimeter of the feature.

◆ IntersectionBetween2Lines

Array SLine::IntersectionBetween2Lines ( SLine  iSecondLine)
slot

Calculate intersection with another line.

Return values
Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 An error occurred.
Array.PointThe intersection point or the nearest point from the two lines (SPoint).
Parameters
[in]iSecondLinethe second line to calculate intersection with

◆ New [1/4]

static SLine SLine::New ( )
staticslot

Default constructor to create an empty new SLine.

◆ New [2/4]

static SLine SLine::New ( SLine  Other)
staticslot

Constructs an SLine by copying Other.

◆ New [3/4]

static SLine SLine::New ( SPoint  Center,
SVector  Normal,
Number  Length 
)
staticslot

Constructs a new SLine by defining its data.

Parameters
[in]CenterThe SLine center
[in]NormalThe SLine normal
[in]LengthThe SLine length

◆ New [4/4]

static SLine SLine::New ( SPoint  Point1,
SPoint  Point2 
)
staticslot

Constructs 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
[in]Point11st extremity of the line
[in]Point22nd extremity of the line

◆ SetLength

SLine::SetLength ( Number  iLength)
slot

Setter for the length.

◆ toString [1/2]

String SLine::toString ( )
slot

Get the type of the variable.

◆ toString [2/2]

static String SLine::toString ( )
staticslot

Get the type of the variable.