DG Kernel Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
Overview of the software
What is new
Licensing
Expand ModelsModels
Expand DG Kernel ComponentsDG Kernel Components
Collapse API ReferenceAPI Reference
Interface List
Vector Space
Expand General GeometryGeneral Geometry
Collapse ModelModel
Expand ViewView
Expand General ComputingGeneral Computing
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 > Mesh Geometry > IMesh Search Documentation


IMesh(64) Interface

GetVertexIterator
GetSimplexIterator
GetVertexCoord
GetNormal
GetSimplexVertices
IsValid

IMesh interface gives basic direct access to meshed surface displayed by objects in DG Kernel models. DG Kernel mesh consists of two lists: vertices and simplexes (See IIterator). Simplexes in this product are always triangles. Each simplex connects three vertices to create a triangulated surface.

This is a read-only interface for simplified access. For more functionality see IMeshMods, IMeshEx, IMeshTopol, IVertex and ISimplex interfaces.

Mesh keeps information about normals of the surface, which are very important for correct rendering. Normals are applied at vertex points and are stored in vertices. See IVertex interface.  See also GetNormal method below.

IMesh can be queried from the correspondent ISection interface.

A standalone mesh can be created via IObjectGenerator_DG.Create("Mesh") > IMesh(64) query.

Implements also: IIterator, IMeshMods, IMeshEx, IMeshTopol, IMeshBuilder_KC, IMeshAlgor, IMeshShading_KC(64), IObject_DG

See also Morph sample, IVertex, ISimplex, Interface List


HRESULT GetVertexIterator(IIterator** iter)

Parameters

iter - [out] Returned reference to IIterator interface implemented by the list of all vertices in the mesh

Returns

S_OK in case of success.

Remarks:

Gives access to IIterator interface implemented by the list of all vertices in the mesh.


HRESULT GetSimplexIterator(IIterator** iter)

Parameters

iter - [out] Returned reference to IIterator interface implemented by the list of all simplexes in the mesh

Returns

S_OK in case of success.

Remarks:

Gives access to IIterator interface implemented by the list of all simplexes in the mesh.

 

HRESULT GetVertexCoord(POSN vertex, double* x, double* y, double* z )

Parameters

vertex - [in] position of the vertex in the vertex list of the mesh.

x, y, z - [out] - Returned coordinates of the vertex.

Returns

S_OK in case of success.

Remarks:

Returns coordinates of a vertex given by its position in the vertex list. 


HRESULT GetNormal(POSN vertex, double* vx, double* vy, double* vz )

Parameters

vertex - [in] position of the vertex in the vertex list of the mesh.

vx, vy, vz - [out] - Returned coordinates of the first normal.

Returns

S_OK in case of success.

Remarks:

Returns coordinates of normal to the surface at the vertex point. The vertex is given by its position in the vertex list. Note that when there is a singularity at the point, the surface can have several normals. In this case the first normal is returned. To obtain information about other normals use IVertex interface, which can be obtained via path: IMesh->IMeshEx->IMeshEx.GetVertex->IVertex


HRESULT GetSimplexVertices(POSN simplex, POSN* vert0, POSN* vert1, POSN* vert2 )

Parameters

simplex - [in] position of the simplex in the simplex list of the mesh.

vert0, vert1, vert2 - [out] - Returned positions of vertices of the simplex.

Returns

S_OK in case of success.

Remarks:

This method returns information about structure of the mesh, namely how vertices are joined in triples by simplexes.


HRESULT IsValid(VARIANT_BOOL* ret)

Checks for errors, including cases when some simplexes have zero area. If the mesh is invalid DG Kernel > GetModel() > IModel > IError_KC > GetError*() will return the error description