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 > Programming Samples and Tutorials > Visual Basic Samples > Calculator
Calculator VB Sample

Calculator Sample

The Calculator sample demonstrates usage of KernelCAD component as a geometric calculations engine, which does not have to have a visible user interface. 

The applications performs three different types of calculations related to an arbitrary three dimensional ray represented with ILine interface

See also:  All Visual Basic samples,   All samples

Running the application 

The Line groups of controls allows modification of location and direction of the line (ray). The application solves three different problems: 

1. Calculation of rotation of a 3D point around the line
2. Calculation of intersection point of the line with an arbitrary plane
3. Calculation of distance from a 3D point to the line and calculation of the nearest point.
 
Selection of the current problem is made in the Operation group of controls. 

Depending on the current problem the Input/Point group allows entering either location of the initial point or position of the plane. When Intersection option is selected Input group contains Normal group, which allows changing orientation of normal of the plane. 

Implementation

The above calculations are performed with the help of ILineGeom interface. ILineGeom is obtained from ILine interface in Form_Load Sub. ILine itself is created as a new object independent of any 3D view with the help of Object Generator, instance of which is created using its Program ID and CreateObject API.

Location and direction of the line is modified via ILine/a> interface stored in a form variable.