GO2cam Javascript API  6.11
GO2SPolygon Class Reference

Polygon object. More...

Inheritance diagram for GO2SPolygon:
GO2SMultipleGeometry GO2SWireGeometry GO2SGeometry

Public Member Functions

 GO2SPolygon ()
 Default constructor.
 
 GO2SPolygon (GO2SXYZ center, GO2SXYZ p1, Number side, Boolean isInscribed)
 See GO2SPolygon.SetFrom2Points.
 
Number GetEdgeCount ()
 
Boolean IsInscribed ()
 
GO2SEnum::GO2SError SetEdgeCount (Number edgeNumbers)
 
GO2SEnum::GO2SError SetFrom2Points (GO2SXYZ center, GO2SXYZ p1, Number edgeNumbers, Boolean isInscribed)
 
GO2SEnum::GO2SError SetInscribed (Boolean isInscribed)
 
- Public Member Functions inherited from GO2SMultipleGeometry
Array< GO2SGeometryExplode ()
 
Number GetElementCount ()
 
GO2SXYZ GetFirstPoint () override
 
GO2SXYZ GetLastPoint () override
 
Number GetLength () override
 
GO2SXYZ GetNormalOnCurve (Number t) override
 
GO2SXYZ GetPositionOnCurve (Number t) override
 
GO2SXYZ GetProjPoint (GO2SXYZ point) override
 
Number GetT (GO2SXYZ point) override
 
GO2SXYZ GetTangentOnCurve (Number t) override
 
Boolean IsClose () override
 
- Public Member Functions inherited from GO2SGeometry
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

Polygon object.

var center = new GO2SXYZ(50,50,0)
var p = new GO2SXYZ(120,60,0)
var pl = new GO2SPolygon(center, p, 10, false)
var pl2 = pl.Copy()
pl2.SetParam(GO2SParam.radius, 20)

Member Function Documentation

◆ GetEdgeCount()

Number GO2SPolygon::GetEdgeCount ( )
inline
Returns
number of edges

◆ IsInscribed()

Boolean GO2SPolygon::IsInscribed ( )
inline
Returns
if the radius is inscribed (true) or subscribed (false)

◆ SetEdgeCount()

GO2SEnum::GO2SError GO2SPolygon::SetEdgeCount ( Number edgeNumbers)

Set number of sides

Returns
GO2SError.success (0) if success, see GO2SError otherwise
Parameters
[in]edgeNumbersedge numbers

◆ SetFrom2Points()

GO2SEnum::GO2SError GO2SPolygon::SetFrom2Points ( GO2SXYZ center,
GO2SXYZ p1,
Number edgeNumbers,
Boolean isInscribed )

Create a polygon from 2 points

Returns
GO2SError.success (0) if success, see GO2SError otherwise
Parameters
[in]centercenter of the polygon
[in]p1point defining the both the radius of the polygon and the axis on which will be the 1st corner
[in]edgeNumbersedge numbers
[in]isInscribedif true the distance center-p1 is inside the polygon (the circle is tangent to edges). if false the distance center-p1 is outside (the circle goes through corners)

◆ SetInscribed()

GO2SEnum::GO2SError GO2SPolygon::SetInscribed ( Boolean isInscribed)

Set if the radius is inscribed (true) or subscribed (false)

Returns
GO2SError.success (0) if success, see GO2SError otherwise
Parameters
[in]isInscribedSee GO2SPolygon.SetFrom2Points