KernelCAD Documentation

DInsight Home
Skip Navigation Links.
Start page
Quick Start
Installation
Overview of the software
What is new
Collapse KernelCAD ModelsKernelCAD Models
Collapse KernelCAD ComponentsKernelCAD Components
KernelCAD Control
KernelCAD .NET Control
Methods and Properties
Menu
Model Explorer
Birds Eye View
Programming
Direct User Access
Direct Operations
Interface Queries
Printing Support
Data Types
Modes of KernelCAD Control
DIObjectGenerator class
Properties
FlatObjectArray Poperty
Context
64 bit development
Dual Mode
Initialisation Context
Overlay Editor
Memory Management
Input validation
Collapse Advanced functionalityAdvanced functionality
Collapse InterfacesInterfaces
Alphabetical list
I3DGrid
I3DBugger
I3Dpt
IAxiBase
IAxis
IBoolSection
IBoolSectionEx
IBoundary
IColor
IConstraint
IData
IDiffSurface_KC
IDIFont
IDraw
IDrawUtil
IDraw2
IElem
IElement
IKCLine
ILightSource
ILocation
ILocationEx
IMaterial
IMetrics
IMetrics2
IModel
IModel2
IModelEx
IPatch
IKCPathCollisionDetector
IProfiles
IPropertyArray
IPropertyArray2
IStdShape
IStrip
ISurface
IText
ITexture
ITransform
IUnknown
Collapse Open Cascade TechnologyOpen Cascade Technology
Collapse DataData
Collapse MovementMovement
Collapse FramesFrames
Collapse Oriented ObjectsOriented Objects
Collapse SectionsSections
Collapse GeneralGeneral
Collapse Topological InterfacesTopological Interfaces
Collapse Viewing InterfacesViewing Interfaces
Collapse Lines And CurvesLines And Curves
Collapse Symmetry InterfacesSymmetry Interfaces
Collapse Clipping plane interfacesClipping plane interfaces
Collapse AlgorithmsAlgorithms
Collapse 2D Geometry2D Geometry
Collapse Programming Samples and TutorialsProgramming Samples and Tutorials
Collapse OverviewOverview
Collapse DeploymentDeployment
Collapse .NET Samples.NET Samples
Collapse C++ SamplesC++ Samples
Collapse Visual Basic SamplesVisual Basic Samples
Collapse Delphi SamplesDelphi Samples
Collapse 3D Debugger3D Debugger
Collapse DeploymentDeployment
Licensing
Model Viewer
Open C++ Source
Technical Support
Skip Navigation LinksHome Page > KernelCAD Components > Interfaces > Sections > Mesh interfaces > IMesh
IMesh Interface

IMesh(64) Interface

GetVertexIterator
GetSimplexIterator
GetVertexCoord
GetNormal
GetSimplexVertices
IsValid

IMesh interface gives basic direct access to meshed surface displayed by objects in KernelCAD models. KernelCAD 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.

See also Morph sample, IIterator, IMeshMods, IMeshEx, IMeshTopol, 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(int 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(int 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(int simplex, int* vert0, int* vert1, int* 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 KernelCAD > GetModel() > IModel > IError_KC > GetError*() will return the error description