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

Abstract class storing methods available on all 3D geometry. More...

Inheritance diagram for SFeature:
SComp SCircle SCone SCylinder SLine SPlane SRoundSlot SSphere SSquareSlot

Public Member Functions

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< 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

Abstract class storing methods available on all 3D geometry.

Member Function Documentation

◆ All()

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

Get all the SFeature in the document.

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

◆ Compare()

Object SFeature::Compare ( SCloud  measCloud,
number  distMax,
number  mappingObject = 1,
number  maxCosAngle = -2 
)

Calculate the distances between 2 components for further inspection purpose (color mapping)

Note
The distance is measured by projecting component iMeasCloud on 'this'. 'This' is considered as the reference object while iMeasCloud is considered as the measure to project on 'this'.
The floating value returned on each vertex are >0 if measured points are "over" this (that is: in the way of the normal), otherwise <0 if measured points are under the surface.
Parameters
measCloud(SCloud) SCloud considered as the measured object to project on this
distMax(number) Ignore point having a distance greater than this one.
mappingObject(number) 1 means color mapping is done on a mesh representing this, else 2 the color mapping is done on iMeasCloud.
maxCosAngle(number) Max cos value for the angle between the triangle and the scanning dir if the cloud contains scanning direction, this parameter can be used to reject points which scanning direction is not valid according to this threshold. For a value lower than -1, the scanning direction will never invalidate a point For a value equal to 0, the scanning direction and the triangle must be oriented in the same way
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Cloud(SCloud) The new SCloud, which is the result of the comparison, if MappingObject is set to 2 else Array.Cloud is undefined
ret.Poly(SPoly) The new SPoly, which is the result of the comparison, if MappingObject is set to 1 else Array.Poly is undefined
ret.ReportData(SReportData) The new SReportData, which contains the view set with the inspected component.

◆ FromBfcFile()

static Object SFeature::FromBfcFile ( string  filePath)
static

Load a .bfc file.

Warning
File saved using 32 bits architecture cannot be read on 64 bits architecture neither is the opposite possible.
Parameters
filePath(string) Path of the file to load
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.NominalTbl(Array<SComp>) Table containing the nominal features.
ret.MeasuredTbl(Array<SComp>) Table containing the measured features.

◆ FromClick()

static Object SFeature::FromClick ( )
static

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

◆ FromName()

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

Search all the SFeature with the given name.

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

◆ FromSel()

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

Get all the selected SFeature.

Returns
(Array<SFeature>) All the selected SFeature

◆ GetCenter()

SPoint SFeature::GetCenter ( )

Return the center of the feature.

Returns
(SPoint) The center of the feature

◆ GetNormal()

SVector SFeature::GetNormal ( )

Return the normal of the feature.

Returns
(SVector) The normal of the feature

◆ SetCenter()

SFeature::SetCenter ( SPoint  center)

Set the center.

Parameters
center(SPoint) The center to set

◆ SetNormal()

SFeature::SetNormal ( SVector  normal)

Set the normal.

Parameters
normal(SVector) The normal to set

◆ toString()

string SFeature::toString ( )

Get the type of the variable.

Returns
(string) The type name