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

Provide cone edition and creation methods. More...

Inheritance diagram for SCone:
SFeature SComp

Public Member Functions

Object Discretize (number deflection=0, number meanPointDistance=0)
 Convert the cone into a discretized SPoly.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 cone. More...
 
number GetAngle ()
 Return the angle of the cone in radian. More...
 
number GetAngleDegree ()
 Return the angle of the cone in degree. More...
 
SPoint GetBaseCenter ()
 Return the base center of the cone. More...
 
number GetBaseRadius ()
 Return the base radius of the cone. More...
 
SCircle GetCircle (number height)
 Return the circle for a given height. More...
 
number GetLength ()
 Return the length of the cone. More...
 
number GetSurface ()
 Return the surface of the cone. More...
 
SPoint GetTopCenter ()
 Return the top center of the cone. More...
 
number GetTopRadius ()
 Return 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...
 
 SCone ()
 Default constructor to create an empty new SCone. More...
 
 SCone (SCone other)
 Construct a SCone by copying another SCone. More...
 
 SCone (SPoint center, SVector normalDir, number lRadius, number sRadius, number length)
 Construct a new SCone from a given center, normal axis, large radius, small radius, length. More...
 
 SCone (SPoint firstPt, SPoint secondPt, SPoint thirdPt, SPoint fourthPt)
 Construct a new SCone by 4 points. More...
 
number SetAngle (number angle, boolean modifyLength=false)
 Modify the angle of the cone in radian. More...
 
boolean SetBaseRadius (number radius)
 Modify the base radius of the cone. More...
 
 SetInner ()
 Set the SCone to a cone scanned from the inside. More...
 
boolean SetLength (number length)
 Modify the length of the cone. More...
 
 SetOuter ()
 Set the SCone to a cone scanned from the outside. More...
 
boolean SetTopRadius (number radius)
 Modify the top radius of the cone. 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 (SMatrix ucs=null)
 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< SConeAll (VisibilityEnum visCrit=SComp.ANY_VISIBILITY)
 Get all the SCone in the document. More...
 
static Object FromClick ()
 Launch an interaction to select a SCone in the scene. More...
 
static Array< SConeFromName (string name)
 Search all the SCone with the given name. More...
 
static Array< SConeFromSel ()
 Get all the selected SCone. More...
 
static SCone New ()
 Default constructor to create an empty new SCone. More...
 
static SCone New (SCone other)
 Construct a SCone by copying another SCone. More...
 
static SCone New (SPoint center, SVector normalDir, number lRadius, number sRadius, number length)
 Construct a new SCone from a given center, normal axis, large radius, small radius, length. More...
 
static SCone New (SPoint firstPt, SPoint secondPt, SPoint thirdPt, SPoint fourthPt)
 Construct a new SCone by 4 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 cone edition and creation methods.

Constructor & Destructor Documentation

◆ SCone() [1/4]

SCone::SCone ( )

Default constructor to create an empty new SCone.

◆ SCone() [2/4]

SCone::SCone ( SCone  other)

Construct a SCone by copying another SCone.

Parameters
other(SCone) The SCone to copy

◆ SCone() [3/4]

SCone::SCone ( SPoint  center,
SVector  normalDir,
number  lRadius,
number  sRadius,
number  length 
)

Construct a new SCone from a given center, normal axis, large radius, small radius, length.

Parameters
center(SPoint) Cone center
normalDir(SVector) Cone normal axis
lRadius(number) Cone large radius
sRadius(number) Cone small radius
length(number) Cone length

◆ SCone() [4/4]

SCone::SCone ( SPoint  firstPt,
SPoint  secondPt,
SPoint  thirdPt,
SPoint  fourthPt 
)

Construct 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
firstPt(SPoint) First point on the cone (base circle)
secondPt(SPoint) Second point on the cone (base circle)
thirdPt(SPoint) Third point on the cone (base circle)
fourthPt(SPoint) Fourth point on the cone to calculate angle and length

Member Function Documentation

◆ All()

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

Get all the SCone in the document.

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

◆ Discretize()

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

Convert the cone into a discretized SPoly.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.Poly(SPoly) The discretized SPoly

◆ Distance()

number SCone::Distance ( SPoint  point)

Return the distance between a point and the cone.

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 SCone::FromClick ( )
static

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

◆ FromName()

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

Search all the SCone with the given name.

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

◆ FromSel()

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

Get all the selected SCone.

Returns
(Array<SCone>) All the selected SCone

◆ GetAngle()

number SCone::GetAngle ( )

Return the angle of the cone in radian.

Returns
(number) The angle of the cone in radian

◆ GetAngleDegree()

number SCone::GetAngleDegree ( )

Return the angle of the cone in degree.

Returns
(number) The angle of the cone in degree

◆ GetBaseCenter()

SPoint SCone::GetBaseCenter ( )

Return the base center of the cone.

Note
This function is the same as SFeature.GetCenter()
Returns
(SPoint) The base center of the cone

◆ GetBaseRadius()

number SCone::GetBaseRadius ( )

Return the base radius of the cone.

Returns
(number) The base radius of the cone

◆ GetCircle()

SCircle SCone::GetCircle ( number  height)

Return the circle for a given height.

Parameters
height(number) The height
  • <0: Lower than the base circle
  • 0: Base circle
  • 0<height<1: Intermediate circle
  • 1: Top circle
  • >1: Higher than the top circle
Returns
(SCircle) The circle for a given height

◆ GetLength()

number SCone::GetLength ( )

Return the length of the cone.

Returns
(number) The length of the cone

◆ GetSurface()

number SCone::GetSurface ( )

Return the surface of the cone.

Returns
(number) The surface of the cone

◆ GetTopCenter()

SPoint SCone::GetTopCenter ( )

Return the top center of the cone.

Returns
(SPoint) The top center of the cone

◆ GetTopRadius()

number SCone::GetTopRadius ( )

Return the top radius of the cone.

Returns
(number) The top radius of the cone

◆ IsOuter()

boolean SCone::IsOuter ( )

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

Return values
trueThe cone was defined as being scanned from the outside
falseThe cone was defined as being scanned from the inside

◆ New() [1/4]

static SCone SCone::New ( )
static

Default constructor to create an empty new SCone.

Returns
(SCone) The new SCone.

◆ New() [2/4]

static SCone SCone::New ( SCone  other)
static

Construct a SCone by copying another SCone.

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

◆ New() [3/4]

static SCone SCone::New ( SPoint  center,
SVector  normalDir,
number  lRadius,
number  sRadius,
number  length 
)
static

Construct a new SCone from a given center, normal axis, large radius, small radius, length.

Parameters
center(SPoint) Cone center
normalDir(SVector) Cone normal axis
lRadius(number) Cone large radius
sRadius(number) Cone small radius
length(number) Cone length
Returns
(SCone) The new SCone.

◆ New() [4/4]

static SCone SCone::New ( SPoint  firstPt,
SPoint  secondPt,
SPoint  thirdPt,
SPoint  fourthPt 
)
static

Construct 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
firstPt(SPoint) First point on the cone (base circle)
secondPt(SPoint) Second point on the cone (base circle)
thirdPt(SPoint) Third point on the cone (base circle)
fourthPt(SPoint) Fourth point on the cone to calculate angle and length
Returns
(SCone) The new SCone.

◆ SetAngle()

number SCone::SetAngle ( number  angle,
boolean  modifyLength = false 
)

Modify the angle of the cone in radian.

Parameters
angle(number) Angle to set
modifyLength(boolean) What 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
Return values
0Ok
!=0Error, returns the angle set. If modify top radius: the angle is too big, a top radius < 0 would have been calculated. If modify length: the two radius are the same, a infinite length would have been set.

◆ SetBaseRadius()

boolean SCone::SetBaseRadius ( number  radius)

Modify the base radius of the cone.

Parameters
radius(number) Radius to set
Return values
falseOk
trueError, the radius was <= 0. The base radius has been set to 0.

◆ SetInner()

SCone::SetInner ( )

Set the SCone to a cone scanned from the inside.

◆ SetLength()

boolean SCone::SetLength ( number  length)

Modify the length of the cone.

Parameters
length(number) Length to set
Return values
falseOk
trueError, the length was <= 0. The length has been set to 0.

◆ SetOuter()

SCone::SetOuter ( )

Set the SCone to a cone scanned from the outside.

◆ SetTopRadius()

boolean SCone::SetTopRadius ( number  radius)

Modify the top radius of the cone.

Parameters
radius(number) Radius to set
Return values
falseOk
trueError, the radius was <= 0. The top radius has been set to 0.

◆ toString()

string SCone::toString ( )

Get the type of the variable.

Returns
(string) The type name