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

Sphere manipulation class. The SSphere creation can be done by calling the static functions:
. More...

#include <SSphere.h>

Inheritance diagram for SSphere:
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.
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 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 ()
 Launches a click interaction to select a 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 GetRadius ()
 
Number GetSurface ()
 Returns 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...
 
static SSphere New ()
 Default constructor to create an empty new SSphere. More...
 
static SSphere New (SPoint Center, Number Radius)
 Constructs a new SSphere by defining its data. More...
 
static SSphere New (SPoint FirstPt, SPoint SecondPt)
 Constructs a new SSphere by 2 points. More...
 
static SSphere New (SPoint ipFirstPt, SPoint ipSecondPt, SPoint ipThirdPt)
 Constructs a new SSphere by 3 points. More...
 
static SSphere New (SSphere Other)
 Constructs an SSphere by copying Other. More...
 
 SetInner ()
 To set the SSphere to a sphere scanned from the inside. More...
 
 SetOuter ()
 To set the SSphere to a sphere scanned from the outside. More...
 
 SetRadius (Number Radius)
 To set a new radius to the SSphere. 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 ()
 Launches a click interaction to select a 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 ()
 Launches a click interaction to select a 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 ()
 The component containing folder's name. More...
 
String GetName ()
 The component's name. More...
 
String GetPath ()
 To get the full path of a comp in the tree. More...
 
 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

Sphere manipulation class. The SSphere creation can be done by calling the static functions:
.

  • New() to create your own empty SSphere.
  • New() to copy an existing SSphere.
  • New() to create a new SSphere by defining its center and radius.
    var center = SPoint.New(1, 1, 2);
    var radius = 25;
    var emptySphere = SSphere.New();
    var mySphere = SSphere.New(center, radius);
    var mySphereCopy = SSphere.New(mySphere);

Member Function Documentation

◆ All

static Array SSphere::All ( Number  VisCrit)
inlinestaticslot

To get all the SComp in the document.

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

◆ Discretize

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

To convert the continuous feature 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.

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

Launches a click interaction to select a 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.Spherethe SSphere selected

◆ FromName

static Array SSphere::FromName ( String  Name)
inlinestaticslot

Search all the component with the given name.

Return values
Arrayall the SSphere with the given name

◆ FromSel

static Array SSphere::FromSel ( )
inlinestaticslot

To get all the selected SComp.

Return values
Arrayall the SSphere selected

◆ GetRadius

Number SSphere::GetRadius ( )
slot
Returns
The SSphere's radius

◆ GetSurface

Number SSphere::GetSurface ( )
slot

Returns the surface of the sphere.

◆ IsOuter

Boolean SSphere::IsOuter ( )
slot

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

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

◆ New [1/5]

static SSphere SSphere::New ( )
staticslot

Default constructor to create an empty new SSphere.

◆ New [2/5]

static SSphere SSphere::New ( SPoint  Center,
Number  Radius 
)
staticslot

Constructs a new SSphere by defining its data.

Parameters
[in]CenterThe SSphere center
[in]RadiusThe SSphere radius

◆ New [3/5]

static SSphere SSphere::New ( SPoint  FirstPt,
SPoint  SecondPt 
)
staticslot

Constructs a new SSphere by 2 points.

Note
The 2 points must be not identical.
Parameters
[in]FirstPtFirst point on the sphere
[in]SecondPtSecond point on the sphere

◆ New [4/5]

static SSphere SSphere::New ( SPoint  ipFirstPt,
SPoint  ipSecondPt,
SPoint  ipThirdPt 
)
staticslot

Constructs 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
[in]ipFirstPtFirst point of the sphere
[in]ipSecondPtSecond point of the sphere
[in]ipThirdPtThird point of the sphere

◆ New [5/5]

static SSphere SSphere::New ( SSphere  Other)
staticslot

Constructs an SSphere by copying Other.

◆ SetInner

SSphere::SetInner ( )
slot

To set the SSphere to a sphere scanned from the inside.

◆ SetOuter

SSphere::SetOuter ( )
slot

To set the SSphere to a sphere scanned from the outside.

◆ SetRadius

SSphere::SetRadius ( Number  Radius)
slot

To set a new radius to the SSphere.

Parameters
[in]RadiusThe new radius to use

◆ toString [1/2]

String SSphere::toString ( )
slot

Get the type of the variable.

◆ toString [2/2]

static String SSphere::toString ( )
staticslot

Get the type of the variable.