GO2cam Javascript API  6.11
GO2SNurbs Class Reference

Nurbs object. More...

Inheritance diagram for GO2SNurbs:
GO2SSimpleGeometry GO2SWireGeometry GO2SGeometry

Public Member Functions

 GO2SNurbs ()
 Default constructor.
 
 GO2SNurbs (Array< GO2SXYZ > pts, Boolean reorder=false, Number close=-1)
 
GO2SEnum::GO2SError SetFromPoints (Array< GO2SXYZ > pts, Boolean reorder=false, Number close=-1)
 
GO2SEnum::GO2SError SetFromPointsWClose (Array< GO2SXYZ > pts, Boolean close)
 
GO2SEnum::GO2SError SetFromPointsWTangency (Array< GO2SXYZ > pts, Boolean tgStart, Boolean tgEnd)
 
Array< GO2SSimpleGeometryToArcAndSegment (Number tol, Number rmax)
 
- Public Member Functions inherited from GO2SSimpleGeometry
Array< GO2SGeometryCut (GO2SXYZ pt)
 
GO2SXYZ GetCenterPoint ()
 
GO2SXYZ GetDirectionOnCurve (Number t)
 Deprecated, use GetTangentOnCurve.
 
GO2SXYZ GetFirstPoint () override
 
GO2SXYZ GetLastPoint () override
 
Number GetLength () override
 
GO2SXYZ GetMidPoint ()
 
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
 
GO2SGeometry Trim (Boolean keepStart, GO2SXYZ endTrim)
 
- 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

Nurbs object.

Constructor & Destructor Documentation

◆ GO2SNurbs()

GO2SNurbs::GO2SNurbs ( Array< GO2SXYZ > pts,
Boolean reorder = false,
Number close = -1 )

See GO2SNurbs.SetFromPoints

var pts = []
pts.push(new GO2SXYZ(0, 0, 0))
pts.push(new GO2SXYZ(12, 5, 0))
pts.push(new GO2SXYZ(15, 10, 0))
pts.push(new GO2SXYZ(20, 20, 0))
var nurbs = new GO2SNurbs(pts, false, -1)

Member Function Documentation

◆ SetFromPoints()

GO2SEnum::GO2SError GO2SNurbs::SetFromPoints ( Array< GO2SXYZ > pts,
Boolean reorder = false,
Number close = -1 )

Compute a nurbs passing by all given points

Warning
no construction history is kept, only XYZ coordinates of pts are considered
Returns
GO2SError.success (0) if success, see GO2SError otherwise
Parameters
[in]ptsthe points
[in]reorderif true, points will be reodered automatically
[in]closeif the points represent a close nurbs or not - -1 does not know if the list of points represents a closed or open curve
  • 0 the list of points represents an open curve
  • 1 the list of points represents a closed curve

◆ SetFromPointsWClose()

GO2SEnum::GO2SError GO2SNurbs::SetFromPointsWClose ( Array< GO2SXYZ > pts,
Boolean close )

Compute a nurbs passing by all given points, with close option

Returns
GO2SError.success (0) if success, see GO2SError otherwise
Parameters
[in]ptsthe points supposed to be ordered
[in]closedo we close the nurbs

◆ SetFromPointsWTangency()

GO2SEnum::GO2SError GO2SNurbs::SetFromPointsWTangency ( Array< GO2SXYZ > pts,
Boolean tgStart,
Boolean tgEnd )

Compute a nurbs passing by all given points, with tangency option

Returns
GO2SError.success (0) if success, see GO2SError otherwise
Parameters
[in]ptsthe points supposed to be ordered
[in]tgStartdo we keep the tangency on first point (suppose that the GO2SXYZ object is not only 3D coordinates)
[in]tgEnddo we keep the tangency on last point (suppose that the GO2SXYZ object is not only 3D coordinates)

◆ ToArcAndSegment()

Array< GO2SSimpleGeometry > GO2SNurbs::ToArcAndSegment ( Number tol,
Number rmax )

Interpolate the curve by arcs and segments

Returns
GO2SError.success (0) if success, see GO2SError otherwise
Parameters
[in]toltolerance for interpolation
[in]rmaxmaximum radius of arcs.