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

Provide sphere edition and creation methods. More...

Inheritance diagram for SSphere:
SFeature SComp

Public Member Functions

Object Discretize (number deflection=0, number meanPointDistance=0)
 Convert the sphere into a discretized SPoly. Only one of the parameters 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 sphere. More...
 
number GetRadius ()
 Return the radius of the sphere. More...
 
number GetSurface ()
 Return the surface of the sphere. More...
 
boolean IsOuter ()
 To know if the SSphere is set to be scanned from the inside or from the outside. More...
 
 SetInner ()
 Set the SSphere to a sphere scanned from the inside. More...
 
 SetOuter ()
 Set the SSphere to a sphere scanned from the outside. More...
 
 SetRadius (number radius)
 Set the radius. More...
 
 SSphere ()
 Default constructor to create an empty new SSphere. More...
 
 SSphere (SPoint center, number radius)
 Construct a new SSphere from a given center point and radius. More...
 
 SSphere (SPoint firstPt, SPoint secondPt)
 Construct a new SSphere by 2 points. More...
 
 SSphere (SPoint firstPt, SPoint secondPt, SPoint thirdPt)
 Construct a new SSphere by 3 points. More...
 
 SSphere (SSphere other)
 Construct a SSphere by copying another SSphere. More...
 
string toString ()
 Get the type of the variable. More...
 
string ValuesToString ()
 Get a debug string representation of the sphere. 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< SSphereAll (VisibilityEnum visCrit=SComp.ANY_VISIBILITY)
 Get all the SSphere in the document. More...
 
static Object FromClick ()
 Launch an interaction to select a SSphere in the scene. More...
 
static Array< SSphereFromName (string name)
 Search all the SSphere with the given name. More...
 
static Array< SSphereFromSel ()
 Get all the selected SSphere. More...
 
static SSphere New ()
 Default constructor to create an empty new SSphere. More...
 
static SSphere New (SPoint center, number radius)
 Construct a new SSphere from a given center point and radius. More...
 
static SSphere New (SPoint firstPt, SPoint secondPt)
 Construct a new SSphere by 2 points. More...
 
static SSphere New (SPoint firstPt, SPoint secondPt, SPoint thirdPt)
 Construct a new SSphere by 3 points. More...
 
static SSphere New (SSphere other)
 Construct a SSphere by copying another SSphere. 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 sphere edition and creation methods.

Constructor & Destructor Documentation

◆ SSphere() [1/5]

SSphere::SSphere ( )

Default constructor to create an empty new SSphere.

◆ SSphere() [2/5]

SSphere::SSphere ( SSphere  other)

Construct a SSphere by copying another SSphere.

Parameters
other(SSphere) The SSphere to copy

◆ SSphere() [3/5]

SSphere::SSphere ( SPoint  center,
number  radius 
)

Construct a new SSphere from a given center point and radius.

Parameters
center(SPoint) Sphere center
radius(number) Sphere radius

◆ SSphere() [4/5]

SSphere::SSphere ( SPoint  firstPt,
SPoint  secondPt 
)

Construct a new SSphere by 2 points.

Note
The 2 points must be not identical.
Parameters
firstPt(SPoint) First point on the sphere
secondPt(SPoint) Second point on the sphere

◆ SSphere() [5/5]

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

Construct a new SSphere by 3 points.

Note
The 3 points must be not aligned. The 3 points will define the median circle of the sphere. If you want to construct a sphere with more than 3 points, use SCloud.BestSphere().
Parameters
firstPt(SPoint) First point of the sphere
secondPt(SPoint) Second point of the sphere
thirdPt(SPoint) Third point of the sphere

Member Function Documentation

◆ All()

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

Get all the SSphere in the document.

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

◆ Discretize()

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

Convert the sphere into a discretized SPoly. Only one of the parameters 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 SSphere::Distance ( SPoint  point)

Return the distance between a point and the sphere.

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

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

◆ FromName()

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

Search all the SSphere with the given name.

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

◆ FromSel()

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

Get all the selected SSphere.

Returns
(Array<SSphere>) All the selected SSphere

◆ GetRadius()

number SSphere::GetRadius ( )

Return the radius of the sphere.

Returns
(number) The radius of the sphere

◆ GetSurface()

number SSphere::GetSurface ( )

Return the surface of the sphere.

Returns
(number) The surface of the sphere

◆ IsOuter()

boolean SSphere::IsOuter ( )

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

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

◆ New() [1/5]

static SSphere SSphere::New ( )
static

Default constructor to create an empty new SSphere.

Returns
(SSphere) The new SSphere.

◆ New() [2/5]

static SSphere SSphere::New ( SPoint  center,
number  radius 
)
static

Construct a new SSphere from a given center point and radius.

Parameters
center(SPoint) Sphere center
radius(number) Sphere radius
Returns
(SSphere) The new SSphere.

◆ New() [3/5]

static SSphere SSphere::New ( SPoint  firstPt,
SPoint  secondPt 
)
static

Construct a new SSphere by 2 points.

Note
The 2 points must be not identical.
Parameters
firstPt(SPoint) First point on the sphere
secondPt(SPoint) Second point on the sphere
Returns
(SSphere) The new SSphere.

◆ New() [4/5]

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

Construct a new SSphere by 3 points.

Note
The 3 points must be not aligned. The 3 points will define the median circle of the sphere. If you want to construct a sphere with more than 3 points, use SCloud.BestSphere().
Parameters
firstPt(SPoint) First point of the sphere
secondPt(SPoint) Second point of the sphere
thirdPt(SPoint) Third point of the sphere
Returns
(SSphere) The new SSphere.

◆ New() [5/5]

static SSphere SSphere::New ( SSphere  other)
static

Construct a SSphere by copying another SSphere.

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

◆ SetInner()

SSphere::SetInner ( )

Set the SSphere to a sphere scanned from the inside.

◆ SetOuter()

SSphere::SetOuter ( )

Set the SSphere to a sphere scanned from the outside.

◆ SetRadius()

SSphere::SetRadius ( number  radius)

Set the radius.

Parameters
radius(number) The radius to set

◆ toString()

string SSphere::toString ( )

Get the type of the variable.

Returns
(string) The type name

◆ ValuesToString()

string SSphere::ValuesToString ( )

Get a debug string representation of the sphere.

Returns
(string) A debug string representing the sphere