DG Kernel Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
Overview of the software
What is new
Licensing
Collapse ModelsModels
Collapse DG Kernel ComponentsDG Kernel Components
Collapse API ReferenceAPI Reference
Interface List
Vector Space
Collapse General GeometryGeneral Geometry
Collapse ModelModel
Collapse ViewView
Collapse General ComputingGeneral Computing
Collapse Samples and TutorialsSamples and Tutorials
Collapse GraphicsGraphics
Collapse Math ObjectsMath Objects
Collapse DeprecatedDeprecated
Redistribution
Model Viewer
Open Source
Support
Skip Navigation Links Search Documentation


Calculator Sample

The Calculator sample demonstrates usage of DG Kernel 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 interentity 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 Interentity 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.