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

Provide circle edition and creation methods. More...

Inheritance diagram for SCircle:
SFeature SComp

Public Member Functions

Object Discretize (number deflection=0, number meanPointDistance=0)
 Convert the circle 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 circle. More...
 
number GetPerimeter ()
 Return the perimeter of the circle. More...
 
number GetRadius ()
 Return the radius of the circle. More...
 
 SCircle ()
 Default constructor to create an empty new SCircle. More...
 
 SCircle (SCircle other)
 Construct a SCircle by copying another SCircle. More...
 
 SCircle (SLine tang1, SLine tang2, SPoint pt, boolean largeQ=true)
 Construct a new SCircle tangent to the two FLines and passing through pt. More...
 
 SCircle (SPoint center, SVector normal, number radius)
 Construct a new SCircle from a given center point, normal direction and radius. More...
 
 SCircle (SPoint firstPt, SPoint secondPt, SPoint thirdPt)
 Construct a new SCircle by 3 points. More...
 
 SetRadius (number radius)
 Set the radius. 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< SCircleAll (VisibilityEnum visCrit=SComp.ANY_VISIBILITY)
 Get all the SCircle in the document. More...
 
static Object FromClick ()
 Launch an interaction to select a SCircle in the scene. More...
 
static Array< SCircleFromName (string name)
 Search all the SCircle with the given name. More...
 
static Array< SCircleFromSel ()
 Get all the selected SCircle. More...
 
static SCircle New ()
 Default constructor to create an empty new SCircle. More...
 
static SCircle New (SCircle other)
 Construct a SCircle by copying another SCircle. More...
 
static SCircle New (SLine tang1, SLine tang2, SPoint pt, boolean largeQ=true)
 Construct a new SCircle tangent to the two FLines and passing through pt. More...
 
static SCircle New (SPoint center, SVector normal, number radius)
 Construct a new SCircle from a given center point, normal direction and radius. More...
 
static SCircle New (SPoint firstPt, SPoint secondPt, SPoint thirdPt)
 Construct a new SCircle by 3 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 circle edition and creation methods.

Constructor & Destructor Documentation

◆ SCircle() [1/5]

SCircle::SCircle ( )

Default constructor to create an empty new SCircle.

◆ SCircle() [2/5]

SCircle::SCircle ( SCircle  other)

Construct a SCircle by copying another SCircle.

Parameters
other(SCircle) The SCircle to copy

◆ SCircle() [3/5]

SCircle::SCircle ( SLine  tang1,
SLine  tang2,
SPoint  pt,
boolean  largeQ = true 
)

Construct a new SCircle tangent to the two FLines and passing through pt.

Note
The two lines are assumed to intersectEven though also for not intersecting lines a result will be produced
Parameters
tang1(SLine) The first tangent
tang2(SLine) The second tangent
pt(SPoint) The point through which the circle passes
largeQ(boolean) Return the large circle or the small circle?
  • true: Return the large circle
  • false: Return the small circle

◆ SCircle() [4/5]

SCircle::SCircle ( SPoint  center,
SVector  normal,
number  radius 
)

Construct a new SCircle from a given center point, normal direction and radius.

Parameters
center(SPoint) Circle center
normal(SVector) Circle normal, (not null)
radius(number) Circle radius

◆ SCircle() [5/5]

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

Construct a new SCircle by 3 points.

Note
The 3 points must be not identical.If you want to construct a circle with more than 3 points, use SCloud.BestCircle().
Parameters
firstPt(SPoint) First point on the circle
secondPt(SPoint) Second point on the circle
thirdPt(SPoint) Third point on the circle

Member Function Documentation

◆ All()

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

Get all the SCircle in the document.

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

◆ Discretize()

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

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

Return the distance between a point and the circle.

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

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

◆ FromName()

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

Search all the SCircle with the given name.

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

◆ FromSel()

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

Get all the selected SCircle.

Returns
(Array<SCircle>) All the selected SCircle

◆ GetPerimeter()

number SCircle::GetPerimeter ( )

Return the perimeter of the circle.

Returns
(number) The perimeter of the circle

◆ GetRadius()

number SCircle::GetRadius ( )

Return the radius of the circle.

Returns
(number) The radius of the circle

◆ New() [1/5]

static SCircle SCircle::New ( )
static

Default constructor to create an empty new SCircle.

Returns
(SCircle) The new SCircle.

◆ New() [2/5]

static SCircle SCircle::New ( SCircle  other)
static

Construct a SCircle by copying another SCircle.

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

◆ New() [3/5]

static SCircle SCircle::New ( SLine  tang1,
SLine  tang2,
SPoint  pt,
boolean  largeQ = true 
)
static

Construct a new SCircle tangent to the two FLines and passing through pt.

Note
The two lines are assumed to intersectEven though also for not intersecting lines a result will be produced
Parameters
tang1(SLine) The first tangent
tang2(SLine) The second tangent
pt(SPoint) The point through which the circle passes
largeQ(boolean) Return the large circle or the small circle?
  • true: Return the large circle
  • false: Return the small circle
Returns
(SCircle) The new SCircle.

◆ New() [4/5]

static SCircle SCircle::New ( SPoint  center,
SVector  normal,
number  radius 
)
static

Construct a new SCircle from a given center point, normal direction and radius.

Parameters
center(SPoint) Circle center
normal(SVector) Circle normal, (not null)
radius(number) Circle radius
Returns
(SCircle) The new SCircle.

◆ New() [5/5]

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

Construct a new SCircle by 3 points.

Note
The 3 points must be not identical.If you want to construct a circle with more than 3 points, use SCloud.BestCircle().
Parameters
firstPt(SPoint) First point on the circle
secondPt(SPoint) Second point on the circle
thirdPt(SPoint) Third point on the circle
Returns
(SCircle) The new SCircle.

◆ SetRadius()

SCircle::SetRadius ( number  radius)

Set the radius.

Parameters
radius(number) The radius to set

◆ toString()

string SCircle::toString ( )

Get the type of the variable.

Returns
(string) The type name