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

Cone manipulation class. The SCone creation can be done by calling the static functions:
. More...

Inheritance diagram for SCone:
SFeature SComp SObject

Public Slots

static Array All (Number VisCrit)
 To get all the SComp in the document. More...
 
Array Discretize (Number deflection, Number meanPointDistance)
 To convert the continuous feature into a discretized SPoly. 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 Point)
 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...
 
Number GetAngle ()
 returns the angle of the cone in radian More...
 
Number GetAngleDegree ()
 returns the angle of the cone in degrees More...
 
SPoint GetBaseCenter ()
 returns the base center of the cone More...
 
Number GetBaseRadius ()
 returns the base radius of the cone More...
 
SCircle GetCircle (Number Height)
 returns a circle for a given height value = 0 -> Base Circle 1 -> Top Circle can be lower or upper than zero More...
 
Number GetLength ()
 returns the length of the cone More...
 
Number GetSurface ()
 Returns the surface of the cone. More...
 
SPoint GetTopCenter ()
 returns the top center of the cone More...
 
Number GetTopRadius ()
 returns the top radius of the cone More...
 
Boolean IsOuter ()
 To know if the SCone is set to be scanned from the inside or from the outside. More...
 
static SCone New ()
 Default constructor to create an empty new SCone. More...
 
static SCone New (SCone Other)
 Constructs an SCone by copying Other. More...
 
static SCone New (SPoint Center, SVector NormalDir, Number LRadius, Number SRadius, Number Length)
 Constructs a new SCone by defining its data. More...
 
static SCone New (SPoint FirstPt, SPoint SecondPt, SPoint ThirdPt, SPoint FourthPt)
 Constructs a new SCone by 4 points. More...
 
Number SetAngle (Number Angle, Boolean ModifyLength)
 modifies the angle of the cone in radian More...
 
Boolean SetBaseRadius (Number Radius)
 modifies the base radius of the cone More...
 
 SetInner ()
 To set the SCone to a cone scanned from the inside. More...
 
Boolean SetLength (Number Length)
 modifies the length of the cone More...
 
 SetOuter ()
 To set the SCone to a cone scanned from the outside. More...
 
Boolean SetTopRadius (Number Radius)
 modifies the top radius of the cone 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

Cone manipulation class. The SCone creation can be done by calling the static functions:
.

  • New() to create your own empty SCone.
  • New() to copy an existing SCone.
  • New() to create a new SCone by defining its center, normal, base and top radius and his length.
    var center = SPoint.New(1, 1, 2);
    var normal = SVector.New(0, 1, 0);
    var largeRadius = 25;
    var smallRadius = 12;
    var length = 5;
    var emptyCone = SCone.New();
    var myCone = SCone.New(center, normal, largeRadius, smallRadius, length);
    var myConeCopy = SCone.New(myCone);

Member Function Documentation

◆ All

static Array SCone::All ( Number  VisCrit)
inlinestaticslot

To get all the SComp in the document.

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

◆ Discretize

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

To convert the continuous feature into a discretized SPoly. 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.PolyThe discretized SPoly
Parameters
[in]deflectionmax deviation between the ideal shape and the discretized element
[in]meanPointDistanceMean distance between points/vertices

◆ Distance

Number SCone::Distance ( SPoint  Point)
slot

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

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

◆ FromClick

static Array SCone::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.Conethe SCone selected

◆ FromName

static Array SCone::FromName ( String  Name)
inlinestaticslot

Search all the component with the given name.

Return values
Arrayall the SCone with the given name

◆ FromSel

static Array SCone::FromSel ( )
inlinestaticslot

To get all the selected SComp.

Return values
Arrayall the SCone selected

◆ GetAngle

Number SCone::GetAngle ( )
slot

returns the angle of the cone in radian

◆ GetAngleDegree

Number SCone::GetAngleDegree ( )
slot

returns the angle of the cone in degrees

◆ GetBaseCenter

SPoint SCone::GetBaseCenter ( )
slot

returns the base center of the cone

Note
same as SFeature.GetCenter()

◆ GetBaseRadius

Number SCone::GetBaseRadius ( )
slot

returns the base radius of the cone

◆ GetCircle

SCircle SCone::GetCircle ( Number  Height)
slot

returns a circle for a given height value = 0 -> Base Circle 1 -> Top Circle can be lower or upper than zero

◆ GetLength

Number SCone::GetLength ( )
slot

returns the length of the cone

◆ GetSurface

Number SCone::GetSurface ( )
slot

Returns the surface of the cone.

◆ GetTopCenter

SPoint SCone::GetTopCenter ( )
slot

returns the top center of the cone

◆ GetTopRadius

Number SCone::GetTopRadius ( )
slot

returns the top radius of the cone

◆ IsOuter

Boolean SCone::IsOuter ( )
slot

To know if the SCone is set to be scanned from the inside or from the outside.

Return values
true: the cone was defined as being scanned from the outside
false: the cone was defined as being scanned from the inside

◆ New [1/4]

static SCone SCone::New ( )
staticslot

Default constructor to create an empty new SCone.

◆ New [2/4]

static SCone SCone::New ( SCone  Other)
staticslot

Constructs an SCone by copying Other.

◆ New [3/4]

static SCone SCone::New ( SPoint  Center,
SVector  NormalDir,
Number  LRadius,
Number  SRadius,
Number  Length 
)
staticslot

Constructs a new SCone by defining its data.

Parameters
Centercone center
NormalDircone normal axis
LRadiuscone large radius
SRadiuscone small radius
Lengthcone length

◆ New [4/4]

static SCone SCone::New ( SPoint  FirstPt,
SPoint  SecondPt,
SPoint  ThirdPt,
SPoint  FourthPt 
)
staticslot

Constructs a new SCone by 4 points.

Note
The 4 points must be not identical.
If you want to construct a cone with more than 4 points, use SCloud.BestCone().
The three first points define a base circle. The fourth point is used to calculate angle and length
Parameters
[in]FirstPtFirst point on the cone (base circle)
[in]SecondPtSecond point on the cone (base circle)
[in]ThirdPtThird point on the cone (base circle)
[in]FourthPtFourth point on the cone to calculate angle and length

◆ SetAngle

Number SCone::SetAngle ( Number  Angle,
Boolean  ModifyLength 
)
slot

modifies the angle of the cone in radian

Return values
0ok
!=0error, returns the angle set
ifModify TopRadius the angle is too big, a top radius <0 would have been calculated
ifmodify Length the two radius are the same, a infinite length would have been set
Parameters
[in]Anglethe new angle value to set
[in]ModifyLengthwhat should be changed:
  • false, the length will not be modified, the top radius will be modified
  • true, the length will be modified, the top radius will not be modified

◆ SetBaseRadius

Boolean SCone::SetBaseRadius ( Number  Radius)
slot

modifies the base radius of the cone

Return values
0ok
1error, the value was <=0, setting the base radius to 0

◆ SetInner

SCone::SetInner ( )
slot

To set the SCone to a cone scanned from the inside.

◆ SetLength

Boolean SCone::SetLength ( Number  Length)
slot

modifies the length of the cone

Return values
0ok
1error, the value was <=0, setting the length to 0

◆ SetOuter

SCone::SetOuter ( )
slot

To set the SCone to a cone scanned from the outside.

◆ SetTopRadius

Boolean SCone::SetTopRadius ( Number  Radius)
slot

modifies the top radius of the cone

Return values
0ok
1error, the value was <=0, setting the top radius to 0

◆ toString [1/2]

String SCone::toString ( )
slot

Get the type of the variable.

◆ toString [2/2]

static String SCone::toString ( )
staticslot

Get the type of the variable.