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 Links
IMeshBuilder_KC Interface

IMeshBuilder_KC Interface

SetCurrentNormal
SetCurrentColor
AddVertex
AddSimplex
AddQuad
Reset

The interface is implemented by Mesh Builder object created when this interface is queried from mesh via IMesh or other related interface. Mesh Builder is a temporary object which simplifies construction of a mesh. To save memory it is not recommended keeping a reference to this interface as it duplicates the data copied to the mesh object

Example: To build a thetrahedral:

Query IMesh > IMeshBuilder_KC and call (C#):

iBuilder.AddVertex(0, 0, 0); //0
iBuilder.AddVertex(1, 0, 0); //1
iBuilder.AddVertex(0, 1, 0); //2
iBuilder.AddVertex(0, 0, 1); //3
iBuilder.AddSimplex(0, 2, 1); //x,y plane
iBuilder.AddSimplex(0, 1, 3);
iBuilder.AddSimplex(0, 3, 2);
iBuilder.AddSimplex(1, 2, 3);
iMeshMods.FixupNormals(30, 0);    //IMesh > IMeshMods

See also Interface List


HRESULT SetCurrentNormal(double vx, double vy, double vz)

Defines the normal to be used for the following AddVertex() calls. The default is a zero vector. If normals are not supplied via this method the surface lighting may not be correct. In the case consider calling IMeshMods.FixupNormals() in the end of mesh construction process

HRESULT SetCurrentColor(float red, float green, float blue, float alpha)

Not implemented in this version


HRESULT AddVertex(double x, double y, double z, int* indxOut)

Adds the vertex to the mesh and returns its zero-based index, which one less than the number of AddVertex() calls since acquiring this interface or last Reset() call,  to be used in AddSimplex() or AddQuad() calls below


HRESULT AddSimplex(int i0, int i1, int i2)

Adds a new simplex to the mesh. i0, i1, i2 are indecies (= returned from) of the related AddVertex() calls


HRESULT AddQuad(int i0, int i1, int i2, int i3)

Adds a new simplex to the mesh. i0, i1, i2, i3 are indecies (= returned from) of the related AddVertex() calls


HRESULT Reset()

Clears all data from previous calls and returns to the initial state. This does not affect any changes to the underlying mesh done during previous calls