DG Kernel (ActiveX) Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
What is new
Upgrading Native Apps
Licensing
Expand ModelsModels
Expand DG Kernel ControlsDG Kernel Controls
Collapse API ReferenceAPI Reference
Interface List
Vector Space
Expand General GeometryGeneral Geometry
Collapse ModelModel
Expand ViewView
Expand General ComputingGeneral Computing
Expand ViewsViews
Expand Samples and TutorialsSamples and Tutorials
Expand GraphicsGraphics
Expand Math ObjectsMath Objects
Expand DeprecatedDeprecated
Redistribution
Model Viewer
Open Source
Support
Skip Navigation LinksHome Page > API Reference > Model > Entities > Geometry > ISurfacePoint_DG Go to DGKC docs Search Documentation


ISurfacePoint_DG Interface

GetLocation
GetEntity
GetElement
GetElementDimension
GetElementType
GetElementType1
GetParentElement
GetParentElementCount
GetNormalCount
GetNormal
GetParameter

Represents a point on surface of an entity

In this update ISurfacePoint_DG can be obtained via IPick_DG.GetSurfacePointAt() call


Point_DG GetLocation()

Returns 3D coordinates of the point


IEntity_DG GetEntity()

Returns the entity, on surface of which this point is geometrically located or null if the point is outside of any surface


Object GetElement()

Let int dim = GetElementDimension()

If GetEntity().GetGeometryType() returns "BRep", the actual type of the interface returned by this method is:
IBRepVertex_DG if dim = 0
IBRepEdge_DG if dim = 1
IBRepFace_DG if dim = 2

If GetEntity().GetGeometryType() returns "Mesh", the actual type of the interface returned by this method is:
IVertex_DG if dim = 0
IVertexSegment_DG if dim = 1
ISimplex_DG if dim = 2

Example:

ISurfacePoint_DG iSurfPoint = m_iPick.GetSurfacePointAt(x, y);
IEntity_DG iEntity = iSurfPoint.GetEntity();
string strGeometryType = iEntity.GetGeometryType();
int dim = iSurfPoint.GetElementDimension();

if (strGeometryType == "BRep")
{
    if (dim == 0)
    {
        IBRepVertex_DG iVertex = iSurfPoint.GetElement() as IBRepVertex_DG;
        Point_DG pt = iVertex.GetPosition1();
    }
    else if (dim == 1)
    {
        IBRepEdge_DG iEdge = iSurfPoint.GetElement() as IBRepEdge_DG;
        Point_DG pt = iEdge.GetPointRatio(0.5);
    }
    else if (dim == 2)
    {
        IBRepFace_DG iFace = iSurfPoint.GetElement() as IBRepFace_DG;
        Point_DG pt = iFace.GetPointAtRatios(new Dg_2D(0.5, 0.5));
     }
}
else if (strGeometryType == "Mesh")
{
    double xx, yy, zz;
    if (dim == 0)
    {
        IVertex_DG iVertex = iSurfPoint.GetElement() as IVertex_DG;
        iVertex.GetVertexCoord(out xx, out yy, out zz);
    }
    else if (dim == 1)
    {
        IVertexSegment_DG iEdge = iSurfPoint.GetElement() as IVertexSegment_DG;
        IVertex_DG iVertex = iEdge.GetEnd(0);
        iVertex.GetVertexCoord(out xx, out yy, out zz);
    }
    else if (dim == 2)
    {
        ISimplex_DG iSimplex = iSurfPoint.GetElement() as ISimplex_DG;
        POSN pos = iSimplex.GetVertexPosition(0);
        IMesh_DG iMesh = (IMesh_DG)iEntity;
        iMesh.GetVertexCoord(pos, out xx, out yy, out zz);
    }
}


int GetElementDimension()

Returns the lowest dimension of the surface element where this point belongs to (incident).
It is 0 for BRep or mesh vertex, 1 for BRep or Mesh edge and 2 for BRep face or mesh simplex.


string GetElementType()

This method is a shortcut for GetElementType1(GetElementDimension())


string GetElementType1(int dim)

Returns name of the interface returned by the GetElement():

If GetEntity().GetGeometryType() returns "BRep", this method returns:
"IBRepVertex_DG" if dim = 0
"IBRepEdge_DG" if dim = 1
"IBRepFace_DG" if dim = 2

If GetEntity().GetGeometryType() returns "Mesh", this method returns:
"IVertex_DG" if dim = 0
"IEdge_DG" if dim = 1
"ISimplex_DG" if dim = 2


Object GetParentElement(int dim)

Not implemented in this release


int GetParentElementCount(int dim)

Not implemented in this release


int GetNormalCount()

Returns 1 for faces or simplexes, 2 for edges or segments, 0 for vertices


Vect_DG GetNormal(int i)

Implemented for entities with "BRep" geometry type only in this release. The returned vector has coordinates relative to the local frame of the entity. Use GetEntity() > GetLocation() > ToGlobalVector() to convert to global.


int GetParameter(out DG2D uv)

Returns the parameter in uv. Returns GetElementDimension(). The return 1 means only the first component of uv (uv.x[0]) is valid.