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

Plane manipulation class. The SPlane creation can be done by calling the static functions:
. More...

#include <SPlane.h>

Inheritance diagram for SPlane:
SFeature SComp SObject

Public Slots

static Array All (Number VisCrit)
 To get all the SComp in the document. More...
 
Array BestSymmetryPlane (SComp iSelComp, Number iOption)
 Compute the best symmetry plane of a cloud or mesh. More...
 
Array Discretize (Number deflection, Number meanPointDistance)
 To discretize the current feature.
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 iPoint)
 Returns the distance between a point and the feature <0 if below/inside the feature >0 if above/outside the feature. More...
 
Array FitPlaneToBoundingBox3D (SPoint iLowerPoint, SPoint iUpperPoint, Boolean iMoveCenter, Number iScale)
 Modify the plane's size. Compute the intersection between a box and plane. 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 GetLength ()
 Returns the length. More...
 
Number GetSurface ()
 Returns the surface of the feature. More...
 
Number GetWidth ()
 Returns the width. More...
 
SVector GetXDir ()
 
SVector GetYDir ()
 
Array IntersectionBetween2Planes (SPlane iSecondPlane)
 Calculate intersection with another plane. More...
 
static SPlane New ()
 Default constructor to create an empty new SPlane. More...
 
static SPlane New (SPlane Other)
 Constructs an SPlane by copying the SPlane Other. More...
 
static SPlane New (SPoint Center, SVector Normal)
 Constructs a new SPlane by defining its data. More...
 
static SPlane New (SPoint Center, SVector Normal, SVector XDir, Number Length, Number Width)
 Constructs a new SPlane by defining its data. More...
 
static SPlane New (SPoint FirstPt, SPoint SecondPt, SPoint ThirdPt)
 Constructs a new SPlane by 3 points. More...
 
Array Proj3D (SMultiline iMultilineToProject)
 Calculates the 3D projection of a SMultiline on an SPoly. More...
 
Array Proj3D (SPoint iPointToProject)
 Projects a point onto the plane (shortest point) More...
 
Array ProjDir (SMultiline iMultilineToProject, SVector Direction)
 Calculate the projection of a polyline onto the current plane along a direction. More...
 
Array ProjDir (SPoint iPointToProject, SVector iProjectionVector)
 Projects a point onto the plane according to a given direction. More...
 
 SetLength (Number iLength)
 Setter for the length. More...
 
 SetWidth (Number iWidth)
 Setter for the width. 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

Plane manipulation class. The SPlane creation can be done by calling the static functions:
.

  • New() to create your own empty SPlane.
  • New() to copy an existing SPlane.
  • New() to create a new SPlane by defining its center, normal, X axis, length and width.
    var center = SPoint.New(1, 1, 2);
    var normal = SVector.New(0, 1, 0);
    var dirX = SVector.New(0, 0, 1);
    var length = 25;
    var width = 12;
    var emptySPlane = SPlane.New();
    var mySPlane = SPlane.New(center, normal, dirX, length, width);
    var mySPlaneCopy = SPlane.New(mySPlane);

Member Function Documentation

◆ All

static Array SPlane::All ( Number  VisCrit)
inlinestaticslot

To get all the SComp in the document.

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

◆ BestSymmetryPlane

Array SPlane::BestSymmetryPlane ( SComp  iSelComp,
Number  iOption 
)
slot

Compute the best symmetry plane of a cloud or mesh.

Return values
Array.ErrorCodeThe error code. 0 OK, no error 1 An exception occurred 2 Invalid list of component or bad or incomplete initialization or impossible to initialize. 3 Objects are too far from each other: impossible to make bestfit.
Array.PlaneThe computed plane.
Note
The selection must contain an initial plane, necessary to find the best one
Parameters
[in]iSelCompCloud or mesh on which the best symmetry plane is computed and an initial plane
[in]iOptionOption for best fit computation
  • 0 no constraints
  • 1 only parallel plane -> only allowing translation along Z
  • 2 center does not move -> only allowing rotations
  • 3 keep XDir -> allowing rotation along X and all translations
  • 4 keep YDir -> allowing rotation along Y and all translations
  • 5 keep XDir and center -> only allowing rotation along X
  • 6 keep YDir and center -> only allowing rotation along Y

◆ Discretize

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

To discretize the current feature.
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.

Return values
Array.ErrorCodeThe error code:
  • 0: No error
  • 1: An error occurred
Array.PolyCreates an SPoly from the current shape
Parameters
[in]deflectionmax deviation between the ideal shape and the discretized element
[in]meanPointDistanceMean distance between points/vertices

◆ Distance

Number SPlane::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

◆ FitPlaneToBoundingBox3D

Array SPlane::FitPlaneToBoundingBox3D ( SPoint  iLowerPoint,
SPoint  iUpperPoint,
Boolean  iMoveCenter,
Number  iScale 
)
slot

Modify the plane's size. Compute the intersection between a box and plane.

Note
Width and Height of the plane are internally modified
Return values
Array.ErrorCodeThe error code.
  • 0 OK, No error.
  • 1 No projection found; maybe Direction is parallel to the plane
  • 2 An error occurred.
Parameters
[in]iLowerPointLower point of the bounding box
[in]iUpperPointUpper point of the bounding box
[in]iMoveCenterShould we move the center of the plane to the middle of the 2D bounding box
[in]iScaleScale factor

◆ FromClick

static Array SPlane::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.Planethe SPLane selected

◆ FromName

static Array SPlane::FromName ( String  Name)
inlinestaticslot

Search all the component with the given name.

Return values
Arrayall the SPlane with the given name

◆ FromSel

static Array SPlane::FromSel ( )
inlinestaticslot

To get all the selected SComp.

Return values
Arrayall the SPlane selected

◆ GetLength

Number SPlane::GetLength ( )
slot

Returns the length.

◆ GetSurface

Number SPlane::GetSurface ( )
slot

Returns the surface of the feature.

◆ GetWidth

Number SPlane::GetWidth ( )
slot

Returns the width.

◆ GetXDir

SVector SPlane::GetXDir ( )
slot
Returns
The SPlane X direction
Warning
This vector can be null. Check it with SVector.IsNull()

◆ GetYDir

SVector SPlane::GetYDir ( )
slot
Returns
The SPlane Y direction
Warning
This vector can be null. Check it with SVector.IsNull()

◆ IntersectionBetween2Planes

Array SPlane::IntersectionBetween2Planes ( SPlane  iSecondPlane)
slot

Calculate intersection with another plane.

Return values
Array.ErrorCodeThe error code:
  • 0 No error.
  • 1 An error occurred.
Array.Linean array containing the intersection line (SLine).
Parameters
[in]iSecondPlanethe second plane to calculate intersection with

◆ New [1/5]

static SPlane SPlane::New ( )
staticslot

Default constructor to create an empty new SPlane.

◆ New [2/5]

static SPlane SPlane::New ( SPlane  Other)
staticslot

Constructs an SPlane by copying the SPlane Other.

◆ New [3/5]

static SPlane SPlane::New ( SPoint  Center,
SVector  Normal 
)
staticslot

Constructs a new SPlane by defining its data.

Parameters
[in]CenterThe plane's center
[in]NormalThe plane's normal

◆ New [4/5]

static SPlane SPlane::New ( SPoint  Center,
SVector  Normal,
SVector  XDir,
Number  Length,
Number  Width 
)
staticslot

Constructs a new SPlane by defining its data.

Parameters
[in]CenterThe plane's center
[in]NormalThe plane's normal
XDirPlane's X axis
LengthPlane's length
WidthPlane's width

◆ New [5/5]

static SPlane SPlane::New ( SPoint  FirstPt,
SPoint  SecondPt,
SPoint  ThirdPt 
)
staticslot

Constructs a new SPlane by 3 points.

Note
The 3 points must be not identical.
If you want to construct a plane with more than 3 points, use SCloud.BestPlane().
Parameters
[in]FirstPtFirst point on the plane
[in]SecondPtSecond point on the plane
[in]ThirdPtThird point on the plane

◆ Proj3D [1/2]

Array SPlane::Proj3D ( SMultiline  iMultilineToProject)
slot

Calculates the 3D projection of a SMultiline on an SPoly.

Return values
Array.ErrorCodeThe error code.
  • 0 OK, No error.
  • 1: An error occurred
Array.MultiThe projected SMultiline.
See also
SPlane.ProjDir()
Parameters
[in]iMultilineToProjectThe multiline to project.

◆ Proj3D [2/2]

Array SPlane::Proj3D ( SPoint  iPointToProject)
slot

Projects a point onto the plane (shortest point)

Return values
Array.ErrorCodeThe error code:
  • 0: No error
  • 1: An error occurred
Array.Pointthe point projected onto the plane
See also
SPlane.ProjDir()
Parameters
[in]iPointToProjectthe point to project onto the plane

◆ ProjDir [1/2]

Array SPlane::ProjDir ( SMultiline  iMultilineToProject,
SVector  Direction 
)
slot

Calculate the projection of a polyline onto the current plane along a direction.

Return values
Array.ErrorCodeThe error code.
  • 0 OK, No error.
  • 1 No projection found; maybe Direction is parallel to the plane
  • 2 An error occurred.
Array.MultiThe projected SMultiline.
See also
SPlane.Proj3D()
Parameters
[in]iMultilineToProjectThe multiline to project.
[in]Directionprojection direction

◆ ProjDir [2/2]

Array SPlane::ProjDir ( SPoint  iPointToProject,
SVector  iProjectionVector 
)
slot

Projects a point onto the plane according to a given direction.

Return values
Array.ErrorCodeThe error code:
  • 0: No error
  • 1: An error occurred
Array.Pointthe point projected onto the plane
See also
SPlane.Proj3D(), SCloud.ProjDir(), SPoly.ProjDir(), SMultiline.ProjDir()
Parameters
[in]iPointToProjectthe point to project onto the plane
[in]iProjectionVectorProjection direction

◆ SetLength

SPlane::SetLength ( Number  iLength)
slot

Setter for the length.

◆ SetWidth

SPlane::SetWidth ( Number  iWidth)
slot

Setter for the width.

◆ toString [1/2]

String SPlane::toString ( )
slot

Get the type of the variable.

◆ toString [2/2]

static String SPlane::toString ( )
staticslot

Get the type of the variable.