GO2cam Javascript API  6.11
GO2SStock Class Reference

Stock object. More...

Inheritance diagram for GO2SStock:
GO2SSolidGeometry GO2SGeometry

Public Member Functions

 GO2SStock ()
 Create an empty stock object.
 
GO2SEnum::GO2SError CreateMillingCuboid (Number lenght, Number width, Number height, GO2SXYZ pos)
 
GO2SEnum::GO2SError CreateMillingCylinder (Number height, Number radius, GO2SXYZ pos, GO2SEnum::GO2SAxis axis)
 
GO2SEnum::GO2SError CreateMillingSolid (GO2SSolidGeometry solid)
 
GO2SEnum::GO2SError CreateTurning (Number length, Number diameter, Number origine, Number innerDiameter=0, Number nbSides=0)
 
GO2SEnum::GO2SError CreateTurningProfile (GO2SProfile profile)
 
GO2SEnum::GO2SError GetExistingStock ()
 
- Public Member Functions inherited from GO2SSolidGeometry
Number GetSurface ()
 
Number GetVolume ()
 
GO2SMesh ToMesh (Number tol=0.1)
 
- 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

Stock object.

Member Function Documentation

◆ CreateMillingCuboid()

GO2SEnum::GO2SError GO2SStock::CreateMillingCuboid ( Number lenght,
Number width,
Number height,
GO2SXYZ pos )

Create a cuboid stock for milling

var pos = new GO2SXYZ(0,0,-50)
var stock = new GO2SStock
stock.CreateMillingCuboid(100, 80, 50, pos)
Stock object.
Definition GO2SStock.hpp:8
GO2SEnum::GO2SError CreateMillingCuboid(Number lenght, Number width, Number height, GO2SXYZ pos)
Creation of a coordinate reference.
Definition GO2SXYZ.hpp:81
Returns
GO2SError.success (0) if success, see GO2SError otherwise
Remarks
if a stock already exists, it will be replaced
Parameters
[in]lenghtlength of the stock (dimension along X axis)
[in]widthwidth of the stock (dimension along Y axis)
[in]heightheight of the stock (dimension along Z axis)
[in]posposition of the center of the bottom face of the stock

◆ CreateMillingCylinder()

GO2SEnum::GO2SError GO2SStock::CreateMillingCylinder ( Number height,
Number radius,
GO2SXYZ pos,
GO2SEnum::GO2SAxis axis )

Create a cylinder stock for milling

var pos = new GO2SXYZ
var stock = new GO2SStock
stock.CreateMillingCylinder(100, 30, pos, GO2SAxis.z)
GO2SEnum::GO2SError CreateMillingCylinder(Number height, Number radius, GO2SXYZ pos, GO2SEnum::GO2SAxis axis)
Returns
GO2SError.success (0) if success, see GO2SError otherwise
Remarks
if a stock already exists, it will be replaced
Parameters
[in]heightheight of the stock (dimension along axis)
[in]radiusradius of the stock
[in]posposition of the center of the bottom face of the stock (axis origin)
[in]axisaxis of the cylinder

◆ CreateMillingSolid()

GO2SEnum::GO2SError GO2SStock::CreateMillingSolid ( GO2SSolidGeometry solid)

Create a milling stock from an existing solid

var pos = new GO2SXYZ
var cone = GO2SSolidCreate.Cone(pos, 100, 50, 80)
var stock = new GO2SStock
stock.CreateMillingSolid(cone)
Helper class to create solid.
Definition GO2SSolid.hpp:308
static GO2SSolid Cone(GO2SXYZ center, Number radiusBase, Number radiusTop, Number height)
See GO2SSolid.CreateCone.
GO2SEnum::GO2SError CreateMillingSolid(GO2SSolidGeometry solid)
Returns
GO2SError.<success (0) if success, see GO2SError otherwise
Remarks
if a stock already exists, it will be replaced
the solid will be deleted
Parameters
[in]solidthe solid

◆ CreateTurning()

GO2SEnum::GO2SError GO2SStock::CreateTurning ( Number length,
Number diameter,
Number origine,
Number innerDiameter = 0,
Number nbSides = 0 )

Create a turning stock from a profile

Returns
GO2SError.<success (0) if success, see GO2SError otherwise
Remarks
if a stock already exists, it will be replaced
Version
6.11.205
Parameters
[in]lengthlength of the stock
[in]diameterradius of the stock
[in]origineorigine of the stock along revolution axis
[in]innerDiameterinner diameter
[in]nbSidesnumber of sides. If 0, the stock is a cylinder

◆ CreateTurningProfile()

GO2SEnum::GO2SError GO2SStock::CreateTurningProfile ( GO2SProfile profile)

Create a turning stock from a profile

Returns
GO2SError.<success (0) if success, see GO2SError otherwise
Remarks
if a stock already exists, it will be replaced
Parameters
[in]profilethe profile

◆ GetExistingStock()

GO2SEnum::GO2SError GO2SStock::GetExistingStock ( )

Get the existing stock

var stock = new GO2SStock
stock.SetParam(GO2SParam.length, 200)
Class to manage interactivity with GO2cam.
Definition GO2SInteract.hpp:12
static void UpdateAll()
Update geometry and machining.
GO2SEnum::GO2SError GetExistingStock()
Returns
GO2SError.success (0) if success, see GO2SError otherwise