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 > .NET Samples > C# Samples > Strip Topology Sample
CS StripTopol Sample

Strip Topology C# Sample

Source code for Strip Topology sample is available in Samples\NET\C# folder of the installation directory. If you are going to compile the project we suggest to copy whole C# directory to location outside of the installation folder. StripTopol is a simple Windows Forms application, which demonstrates topological operations performed programmatically on strips of surface patches. 

See also Visual C++ Strip Topology Sample, C# Samples, All samples

Running the application

On load the application displays the default model (cube). For simplicity the application displays and modifies information related to the first top level object in the model (see Structure of DInsight models). Controls on the right display properties of the surface strip in the object. Joint edit boxes allow modification of the current joint. In case of Generic 3D Section the modification will be applied at the current z position, which is in the middle by default.

The menu contains topological commands which modify structure of the surface strip. It is important to remember that edges are numbered in CCW direction when looking from the end of the local Z axis. Number of a surface patch is the number of its first edge in the same direction.

New Knot command allows increasing number of knots in the axial base hence increasing degree of freedom for modifications along z axis. Note that this command has no meaning for Surface Of Revolution objets as those do not have axial base.

File submenu allows saving and loading models.

Implementation

Similar to MiniCAD sample retrieving parameters of the model and their modification is done in Update...() set of methods of StripTopForm class. The key interface IStripTopol is retrieved in UpdateSectionInfo() from IStrip interface of the current object and stored in m_pIStripTopol member variable. All topological commands except "New Knot" end with a call to a method of IStripTopol. 

Method menuItemNewKnot_Click(), which is the "New Knot" command handler, retrieves IArray interface implemented by the object via IAxiBase. Actual insertion is performed in AxiBaseDlg::OnOK() handler with a call to InsertAt() method of IArray.

Suggested Exercises

1. Modify AxiBaseForm class to allow entering position of a new knot.

2. Add ability to change the current object in the model. See MiniCAD and ObjArray samples

3. Add ability to switch between wire frame and solid display modes.