GO2cam Javascript API  6.11
GO2SGeometry Class Reference

Base class for all kind of geometry (solid or wireframe) More...

Inheritance diagram for GO2SGeometry:
GO2SSolidGeometry GO2SWireGeometry GO2SStock T_GO2SSolid< TShape, TExtrusion, TRevol, TBool > GO2SMultipleGeometry GO2SSimpleGeometry GO2SMesh GO2SSolid GO2SOblong GO2SOffsetCurve GO2SPolygon GO2SProfile GO2SRectangle GO2SText GO2SWireFeature GO2SArc GO2SChamfer GO2SCircle GO2SEllipse GO2SFillet GO2SHelix GO2SHole GO2SLine GO2SNurbs GO2SPoint GO2SPolyline GO2SSegment

Public Member Functions

GO2SEnum::GO2SError ChangePlane (Number plane)
 
GO2SGeometry Copy ()
 
GO2SEnum::GO2SError Delete ()
 
Array< GO2SXYZDiscretize (Number accuracy=0.01)
 
Boolean Equals (GO2SGeometry other)
 
Array< GO2SXYZGetBoundingBox ()
 
Number GetColor ()
 
Array< GO2SEnum::GO2SParamGetEditableParams ()
 
Number GetLayer ()
 
Number GetLineType ()
 
Number GetLineWidth ()
 
String GetName ()
 
Number GetParam (GO2SEnum::GO2SParam param)
 
GO2SGeometry GetParent ()
 
Number GetPlane ()
 
GO2SXYZ GetPosition ()
 
Boolean IsCircular ()
 
Boolean IsLinear ()
 
Boolean IsParamEditable (GO2SEnum::GO2SParam param)
 
Boolean IsPoint ()
 
Boolean IsPositionEditable ()
 
Boolean IsSolid ()
 
Boolean IsValid ()
 
Boolean IsVisible ()
 
Boolean IsWireframe ()
 
GO2SGeometry Rotated (GO2SXYZ xyz, Number angle, Boolean xyzDir)
 
GO2SEnum::GO2SError SetColor (Number color)
 
GO2SEnum::GO2SError SetLayer (Number layer)
 
GO2SEnum::GO2SError SetLineType (ELineType type)
 
GO2SEnum::GO2SError SetLineWidth (Number width)
 
GO2SEnum::GO2SError SetName (String p1)
 
GO2SEnum::GO2SError SetParam (GO2SEnum::GO2SParam param, Number value)
 
GO2SEnum::GO2SError SetPlane (Number plane)
 
GO2SEnum::GO2SError SetPolarPosition (Number radius, Number angle, Number altitude=0)
 
GO2SEnum::GO2SError SetPosition (GO2SXYZpos)
 
GO2SEnum::GO2SError SetPosition (Number x, Number y, Number z)
 
GO2SEnum::GO2SError SetVisible (Boolean visibility)
 
String toString ()
 
GO2SEnum::GO2SError Transform (GO2SMatrix matrix)
 
GO2SGeometry Transformed (GO2SMatrix matrix)
 
GO2SGeometry Translated (GO2SXYZ origin, GO2SXYZ p)
 

Detailed Description

Base class for all kind of geometry (solid or wireframe)

Member Function Documentation

◆ ChangePlane()

GO2SEnum::GO2SError GO2SGeometry::ChangePlane ( Number plane)

Change the plane of a geometric entity. In case of a free point (not attached to an extremity for example), it will update the coordinates according to the new plane and change the plane number. So the position will not change in the 3D scene

Returns
GO2SError.success (0) if success, see GO2SError otherwise
Parameters
[in]planethe plane

◆ Copy()

GO2SGeometry GO2SGeometry::Copy ( )
Returns
a copy of an entity

◆ Delete()

GO2SEnum::GO2SError GO2SGeometry::Delete ( )

Delete the geometry from database

Returns
GO2SError.success (0) if success, see GO2SError otherwise

◆ Discretize()

Array< GO2SXYZ > GO2SGeometry::Discretize ( Number accuracy = 0.01)

Discretize the geometry

Returns
an array of dicretisation coordinates

◆ Equals()

Boolean GO2SGeometry::Equals ( GO2SGeometry other)
inline
Returns
if the geometry is equals to the other (check the bdd index)

◆ GetBoundingBox()

Array< GO2SXYZ > GO2SGeometry::GetBoundingBox ( )
Returns
the bounding box of the geometric entity

◆ GetColor()

Number GO2SGeometry::GetColor ( )
inline
Returns
the color of the geometric entity (-1 if failed)

◆ GetEditableParams()

Array< GO2SEnum::GO2SParam > GO2SGeometry::GetEditableParams ( )
Returns
an array of editable parameters

◆ GetLayer()

Number GO2SGeometry::GetLayer ( )
inline
Returns
the layer of the geometric entity (-1 if failed)

◆ GetLineType()

Number GO2SGeometry::GetLineType ( )
inline
Returns
the line type of the geometric entity (-1 if failed)

◆ GetLineWidth()

Number GO2SGeometry::GetLineWidth ( )
inline
Returns
the line width of the geometric entity (-1 if failed)

◆ GetName()

String GO2SGeometry::GetName ( )
inline
Returns
the name of the geometric entity ("" if failed or empty name)

◆ GetParam()

Number GO2SGeometry::GetParam ( GO2SEnum::GO2SParam param)

Get a parameter of the geometry if possible

Returns
the value of the parameter
Remarks
if the geometry has no parameter, the returned value is 0. The validity of the parameter can be checked calling IsParamEditable
Parameters
[in]paramthe parameter

◆ GetParent()

GO2SGeometry GO2SGeometry::GetParent ( )
Returns
the parent geometry

◆ GetPlane()

Number GO2SGeometry::GetPlane ( )
inline
Returns
the plane of the geometric entity (-1 if failed)

◆ GetPosition()

GO2SXYZ GO2SGeometry::GetPosition ( )
Returns
the position of the geometry. It can be the position of a point or the center of a circle or an ellipse

◆ IsCircular()

Boolean GO2SGeometry::IsCircular ( )
Returns
if the geometry is a circular (circle, arc, fillet...)

◆ IsLinear()

Boolean GO2SGeometry::IsLinear ( )
Returns
if the geometry is a linear (line, segment, chamfer...)

◆ IsParamEditable()

Boolean GO2SGeometry::IsParamEditable ( GO2SEnum::GO2SParam param)
Returns
if the given parameter is editable

◆ IsPoint()

Boolean GO2SGeometry::IsPoint ( )
inline
Returns
if the geometry is a point

◆ IsPositionEditable()

Boolean GO2SGeometry::IsPositionEditable ( )
Returns
if the position of the geometry is editable

◆ IsSolid()

Boolean GO2SGeometry::IsSolid ( )
inline
Returns
if the geometry is a solid

◆ IsValid()

Boolean GO2SGeometry::IsValid ( )
inline
Returns
if a geometric entity is valid

◆ IsVisible()

Boolean GO2SGeometry::IsVisible ( )
inline
Returns
if a geometric entity is visible

◆ IsWireframe()

Boolean GO2SGeometry::IsWireframe ( )
inline
Returns
if the geometry is a wire geometry

◆ Rotated()

GO2SGeometry GO2SGeometry::Rotated ( GO2SXYZ xyz,
Number angle,
Boolean xyzDir )

Rotate a geometry

Returns
the rotated geometry
var seg = GO2SGeometryUtil.GetByName('segment')[0]
var arc = GO2SGeometryUtil.GetByName('arc')[0]
var arc2 = arc.Rotated(seg.GetLastPoint(), 90, false)
arc2.SetColor(0X00FF00) // set it green
var arc3 = arc.Rotated(seg.GetDirectionOnCurve(0), 90, true)
arc3.SetColor(0XFF0000) // set it blue
Class for utilitary methods of geometric entities.
Definition GO2SGeometryUtil.hpp:11
static Array< GO2SGeometry > GetByName(String p1)
Parameters
[in]xyzcenter or axis for rotation. If considered as center, rotation is done using Z axis
[in]anglerotation angle in degree
[in]xyzDirif true, xyz must be considered as a direction, otherwise it is considered as a point

◆ SetColor()

GO2SEnum::GO2SError GO2SGeometry::SetColor ( Number color)

Set the color of a geometric entity

Returns
GO2SError.success (0) if success, see GO2SError otherwise
Parameters
[in]colorthe color, for example 0xFF0000 for blue, 0x00FF00 for green, 0x0000FF for red

◆ SetLayer()

GO2SEnum::GO2SError GO2SGeometry::SetLayer ( Number layer)

Set the layer of a geometric entity

Returns
GO2SError.success (0) if success, see GO2SError otherwise
Parameters
[in]layerthe layer

◆ SetLineType()

GO2SEnum::GO2SError GO2SGeometry::SetLineType ( ELineType type)

Set the line type of a geometric entity

Returns
GO2SError.success (0) if success, see GO2SError otherwise

◆ SetLineWidth()

GO2SEnum::GO2SError GO2SGeometry::SetLineWidth ( Number width)

Set the line width of a geometric entity

Returns
GO2SError.success (0) if success, see GO2SError otherwise

◆ SetName()

GO2SEnum::GO2SError GO2SGeometry::SetName ( String p1)

Set the name of a geometric entity

Returns
GO2SError.success (0) if success, see GO2SError otherwise
Parameters
[in]p1the name

◆ SetParam()

GO2SEnum::GO2SError GO2SGeometry::SetParam ( GO2SEnum::GO2SParam param,
Number value )

Change the parameter of the geometry if possible

Returns
GO2SError.success (0) if success, see GO2SError otherwise
Parameters
[in]paramthe parameter
[in]valuethe parameter value

◆ SetPlane()

GO2SEnum::GO2SError GO2SGeometry::SetPlane ( Number plane)

Set the plane of a geometric entity. In case of a free point (not attached to an extremity for example), it will keep the coordinates and change the plane number. So the position will change in the 3D scene

Returns
GO2SError.success (0) if success, see GO2SError otherwise
Parameters
[in]planethe plane

◆ SetPolarPosition()

GO2SEnum::GO2SError GO2SGeometry::SetPolarPosition ( Number radius,
Number angle,
Number altitude = 0 )
Returns
GO2SError.success (0) if success, see GO2SError otherwise
Parameters
[in]radiusthe radius in mm
[in]anglean angle in degree
[in]altitudethe altitude of the point

◆ SetPosition() [1/2]

GO2SEnum::GO2SError GO2SGeometry::SetPosition ( GO2SXYZpos )

Change the position of the geometry if possible

Returns
GO2SError.success (0) if success, see GO2SError otherwise

◆ SetPosition() [2/2]

GO2SEnum::GO2SError GO2SGeometry::SetPosition ( Number x,
Number y,
Number z )

Change the position of the geometry if possible

Returns
GO2SError.success (0) if success, see GO2SError otherwise
Parameters
[in]xthe new X position
[in]ythe new Y position
[in]zthe new Z position

◆ SetVisible()

GO2SEnum::GO2SError GO2SGeometry::SetVisible ( Boolean visibility)

Set the visibility of a geometric entity

Returns
GO2SError.success (0) if success, see GO2SError otherwise

◆ toString()

String GO2SGeometry::toString ( )
Returns
printable information about the geometry

◆ Transform()

GO2SEnum::GO2SError GO2SGeometry::Transform ( GO2SMatrix matrix)

Move a geometry using a matrix

Attention
this method will move the geometry itself and break the construction links

◆ Transformed()

GO2SGeometry GO2SGeometry::Transformed ( GO2SMatrix matrix)

Move a geometry using a matrix

Returns
the transformed geometry

◆ Translated()

GO2SGeometry GO2SGeometry::Translated ( GO2SXYZ origin,
GO2SXYZ p )

Translate a geometry

Returns
the translated geometry
Parameters
[in]originorigin of translation vector
[in]pend point of translation vector