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 > Delphi Samples > Patch
Patch Native Delhpi Sample

Patch Delphi Sample

Source code for Patch sample is available in Samples\Delphi folder of the installation directory. Patch is a simple form-based application, which displays a DInsight model consisting of a single patch of surface using KernelCAD ActiveX control and allows to modify geometrical parameters of the model

Running the application 

Patch application loads ArcPatch.glm located in the Models folder of the installation directory. The dialog displays parameters, which can be modified to assign any shape valid for a model with single cross-sectional element (See Elements).  To be able to compare behavior, two edges of ArcPatch.glm are not of the same type. The first edge (the right one) consists of arcs. The second edge consists of straight line elements. The first edit box "Cross-section position" specifies z coordinate for cross-sectional plane where all other parameter modifications will be applied. The next four edit boxes allow modification of coordinates of edge in the cross-section plane. Note that type of modifications is different depending whether the cross-section position is at the end ( z=0 or z=10 ) or anywhere in the middle of the axial range. 

Note that curvature can be negative. Valid range for the curvature is [-cMax, cMax], where cMax is 1/ (half distance between the edges at the current cross-section)

To enter new value of the parameters press "Apply" button. If entered values are valid, the model will change in 3D.

Implementation

All the work is done inside TPatchForm module. TPatchForm.OnFormShow() accesses necessary interfaces, controlling geometry of the model via IModel  interface, which is obtained using GetModel method of KernelCAD control.

Modifications of the surface are performed in TPatchForm.OnApply handler using SetParam methods of IElement interface..

See also KernelCAD and Delphi, Delphi Samples, Visual C++ Samples,    All samples.