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

Cylinder manipulation class. The SCylinder creation can be done by calling the static functions:
. More...

Inheritance diagram for SCylinder:
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)
 
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 GetBaseCenter ()
 
SCircle GetBaseCircle ()
 
Number GetLength ()
 
Number GetRadius ()
 
Number GetSurface ()
 
SPoint GetTopCenter ()
 
SCircle GetTopCircle ()
 
Boolean IsOuter ()
 To know if the SCylinder is set to be scanned from the inside or from the outside. More...
 
static SCylinder New ()
 Default constructor to create an empty new SCylinder. More...
 
static SCylinder New (SCylinder Other)
 Constructs an SCylinder by copying the SCylinder Other. More...
 
static SCylinder New (SPoint Center, SVector NormalDir, Number Radius, Number Length)
 Constructs a custom SCylinder from a given center point, normal direction, radius and length. More...
 
static SCylinder New (SPoint FirstPt, SPoint SecondPt, SPoint ThirdPt, SPoint FourthPt)
 Constructs a new SCylinder by 4 points. More...
 
 SetInner ()
 To set the SCylinder to a cylinder scanned from the inside. More...
 
 SetLength (Number Length)
 Setter for length. More...
 
 SetOuter ()
 To set the SCylinder to a cylinder scanned from the outside. More...
 
 SetRadius (Number Radius)
 Setter for the radius. 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

Cylinder manipulation class. The SCylinder creation can be done by calling the static functions:
.

  • New() to create your own empty SCylinder.
  • New() to copy an existing SCylinder.
  • New() to create a new SCylinder by defining a center point, normal, radius, and length.
    var center = SPoint.New();
    var direction = SVector.New(0, 0, 1);
    var radius = 7;
    var length = 77;
    var emptySCylinder = SCylinder.New();
    var mySCylinder = SCylinder.New(center, direction, radius, length);
    var mySCylinderCopy = SCylinder.New(mySCylinder);

Member Function Documentation

◆ All

static Array SCylinder::All ( Number  VisCrit)
inlinestaticslot

To get all the SComp in the document.

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

◆ Discretize

Array SCylinder::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 SCylinder::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 SCylinder::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.Cylinderthe SCylinder selected

◆ FromName

static Array SCylinder::FromName ( String  Name)
inlinestaticslot

Search all the component with the given name.

Return values
Arrayall the SCylinder with the given name

◆ FromSel

static Array SCylinder::FromSel ( )
inlinestaticslot

To get all the selected SComp.

Return values
Arrayall the SCylinder selected

◆ GetBaseCenter

SPoint SCylinder::GetBaseCenter ( )
slot
Note
This function is the same as SFeature.GetCenter()
Returns
returns the base center of the cylinder

◆ GetBaseCircle

SCircle SCylinder::GetBaseCircle ( )
slot
Returns
returns the base circle of the cylinder

◆ GetLength

Number SCylinder::GetLength ( )
slot
Returns
Returns the length

◆ GetRadius

Number SCylinder::GetRadius ( )
slot
Returns
Returns the radius

◆ GetSurface

Number SCylinder::GetSurface ( )
slot
Returns
Returns the surface of the cylinder

◆ GetTopCenter

SPoint SCylinder::GetTopCenter ( )
slot
Returns
returns the top center of the cylinder

◆ GetTopCircle

SCircle SCylinder::GetTopCircle ( )
slot
Returns
returns the top circle of the cylinder

◆ IsOuter

Boolean SCylinder::IsOuter ( )
slot

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

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

◆ New [1/4]

static SCylinder SCylinder::New ( )
staticslot

Default constructor to create an empty new SCylinder.

◆ New [2/4]

static SCylinder SCylinder::New ( SCylinder  Other)
staticslot

Constructs an SCylinder by copying the SCylinder Other.

◆ New [3/4]

static SCylinder SCylinder::New ( SPoint  Center,
SVector  NormalDir,
Number  Radius,
Number  Length 
)
staticslot

Constructs a custom SCylinder from a given center point, normal direction, radius and length.

Parameters
CenterCylinder center. The cylinder starts from this extremity in its normal direction
NormalDirCylinder normal axis
RadiusCylinder radius
LengthCylinder length

◆ New [4/4]

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

Constructs a new SCylinder by 4 points.

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

◆ SetInner

SCylinder::SetInner ( )
slot

To set the SCylinder to a cylinder scanned from the inside.

◆ SetLength

SCylinder::SetLength ( Number  Length)
slot

Setter for length.

Parameters
[in]Lengthlength to set

◆ SetOuter

SCylinder::SetOuter ( )
slot

To set the SCylinder to a cylinder scanned from the outside.

◆ SetRadius

SCylinder::SetRadius ( Number  Radius)
slot

Setter for the radius.

Parameters
[in]Radiusradius to set

◆ toString [1/2]

String SCylinder::toString ( )
slot

Get the type of the variable.

◆ toString [2/2]

static String SCylinder::toString ( )
staticslot

Get the type of the variable.