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 > IMeshTopol
IMeshTopol Interface

IMeshTopol(64) Interface

AddVertex
RemoveVertex
AddSimplex
RemoveSimplex

This interface allows changing structure of the mesh or even build a whole new meshed surface. 

This interface is available only in Pro or Enterprise level products, where it can be queried from IMesh interface

Methods of this interface requires a call to IModel.Update() or KernelCAD.UpdateSurface() for changes to appear in 3D view

See also Morph sample, IMesh, Interface List


HRESULT AddVertex(int* posnResult)

Parameters

posnResult - [out] - position of the newly created vertex in the vertex list of the mesh.

Returns

S_OK in case of success.
Remarks:

This methods creates a new vertex and inserts it into vertex list of the mesh. The position of the vertex is returned in  posnResult. Note: it is wrong to assume that the vertex is added at the end of the vertex list. 


HRESULT RemoveVertex(int vertex)

Parameters

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

Return Values

S_OK in case of success.
Remarks:

As the result the vertex will be removed from the vertex list. Note that this operation will not remove the adjoined simplexes and normally does not have any visual effect. 


HRESULT AddSimplex(int vert0, int vert1, int vert2, double creaseAngle)

Parameters

vert0, vert1, vert2 - [in] positions of the vertices, which will become corners of the simplex.

creaseAngle - [in] - Crease angle in degrees for automatic handling of normals at vertices of the newly added simplex.

Return Values

S_OK in case of success.
Remarks:

Will add a new simplex at the end of the simplex list. The simplex will have vertices identified by vert0, vert1 and vert2 as its corners. 

creaseAngle (degrees) is used to determine how normal at a corner of the new simplex should be handled. The algorithm is: First the normal vector of the face of the simplex is calculated. Than normal, which has the smallest angle with the face normal is found at the corner vertex. If the smallest angle is less than creaseAngle the nearest normal is averaged with the face normal. In the opposite case the face normal is added as a new normal at the vertex.

In practice creaseAngle should never be zero and rarely less than 10. It should be less than 180 and rarely greater than 90. Low values of creaseAngle reduce performance and increase memory consumption. It is recommended to experiment with this parameter. Setting creaseAngle too high values causes geometrically sharp edges not to look sharp on the screen.

It is more efficient to add any simplexes after coordinates of all vertices have been calculated. Otherwise calculated normals will be incorrect, which result in incorrect lighting of the object. To recalculate all normals in the mesh call IMeshMods.FixupNormals method.


HRESULT RemoveSimplex(int simplex)

Parameters

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

Return Values

S_OK in case of success.
Remarks:

Removes a simplex from the mesh. This operation does not remove vertices of the simplex.