KernelCAD Documentation

DInsight Home
Skip Navigation Links.
Start page
Quick Start
Installation
Overview of the software
What is new
Collapse KernelCAD ModelsKernelCAD Models
Model Structure
Securing Models
Collapse Import/ExportImport/Export
Import and Export
Collapse Adanced Data ExchangeAdanced Data Exchange
Data Flow Sample
STL Tree
IDataContext Interface
ISTLDataContext Interface
Collapse Scene ItemsScene Items
Items
3D Text
Smart Labels
View Points
Collapse MeasurementsMeasurements
Measurements
Persistent Measurements
Grid
Collapse SectionsSections
Sections
Section Types
Collapse 2D2D
Overlays
2D Models
2D Items
Point Sets
Collapse Line and Curve SectionsLine and Curve Sections
Line Strips
Line Section
3DS Curves
Collapse Surface and Solid SectionsSurface and Solid Sections
Surfaces
Collapse Mesh SectionsMesh Sections
Mesh Section
Mesh
Surface Of Revolution
BRep 3D Objects
Collapse BRep BSpline objectsBRep BSpline objects
Bspline objects
BSpline Faces
BRep Section
Pipes
Collapse 3DS Sections3DS Sections
3D Section
Profiles
Surface Patches
Surfaces and Patch Strips
Collapse AttributesAttributes
Material
Clipping Planes
Symmetries (Arrays)
Textures
Collapse OperationsOperations
Boolean Operations
Surface Trim
Cut Surface
Collapse MovementsMovements
Movements
Kinematic Sections
Collision Detection
3D Grid
Collapse Mathematical ObjectsMathematical Objects
Pure Geometric Objects
Points and Vectors
Planes
Collapse CurvesCurves
Straight Lines
3D Circle
Ellipse
Free-Form Curves
Arc Spline Curves
Frames
Transfroms
Oriented Boxes
Collapse 2D Elements2D Elements
Geometric Elements
Arcs
Line Strips
Collapse Basics of 3D GraphicsBasics of 3D Graphics
Concepts
3D View
2D View
Viewing Volume
Birds Eye View
Viewing Plane
Perspective View
Background
Collapse AlgorithmsAlgorithms
Euclidean Shortest Path
Collapse User DataUser Data
Layers
Object User Data
Model User Data
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
Topological Modifications
Programming commands
Dynamic model restructuring
Dynamic Object Creation
Generator of 3D Sections
Generator of SOR Objects
Model class
Selection
Selection Event
External Models
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
IKO_Standard_Object
IKO_Model
IKO_TopExp_Explorer
Collapse BRepExtremaBRepExtrema
IKO_BRepExtrema_DistShapeShape
Collapse Geom2dGeom2d
IKO_Geom_CylindricalSurface
IKO_Geom_ElementarySurface
IKO_Geom2d_Circle
IKO_Geom2d_Conic
IKO_Geom2d_Curve
IKO_Geom2d_Geometry
IKO_Geom2d_Line
Collapse GeomGeom
IKO_Geom_BSplineCurve
IKO_Geom_BSplineSurface
Collapse GPGP
IKO_gp_Ax1
IKO_gp_Ax2
IKO_gp_Ax22d
IKO_gp_Ax2d
IKO_gp_Ax3
IKO_gp_Circ2d
IKO_gp_GTrsf2d
IKO_gp_Lin2d
IKO_gp_Mat2d
IKO_gp_Object
IKO_gp_Sphere
IKO_gp_Cone
IKO_gp_Torus
IKO_gp_Trsf
IKO_gp_Cylinder
IKO_gp_Pln
IKO_gp_Circ
IKO_gp_Trsf2d
Collapse GeomAPIGeomAPI
IKO_GeomAPI_PointsToBSpline
IKO_GeomAPI_Interpolate
Collapse TColStdTColStd
IKO_TColStd_Array1
IKO_TColStd_Array1OfInteger
Collapse TColgpTColgp
IKO_TColgp_Array1OfPnt
IKO_TColgp_Array1OfVec
Collapse BRepBRep
IKO_BRep_Builder
Collapse BRepBuilderAPIBRepBuilderAPI
IKO_BRep_Builder
IKO_BRepBuilderAPI_MakeWire
IKO_BRepBuilderAPI_MakeEdge
Collapse BRepOffsetAPIBRepOffsetAPI
IKO_BRepOffsetAPI_ThruSections
Collapse BRepPrimAPIBRepPrimAPI
IKO_BRepPrimAPI_MakePrism
Collapse ModModelingAlgorithmsModModelingAlgorithms
IKO_BRepGProp_Face
Collapse TopoDSTopoDS
IKO_TopoDS_Shape
IKO_TopoDS_Edge
IKO_TopoDS_Face
IKO_TopoDS_Wire
Collapse DataData
Collapse Import / ExportImport / Export
IDataConvert_KC
ICADFormat_KC
IDataContext
ISTLDataContext
IFormatVersionDataContext
Collapse User Data User Data
ILayers
IDataSource
IDataTable
IRecordSet
IDataMods
IUserData
IMatrixData
Collapse MovementMovement
IKinematicSection_KC
IMove_KC
IKinematicSet_KC
ICutEffect_KC
ISpinEffect_KC
Collapse FramesFrames
I3DObject
IFrame
IFrame2
IFrame3
IFrameEx
Collapse Oriented ObjectsOriented Objects
IObjectOriented
ISphere_KC
IBox
Collapse SectionsSections
Collapse ItemsItems
IItem
ILabel3D_KC
IDynamicScreenItem_KC
IDynamicScreenItemManager_KC
ISmartLabelManager_KC
ISection
ISection2
ISectionPointSet
ISectionLineStrip
ITextSection_KC
IPipeSection
ILineSection_KC
IObjectPosition_KC
ISticky_KC
ILabelSection_KC
IModelHealer_KC
IPointCloud_KC
IProfiledElement_KC
Collapse Mesh interfacesMesh interfaces
IMesh
IMeshTopol
ISimplex
IMeshMods
IVertex
IMeshEx
IIterator
IMeshPointKC
ISurfacePointKC
ISurfaceMetric_KC
IVertexEx_KC
IEdge_KC
ISimplexEx_KC
IMeshAlgor
IMeshShading_KC
Collapse GeneralGeneral
Collapse Collections InterfacesCollections Interfaces
IArray
IArray2
IList
IListUnkn_KC
IRelation
IArrayNum
IArray3D
IRefMap_KC
IObject_KC
ITypeBasic_KC2
IModelSearch_KC
IBitmap
IBlob
IKCContext
IKCContext2
IError_KC
IKCStack
ILineStyle_KC
IMenu_KC
IMenuItem_KC
IGlobalAPI_KC
IControlInitialisationContext_KC
IRange
IRectangleAxisAligned_KC
Collapse Topological InterfacesTopological Interfaces
IStripTopol
I3DSectionGenerator
ISORSectionGenerator 
IDIObjGenerator
Collapse Viewing InterfacesViewing Interfaces
IView
IView2
IViewPoint
IViewPointArray
ILookAt
IViewModal
ILook
ILookEx
IMeasurement_KC
IPick
ISelection_KC
IRectangleColor_KC
I2DView_KC
I2DView2_KC
I2DEditor_KC
IPrint_KC
IVirtualView
IGraphicItem
Collapse Lines And CurvesLines And Curves
ILine
ILineGeom
ILineMetr
ICurve
ICurveFreeForm
ICurveFreeFormEx
IArcSpline3DCurve
IArc
IArcEx
ICircle3D_KC2
IEllipse_KC
Collapse Symmetry InterfacesSymmetry Interfaces
ISymmetries
ISymmetry
IAxialSymmetry
Collapse Clipping plane interfacesClipping plane interfaces
IClipArray
IClipPlane
Collapse AlgorithmsAlgorithms
IEuclideanShortestPath_KC
Collapse 2D Geometry2D Geometry
ILine2D
IArc
IArcEx
IStripArcLine_KC
Collapse Programming Samples and TutorialsProgramming Samples and Tutorials
Collapse OverviewOverview
Sample List
3DBugger
BoolOp
PlanarOps
Calculator
Capture
Cannon
Clip
Cloud
Collision
Collision Path
Cross View
Data Flow
Data Flow
Deploy Tutorial
DiffSurface
Direct User Access Demo
DIView
eMotion
Euclidean Shortest Path
Gear
Label
LabelEx
Layers
Light
Lines
LowDim
Make Your Move
Measure
Mesh Mods
MeshOps
Metrics
MiniCAD
Modal
Modeling Curves
Morph
Object Array
Overlay
Patch
Patchwork
Pick
Point Of View
BoolOp
Profile
Rotation
Pipes
Layers
Shape Explorer
Smart Labels
Strip Topology
Surface Metrics
Symmetry
Transform
Texture
Turbine
TwoD
User Data
View Point
WpfCAD
Zoom
Collapse DeploymentDeployment
Deploy Tutorial
DeployModule
DeployWixBasic
WixDeploy
Collapse .NET Samples.NET Samples
Collapse C# SamplesC# Samples
Patch Tutorial
MiniCAD Sample
Strip Topology Sample
DI View Sample
Modal View Sample
Modeling Curves
Label
LabelEx
Pick
Object Array
Data Flow
Profile
Cross View
Low Dim
Morph
Clip
BoolOp
Collision
Collision Path
3DBugger
Data Flow
Shape Explorer
Smart Labels
Symmetry Sample
Cannon
View Point Sample
Capture
User Data
Layers
Zoom
Collapse Visual Basic SamplesVisual Basic Samples
Patch Tutorial
DI View Sample
MiniCAD Sample
Object Array Sample
BoolOp
Data Flow
Pipes
Transform
Measure
Mesh Mods
Mesh Ops
Metrics
Morph
TwoD
eMotion
Cross View
3DBugger Tutorial
Collision
Collision Path
Light
Patchwork
Capture
Collapse WPFWPF
Clip
Mesh Ops
Measure
Lines
LowDim
WPF
Patch
Collapse Delphi SamplesDelphi Samples
3DBugger
BoolOp
Calculator
Patch Sample
Modelling Curves
MiniCAD Sample
Morph
Shape Explorer
Object Array
Metrics
Cannon
Pipes
Patchwork
Collision
Collapse C++ SamplesC++ Samples
3DBugger
BoolOp
Cannon
Capture
Cloud
Collision
Collision Path
Cross View
DI View Sample
eMotion
Gear Sample
Label
LabelEx
Light Sample
Measure
Mesh Ops
MiniCAD Sample
Modal Sample
Modeling Curves
Object Array Sample
Overlay Sample
Patch Tutorial
Pick
Point Of View
Planar Ops
Rotation Sample
Profile Sample
Shape Explorer
Smart Labels
Strip Topology Sample
Layers
Lines
LowDim
Metrics
Metrics2
Morph Sample
Patchwork
Pipes
Symmetry Sample
Texture Sample
Transform
TwoD
Turbine Sample
User Data
View Point Sample
Zoom Sample
Collapse Visual Basic SamplesVisual Basic Samples
Patch
DI View
MiniCAD
Data Flow
Cross View
Cloud
Planar Ops
Calculator
Light
Pick
Object Array
Label
Symmetry
Transform
Morph
Line Strip
Capture
Collapse Delphi SamplesDelphi Samples
KernelCAD and Delphi
3DBugger
Data Flow
BoolOp
Calculator
Cannon
Collision
Label
LabelEx
Metrics
MiniCAD
ModelingCurves
Object Array
Patch
Patchwork
Pipes
Collapse 3D Debugger3D Debugger
Creating and editing models
Editing Generic 3D Objects
Topological Commands
Model Explorer
Export / Import
Modeling Tips
3D Debugger
Collapse EditorsEditors
Form View
3D View
Collapse 2D Editors2D Editors
Crossection View
Profile View
Drum View
Collapse DialogsDialogs
3D Curve Dialog
Symmetry Collection Editor
Clip Editor
Material Editor
Surface options dialog
Collapse Modelling TutorialsModelling Tutorials
Table Tutorial
Mouse Tutorial
Collapse DeploymentDeployment
Redistribution
Registration
Deploy Module Tutorial
WixDeploy Tutorial
DeployWixBasic
Deploy Tutorial
Licensing
Model Viewer
Open C++ Source
Technical Support
Skip Navigation LinksHome Page > KernelCAD Components > Interfaces > IBoolSectionEx
IBoolSectionEx Inteface

IBoolSectionEx Interface

IBoolSectionEx interface is an enhanced version of IBoolSection, which returns information about the intersection curve of the two objects.

See also Cross View sample and BoolOp Sample


HRESULT Execute( EBooleanOperation operation, ISection* object, VARIANT_BOOL createIntersLine, IArray** edges )

Parameters

operation - [in] member of EBooleanOperation enumeration indicating the operation to perform

object - [in] reference to the second object for the operation. (The first object is the section which implements this IBoolSectionEx interface)

createIntersLine - [in] If true a set of Line Strip objects representing intersection line will be created and added as child of the first section (the section where this interface was queried form). See remarks for more details

edges - [out, retval] Array of isolated intersection loops. Each element has type IArray, elements in the later array have type IVertex. See remarks

Remarks

Performs operation indicated by operation on the section where this IBoolSectionEx was queried from and object. This method also allows performing subtraction of a programmatically defined plane from the object. See details in Planar Subtract.

If createIntersLine parameter is true a new empty object will be created and added as new child of the first section. The object will act as a group (container for its children). The objects will have one or more child objects of Line Strip type one per linked piece of intersection. For example, subtraction of a long and thin cylinder from a sphere will have two closed isolated intersection loops. In that case the newly added object will have two children one per each intersection loop. Coordinates of points in the lines and other information can be obtained via ISectionPointSet and ISectionLineStrip queried form the relevant child. See BoolOp Sample for an example.

The returned edges array contains information abut the isolated linked intersection loops. Each loop is an array (IArray) of IVertex elements, which can be used to obtain coordinates and normals to the surface at the intersection points.  See Cross View sample for an example. This calculation is not performed and NULL will be returned if createIntersLine is false.

IVertex obtained above contains all normals to the resulting surface. The most frequent case when two surfaces are smooth around the intersection curve the vertex contains two normals on the left (side of surface of the first object, where this interface was queried form) and right hand side of the intersection curve. Often there are several normals on each side, for example when intersection curve crosses an edge of either surface. In some cases (planar subtract or case when the second object is not a closed surface and edges do not intersect) the intersection curve becomes an edge of the resulting surface, so the vertex can have only single normal, the one which belongs to the first surface.

To find out which normals in the vertex belong to which side of the curve query IUserData from the IVertex and call IUserData.GetData. The returned cnt number is count of normals which belong to the first surface (normals on the left). Normals 0 to cnt-1 in the vertex belong to the first surface, the rest belong to the second surface.


HRESULT STDMETHODCALLTYPE Execute2( ISection* object, EBoolOpContext* context )

Parameters

object - [in] reference to the second object for the operation. (The first object is the section which implements this IBoolSectionEx interface)

context - [in, out] - additional input and output parameters for the operation. See remarks

Remarks

Performs operation indicated by context.operation on the section where this IBoolSectionEx was queried from and object. This method also allows performing subtraction of a programmatically defined plane from the object. See details in Planar Subtract.

If context.execute is false, only intersection loops are calculated and the Boolean operation is not executed, which significantly improves performance.

If context.intersectionLine is true a new empty object will be created and added as new child of the first section. The object will act as a group (container for its children). The objects will have one or more child objects of Line Strip type one per linked piece of intersection. For example, subtraction of a long and thin cylinder from a sphere will have two closed isolated intersection loops. In that case the newly added object will have two children one per each intersection loop. Coordinates of points in the lines and other information can be obtained via ISectionPointSet and ISectionLineStrip queried form the relevant child. See BoolOp Sample for an example.

If context.needEdges is true context.edges will contain information abut the calculated intersection curve. This calculation is not performed context.intersectionLine is false. The curve consists of the isolated linked intersection loops. Each loop is an array (IArray) of IVertex elements, which can be used to obtain coordinates and normals to the surface at the intersection points. See remarks for the previous method for more details. See Cross View sample for an example.

context.edges array must be created by the caller. To create the array call Create or Create2 method of IDIObjectGenerator interface with parameter eType set to eObjTypeArray member of EObjectType enumeration. Query IArray  from the returned IUnknown interface. After call to this Execute2() method the array will contain elements which in turn are arrays too. More exactly arrays of vertices.

If separateComponents is true and the first object becomes divided into several isolated pieces, the pieces will become separate objects. The initial first object will be replaced with one if the pieces. The other pieces will be added as new children of the first object. Selection of pieces for the parent and children is random.

Note: All elements of the context structure must be initialized before the call. Details


HRESULT STDMETHODCALLTYPE CreateExtendedContext( IDictionary_KC** contextExt)

Parameters

contextExt - [out, retval] The created and returned context

Remarks

Creates a context with extra options for the Execute3 method below. All parameters have the default values


HRESULT Execute3( EBooleanOperation operation, ISection** object, IDictionary_KC* contextExt)

Parameters

operation - [in] member of EBooleanOperation enumeration indicating the operation to perform

object - [in] reference to the second object for the operation. (The first object is the section which implements this IBoolSectionEx interface)

contextExt - [in] A null reference or a context created by the CreateExtendedContext() method above, which contains additional options for the operation. See remarks

Remarks

Performs operation specified by operation on the section where this IBoolSectionEx was queried from and object. The significant difference with the Execute2 method is that the InclideChildren* properties below, allow boolean operations on groups of objects

contextExt has the following parameters:

Name Type Description Default Value
OperationID Integer Valie must coinside with one of EBooleanOperation enumeration. Overrides value specified by operation EBooleanOperation.eBoolOpSubtract
CreateLine Boolean If true intersection line of the two surfaces will be added to the model. See comments for the  createIntersLine parameter above for details false
IntersectionLineOnly Boolean If true only intersection line is calculated false
ReturnIntersection Boolean Same as context.needEdges parameter above false
SeparateComponents Boolean Same as separateComponents parameter above false
EdgeArray Variant IArray created by the caller. See comments for the context.edges parameter above null
IncludeChildrenThis Boolean If true children and all other descendants of the first (this) object will be included in the operation false
IncludeChildrenOther Boolean If true children and all other descendants of object will be included in the operation false


HRESULT Clip(IObjectOriented* objectClipper, VARIANT_BOOL needTopLinkedComponentOnly)

Parameters

objectClipper - [in] The object to be clipped with
needTopLinkedComponentOnly - [in] See remarks

Remarks

Clips the object, which implements this interface with objectClipper

needTopLinkedComponentOnly has effect only when objectClipper has natural diection of its internal area. In the initial implementation this is used for the case of an infinite prizm build on a polygon in x and y axes, so z axis defines a positive direction

After the operation the resulting surface is often split into isolated pieces (A sphere clipped with a thin infinite triangular prizm around the center). When the pieces have non-overlapping distinct ranges they are arranged along z axis

In this situation if needTopLinkedComponentOnly is true only the one with max z will be the result of the operation. Otherwise all components will be merged into the final object


HRESULT Clip2(IObjectOriented* objectClipper, IListT** listISection)

Parameters

objectClipper - [in] The object to be clipped with
listISection - [in] See remarks

Remarks

Calculates the result of cliping this object (the object, which implements this interface) with objectClipper

Does not modify this object. listISection contains linked pieces of the result. See also the previous method