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 > Overview > Cross View
Cross View Sample Description

Cross View Sample

The sample demonstrates different methods of calculation and display of intersection of 3D objects with a 3D plane.

Running the application  

The application has two KernelCAD components on the form. The left control shows model of a pipe. The control on the right-hand side shows cross-section of the pipe with a plane.

Plane is rendered transparent in the left control. Position and orientation of the plane can be set arbitrary using Location and Normal edit boxes.

The Apply button updates position of the plane in 3D view

"Update Cross-Section View" button recalculates the intersection line and displays in in the right hand side control.

The implementation group gives choice of three different methods of calculation and display of the intersection.

The control on the right-hand side is pure two dimensional view when High or Mid implementation is chosen. In Low implementation mode the control in the right is three dimensional, but rotation is disabled so it is effectively two dimensional display. Pure 2D mode renders a grid to show dimensions and position. Advantage of Low level mode is that the 2D view has zoom and pan operations.

The "Approximate X Axis" group defines direction of x axis in the plane. Changing the direction will appear like rotation of 2D view around center of the window. Orientation of axes of the 2D View Frame inside the plane is shown using small axes in 3D View

Application Design

The application demonstrates three different methods of implementation: High, Mid and Low Level.

High level implementation involves the minimal amount of programming. The 2D picture is generated automatically.

Mid and low level implementation offer on the other hand more flexibility for possible modifications of the displayed scene and demonstrates access to coordinates of points on the line.

In Mid and Low level mode the intersection line is calculated in UpdateCrossSectionView() of the form/dialog using IBoolSectionEx.Execute with operation parameter set to EBooleanOperation.eBoolOpInters

Mid level implementation adds intersection line directly to the 2D View using Direct Definition method.

Low level implementation creates replicas of intersection lines using IObject_KC.Replicate and adds them without a change to 3D model of the control on the right hand side. To simulate two dimensional view Eye Frame of the view is modified to align it with normal of the cross-section plane in LowImplementation.AlignViewPlane(). Scene rotations are disabled in Init() method of the form/dialog

Implementation

C++

Visual Basic 6