GO2cam Javascript API  6.11
GO2SReference Class Reference

Creation of a geometry reference. More...

Inheritance diagram for GO2SReference:
GO2SEdge GO2SFace GO2SXYZ

Public Member Functions

GO2SGeometry GetGeometry ()
 
Boolean IsOnEdge ()
 
Boolean IsOnFace ()
 
Boolean IsOnGeometry ()
 

Detailed Description

Creation of a geometry reference.

Version
6.11.204 exemple of use: // Start selection
// If user clicked on an entity
if (ref && ref.IsOnGeometry())
{
// if the reference in on a face, offset it
if (ref.IsOnFace())
{
let solid = new GO2SSolid
solid.CreateOffsetFace(ref, 10)
}
// else if it is on an edge, extract it
else if (ref.IsOnEdge())
{
let solid = ref.GetGeometry()
solid.ExtractEdge(ref)
}
// else probably wireframe, draw mid point
{
let geom = ref.GetGeometry()
if (geom.IsWireframe())
new GO2SPoint(geom.GetMidPoint())
}
}
Class to manage interactivity with GO2cam.
Definition GO2SInteract.hpp:12
static GO2SReference PickReference(String forcedMessage="")
Point object.
Definition GO2SPoint.hpp:8
Class managing solid (BRep) geometry.
Definition GO2SSolid.hpp:24
GO2SEnum::GO2SError CreateOffsetFace(GO2SFace face, Number len)

Member Function Documentation

◆ GetGeometry()

GO2SGeometry GO2SReference::GetGeometry ( )
Returns
the geometry on which the GO2SReference object is set
Remarks
when clicking on a face or edge, this function return the whole solid entity
Warning
if the GO2SReference is not on a geometry return null

◆ IsOnEdge()

Boolean GO2SReference::IsOnEdge ( )
inline
Returns
if the object refers to a solid edge

◆ IsOnFace()

Boolean GO2SReference::IsOnFace ( )
inline
Returns
if the object refers to a solid face

◆ IsOnGeometry()

Boolean GO2SReference::IsOnGeometry ( )
inline
Returns
if the object refers to a geometry for exemple, return true if set from GO2SWireGeometry.GetFirstPoint()