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

Provide round slot edition and creation methods. More...

Inheritance diagram for SRoundSlot:
SFeature SComp

Public Member Functions

Object Discretize (number deflection=0, number meanPointDistance=0)
 Convert the round slot 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, boolean calcIn3D=true)
 Return the distance between a point and the round slot. More...
 
SPoint GetCenterA ()
 Return the center on the -X side. More...
 
SPoint GetCenterB ()
 Return the center on the +X side. More...
 
SCircle GetCircleA ()
 Return the circle centered on the -X side. More...
 
SCircle GetCircleB ()
 Return the circle centered on the +X side. More...
 
number GetLength ()
 Return the length of the round slot. More...
 
number GetPerimeter ()
 Return the perimeter of the round slot. More...
 
number GetWidth ()
 Return the width of the round slot. More...
 
SVector GetXDir ()
 Return the round slot X direction. More...
 
SVector GetYDir ()
 Return the round slot Y direction. More...
 
 SetLength (number length)
 Set the length. More...
 
 SetWidth (number width)
 Set the width. More...
 
 SRoundSlot ()
 Default constructor to create an empty new SRoundSlot. More...
 
 SRoundSlot (SPoint center, SVector normal, SVector xDir, number length, number width)
 Construct a new SRoundSlot from a given center, normal, x direction, length and width. More...
 
 SRoundSlot (SPoint firstPt, SPoint secondPt, SPoint thirdPt)
 Construct a new SRoundSlot by 3 points. More...
 
 SRoundSlot (SRoundSlot other)
 Construct a SRoundSlot by copying another SRoundSlot. 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< SRoundSlotAll (VisibilityEnum visCrit=SComp.ANY_VISIBILITY)
 Get all the SRoundSlot in the document. More...
 
static Object FromClick ()
 Launch an interaction to select a SRoundSlot in the scene. More...
 
static Array< SRoundSlotFromName (string name)
 Search all the SRoundSlot with the given name. More...
 
static Array< SRoundSlotFromSel ()
 Get all the selected SRoundSlot. More...
 
static SRoundSlot New ()
 Default constructor to create an empty new SRoundSlot. More...
 
static SRoundSlot New (SPoint center, SVector normal, SVector xDir, number length, number width)
 Construct a new SRoundSlot from a given center, normal, x direction, length and width. More...
 
static SRoundSlot New (SPoint firstPt, SPoint secondPt, SPoint thirdPt)
 Construct a new SRoundSlot by 3 points. More...
 
static SRoundSlot New (SRoundSlot other)
 Construct a SRoundSlot by copying another SRoundSlot. 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 round slot edition and creation methods.

Constructor & Destructor Documentation

◆ SRoundSlot() [1/4]

SRoundSlot::SRoundSlot ( )

Default constructor to create an empty new SRoundSlot.

◆ SRoundSlot() [2/4]

SRoundSlot::SRoundSlot ( SPoint  center,
SVector  normal,
SVector  xDir,
number  length,
number  width 
)

Construct a new SRoundSlot from a given center, normal, x direction, length and width.

Parameters
center(SPoint) Round slot center
normal(SVector) Round slot normal
xDir(SVector) Round slot X axis
length(number) Round slot length
width(number) Round slot width

◆ SRoundSlot() [3/4]

SRoundSlot::SRoundSlot ( SPoint  firstPt,
SPoint  secondPt,
SPoint  thirdPt 
)

Construct a new SRoundSlot by 3 points.

Note
The 3 points must be not identical.If you want to construct a round slot with more than 3 points, use SCloud.BestRdSlot().The two first points define the length and the number axis. The third defines the width.
Parameters
firstPt(SPoint) First point on the round slot
secondPt(SPoint) Second point on the round slot
thirdPt(SPoint) Third point on the round slot to define the width

◆ SRoundSlot() [4/4]

SRoundSlot::SRoundSlot ( SRoundSlot  other)

Construct a SRoundSlot by copying another SRoundSlot.

Parameters
other(SRoundSlot) The SRoundSlot to copy

Member Function Documentation

◆ All()

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

Get all the SRoundSlot in the document.

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

◆ Discretize()

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

Convert the round slot 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 SRoundSlot::Distance ( SPoint  point,
boolean  calcIn3D = true 
)

Return the distance between a point and the round slot.

Parameters
point(SPoint) The point from which the distance to the feature has to be calculated
calcIn3D(boolean) Should we calculate the deviation in 3D?
  • true: Calculate in 3D
  • false: Calculate in 2D
Return values
<0Below/inside the feature
>0Above/outside the feature

◆ FromClick()

static Object SRoundSlot::FromClick ( )
static

Launch an interaction to select a SRoundSlot 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 SRoundSlot is selected.
  • 1: Nothing is selected.
  • 2: The ESCape key has been pressed
ret.RoundSlot(SRoundSlot) The selected SRoundSlot

◆ FromName()

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

Search all the SRoundSlot with the given name.

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

◆ FromSel()

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

Get all the selected SRoundSlot.

Returns
(Array<SRoundSlot>) All the selected SRoundSlot

◆ GetCenterA()

SPoint SRoundSlot::GetCenterA ( )

Return the center on the -X side.

Returns
(SPoint) The center on the -X side

◆ GetCenterB()

SPoint SRoundSlot::GetCenterB ( )

Return the center on the +X side.

Returns
(SPoint) The center on the +X side

◆ GetCircleA()

SCircle SRoundSlot::GetCircleA ( )

Return the circle centered on the -X side.

Returns
(SCircle) The circle centered on the -X side

◆ GetCircleB()

SCircle SRoundSlot::GetCircleB ( )

Return the circle centered on the +X side.

Returns
(SCircle) The circle centered on the +X side

◆ GetLength()

number SRoundSlot::GetLength ( )

Return the length of the round slot.

Returns
(number) The length of the round slot

◆ GetPerimeter()

number SRoundSlot::GetPerimeter ( )

Return the perimeter of the round slot.

Returns
(number) The perimeter of the round slot

◆ GetWidth()

number SRoundSlot::GetWidth ( )

Return the width of the round slot.

Returns
(number) The width of the round slot

◆ GetXDir()

SVector SRoundSlot::GetXDir ( )

Return the round slot X direction.

Warning
This vector can be null. Check it with SVector.IsNull()
Returns
(SVector) The round slot X direction

◆ GetYDir()

SVector SRoundSlot::GetYDir ( )

Return the round slot Y direction.

Warning
This vector can be null. Check it with SVector.IsNull()
Returns
(SVector) The round slot Y direction

◆ New() [1/4]

static SRoundSlot SRoundSlot::New ( )
static

Default constructor to create an empty new SRoundSlot.

Returns
(SRoundSlot) The new SRoundSlot.

◆ New() [2/4]

static SRoundSlot SRoundSlot::New ( SPoint  center,
SVector  normal,
SVector  xDir,
number  length,
number  width 
)
static

Construct a new SRoundSlot from a given center, normal, x direction, length and width.

Parameters
center(SPoint) Round slot center
normal(SVector) Round slot normal
xDir(SVector) Round slot X axis
length(number) Round slot length
width(number) Round slot width
Returns
(SRoundSlot) The new SRoundSlot.

◆ New() [3/4]

static SRoundSlot SRoundSlot::New ( SPoint  firstPt,
SPoint  secondPt,
SPoint  thirdPt 
)
static

Construct a new SRoundSlot by 3 points.

Note
The 3 points must be not identical.If you want to construct a round slot with more than 3 points, use SCloud.BestRdSlot().The two first points define the length and the number axis. The third defines the width.
Parameters
firstPt(SPoint) First point on the round slot
secondPt(SPoint) Second point on the round slot
thirdPt(SPoint) Third point on the round slot to define the width
Returns
(SRoundSlot) The new SRoundSlot.

◆ New() [4/4]

static SRoundSlot SRoundSlot::New ( SRoundSlot  other)
static

Construct a SRoundSlot by copying another SRoundSlot.

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

◆ SetLength()

SRoundSlot::SetLength ( number  length)

Set the length.

Parameters
length(number) The length to set

◆ SetWidth()

SRoundSlot::SetWidth ( number  width)

Set the width.

Parameters
width(number) The width to set

◆ toString()

string SRoundSlot::toString ( )

Get the type of the variable.

Returns
(string) The type name