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

Shape manipulation class. More...

Inheritance diagram for SShape:
SComp

Public Types

enum  FillingTypeEnum { FLATTEST = 0 , MEDIUM = 1 , MOST_CURVED = 2 }
 The type of filling to use. More...
 
enum  SmoothingMethod { INTERPOLATE = 0 , APPROXIMATE = 1 , NONE = 2 }
 Smoothing method used for BSpline curve creation. More...
 
- Public Types inherited from SComp
enum  VisibilityEnum { HIDDEN_ONLY = 0 , VISIBLE_ONLY = 1 , ANY_VISIBILITY = 2 }
 Visible criteria. More...
 

Public Member Functions

Object Explode ()
 Explode the CAD object. More...
 
 SShape ()
 Default constructor. More...
 
 SShape (SMultiline multiline, SmoothingMethod method)
 Construct a new BSpline curve by smoothing (interpolation or approximation) a SMultiline. More...
 
 SShape (SShape other)
 Construct a SShape by copying the SShape Other. More...
 
string toString ()
 Get the type of the variable. More...
 
string ValuesToString ()
 Get a debug string representation of the shape. 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 Object AddHoles (SShape surface, Array< SShape > linearTable)
 Create holes to a CAD Surface from closed CAD edge and CAD wire. More...
 
static Object AddRestriction (SShape surface, SShape wireRestriction)
 Create restriction to a CAD Surface from a closed CAD wire. More...
 
static Array< SShapeAll (VisibilityEnum visCrit=SComp.ANY_VISIBILITY)
 Get all the SShape in the document. More...
 
static SShape CreateCompound (Array< SShape > others)
 Construct a SShape compound from the given shape list. More...
 
static SShape CreateTriangulatedSurface (SPoly poly)
 Construct a SShape triangulated surface by converting a SPoly. More...
 
static Object CreateWire (Array< SShape > edgeTable)
 Construct a new CAD wire by connecting all CAD edges. More...
 
static Object ExtractCurve (Array< SShape > compTable)
 Extract free border from surfacic SShape as curves. More...
 
static Object ExtractWire (Array< SShape > compTable)
 Extract free borders from surfacic SShape as wire. More...
 
static Object Fill (SShape wire, FillingTypeEnum fillingType)
 Create a filling surface from CAD wire. You have to enter the command with a closed wire composed of 3 or 4 edges. More...
 
static Object FitOnMesh (SShape surface, SPoly mesh, boolean immobileUMin, boolean immobileUMax, boolean immobileVMin, boolean immobileVMax, boolean projBadPtsOnCloud)
 Fit a CAD Surface on a mesh. More...
 
static Object FromClick ()
 Launch an interaction to select a SShape in the scene. More...
 
static Array< SShapeFromName (string name)
 Search all the SShape with the given name. More...
 
static Array< SShapeFromSel ()
 Get all the selected SShape. More...
 
static Object LinearExtrusion (number length, SVector direction, boolean closeExtremities, Array< SComp > shapes)
 Compute CAD face(s) corresponding to the extrusion of profile(s) along a direction, with a given length. More...
 
static SShape New (SMultiline multiline, SmoothingMethod method)
 Construct a new BSpline curve by smoothing (interpolation or approximation) a SMultiline. More...
 
static SShape New (SShape other)
 Construct a SShape by copying the SShape Other. More...
 
static Object PipeTubeAlongPath (number radius, boolean closeExtremities, Array< SComp > shapes)
 Compute CAD face(s) corresponding to the extrusion of a circle with a given radius along a given path. More...
 
static Object ProfileAlongPath (SComp profile, SComp path, boolean makePerpendicular, boolean startAtProfilePosition, boolean closeExtremities)
 Compute CAD face corresponding to the extrusion of a given profile along a given path. More...
 
static Object Sew (Array< SShape > compTable, number sewingTolerance)
 Sew surfacic SShape according to a given tolerance. 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...
 

Detailed Description

Shape manipulation class.

Member Enumeration Documentation

◆ FillingTypeEnum

The type of filling to use.

Enumerator
FLATTEST 

To have the flattest patch.

MEDIUM 

To have a medium patch.

MOST_CURVED 

To have the most rounded patch.

◆ SmoothingMethod

Smoothing method used for BSpline curve creation.

Enumerator
INTERPOLATE 

Smoothing by interpolation.

APPROXIMATE 

Smoothing by approximation (with automatic tolerance).

NONE 

No smoothing.

Constructor & Destructor Documentation

◆ SShape() [1/3]

SShape::SShape ( )

Default constructor.

◆ SShape() [2/3]

SShape::SShape ( SMultiline  multiline,
SmoothingMethod  method 
)

Construct a new BSpline curve by smoothing (interpolation or approximation) a SMultiline.

Parameters
multiline(SMultiline) The SMultiline to interpolate or approximate
method(SmoothingMethod) The smoothing method for BSpline curve creation

◆ SShape() [3/3]

SShape::SShape ( SShape  other)

Construct a SShape by copying the SShape Other.

Parameters
other(SShape) The other SShape to copy.

Member Function Documentation

◆ AddHoles()

static Object SShape::AddHoles ( SShape  surface,
Array< SShape linearTable 
)
static

Create holes to a CAD Surface from closed CAD edge and CAD wire.

License
This function requires the license AEC.
Parameters
surface(SShape) The surface to add holes in.
linearTable(Array<SShape>) The table of edges and wires used for the holes.
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: Wrong inputs type
  • 2: Wire or edge is open
  • 3: An error occurred
ret.Shape(SShape) The computed surface

◆ AddRestriction()

static Object SShape::AddRestriction ( SShape  surface,
SShape  wireRestriction 
)
static

Create restriction to a CAD Surface from a closed CAD wire.

License
This function requires the license AEC.
Parameters
surface(SShape) The surface to restrict
wireRestriction(SShape) The wire used for the restriction
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: Wrong inputs type
  • 2: Wire is open
  • 3: An error occurred
ret.Shape(SShape) The restricted surface

◆ All()

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

Get all the SShape in the document.

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

◆ CreateCompound()

static SShape SShape::CreateCompound ( Array< SShape others)
static

Construct a SShape compound from the given shape list.

License
This function requires the license AEC.
Parameters
others(Array<SShape>) The shapes used to create the compound
Returns
(SShape) The created compound

◆ CreateTriangulatedSurface()

static SShape SShape::CreateTriangulatedSurface ( SPoly  poly)
static

Construct a SShape triangulated surface by converting a SPoly.

License
This function requires the license AEC.
Parameters
poly(SPoly) The mesh that will be converted
Returns
(SShape) The created triangulated surface

◆ CreateWire()

static Object SShape::CreateWire ( Array< SShape edgeTable)
static

Construct a new CAD wire by connecting all CAD edges.

License
This function requires the license AEC.
Parameters
edgeTable(Array<SShape>) The table of edges to be connected
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.Shape(SShape) The created wire

◆ Explode()

Object SShape::Explode ( )

Explode the CAD object.

License
This function requires the license AEC.
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.ShapeTbl(Array<SShape>) The exploded CAD object table.

◆ ExtractCurve()

static Object SShape::ExtractCurve ( Array< SShape compTable)
static

Extract free border from surfacic SShape as curves.

License
This function requires the license AEC.
Parameters
compTable(Array<SShape>) The table of surfacic SShape to extract
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.ShapeTbl(Array<SShape>) The extracted curves table.

◆ ExtractWire()

static Object SShape::ExtractWire ( Array< SShape compTable)
static

Extract free borders from surfacic SShape as wire.

License
This function requires the license AEC.
Parameters
compTable(Array<SShape>) The table of surfacic SShape to extract
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
ret.ShapeTbl(Array<SShape>) The extracted wires table.

◆ Fill()

static Object SShape::Fill ( SShape  wire,
FillingTypeEnum  fillingType 
)
static

Create a filling surface from CAD wire. You have to enter the command with a closed wire composed of 3 or 4 edges.

License
This function requires the license AEC.
Parameters
wire(SShape) The wire to fill
fillingType(FillingTypeEnum) The filling method to use
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: Wrong input
  • 2: Wire is open
  • 3: Wire must be composed of 3 or 4 edges
  • 4: An error occurred
ret.Shape(SShape) The filled surface

◆ FitOnMesh()

static Object SShape::FitOnMesh ( SShape  surface,
SPoly  mesh,
boolean  immobileUMin,
boolean  immobileUMax,
boolean  immobileVMin,
boolean  immobileVMax,
boolean  projBadPtsOnCloud 
)
static

Fit a CAD Surface on a mesh.

License
This function requires the license AEC.
Parameters
surface(SShape) The surface to fit
mesh(SPoly) The mesh to fit on
immobileUMin(boolean) If true, poles on the edges UMin must stay immobile. Otherwise they can move
immobileUMax(boolean) If true, poles on the edges UMax must stay immobile. Otherwise they can move
immobileVMin(boolean) If true, poles on the edges VMin must stay immobile. Otherwise they can move
immobileVMax(boolean) If true, poles on the edges VMax must stay immobile. Otherwise they can move
projBadPtsOnCloud(boolean) If true, control points with bad projection will be fit on cloud instead
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: Wrong inputs
  • 2: An error occurred
ret.Shape(SShape) The surface fitted on the mesh

◆ FromClick()

static Object SShape::FromClick ( )
static

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

◆ FromName()

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

Search all the SShape with the given name.

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

◆ FromSel()

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

Get all the selected SShape.

Returns
(Array<SShape>) All the selected SShape

◆ LinearExtrusion()

static Object SShape::LinearExtrusion ( number  length,
SVector  direction,
boolean  closeExtremities,
Array< SComp shapes 
)
static

Compute CAD face(s) corresponding to the extrusion of profile(s) along a direction, with a given length.

License
This function requires the license AEC.
Parameters
length(number) The length of the extrusion.
direction(SVector) The direction of the extrusion.
closeExtremities(boolean) True if extremities of the extruded comp have to be closed. Profiles must be planar to close the extremities.
shapes(Array<SComp>) All the profiles to extrude. Only the linear CADs will be considered for extrusion.
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
  • 2: Invalid input parameters (either the direction or length are invalid, or none of the components in the specified shapes can be used as a valid profile).
ret.CompTbl(Array<SComp>) The extruded shapes.

◆ New() [1/2]

static SShape SShape::New ( SMultiline  multiline,
SmoothingMethod  method 
)
static

Construct a new BSpline curve by smoothing (interpolation or approximation) a SMultiline.

Parameters
multiline(SMultiline) The SMultiline to interpolate or approximate
method(SmoothingMethod) The smoothing method for BSpline curve creation
Returns
(SShape) The new SShape.

◆ New() [2/2]

static SShape SShape::New ( SShape  other)
static

Construct a SShape by copying the SShape Other.

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

◆ PipeTubeAlongPath()

static Object SShape::PipeTubeAlongPath ( number  radius,
boolean  closeExtremities,
Array< SComp shapes 
)
static

Compute CAD face(s) corresponding to the extrusion of a circle with a given radius along a given path.

License
This function requires the license AEC.
Parameters
radius(number) The radius of the circle to extrude.
closeExtremities(boolean) True if extremities of the extruded comp have to be closed.
shapes(Array<SComp>) All the paths to follow. Only the linear CADs will be considered for extrusion.
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: An error occurred
  • 2: Invalid input parameters (either the radius is invalid, or none of the components in the specified shapes can be used as a valid extrusion path).
ret.ShapeTbl(Array<SShape>) The extruded shapes.

◆ ProfileAlongPath()

static Object SShape::ProfileAlongPath ( SComp  profile,
SComp  path,
boolean  makePerpendicular,
boolean  startAtProfilePosition,
boolean  closeExtremities 
)
static

Compute CAD face corresponding to the extrusion of a given profile along a given path.

License
This function requires the license AEC.
Parameters
profile(SComp) The profile to extrude
path(SComp) The extrusion path
makePerpendicular(boolean) True if the profile to extrude has to be perpendicular to the first vector of the path
startAtProfilePosition(boolean) True if the extrusion has to begin at profile and not at path position
closeExtremities(boolean) True if extremities of the extruded comp have to be closed. The specified profile must be planar to close the extremities
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: Bad profile or path type
  • 2: An error occurred
ret.Shape(SShape) The extruded SShape

◆ Sew()

static Object SShape::Sew ( Array< SShape compTable,
number  sewingTolerance 
)
static

Sew surfacic SShape according to a given tolerance.

License
This function requires the license AEC.
Parameters
compTable(Array<SShape>) The table of SShape to sew
sewingTolerance(number) The tolerance used for sewing
Return values
ret.ErrorCode(number) The error code
  • 0: No error
  • 1: Wrong input type
  • 2: An error occurred
ret.Shape(SShape) The sewed shape, can be a SShape compound

◆ toString()

string SShape::toString ( )

Get the type of the variable.

Returns
(string) The type name

◆ ValuesToString()

string SShape::ValuesToString ( )

Get a debug string representation of the shape.

Returns
(string) a debug string representing the shape