DG Kernel (ActiveX) Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
What is new
Upgrading Native Apps
Licensing
Collapse ModelsModels
Models
Persistence
Model Properties
Collapse EntitiesEntities
Collapse GeometryGeometry
Geometry
Collapse BRepBRep
BRep Overview
BRep Geometry
Shapes
Curves
Surfaces
Faces
Wires
Edges
Compounds
Collapse MeshMesh
Mesh Geometry
Mesh
BRep to Mesh Conversion
Curve Geometry
Line Strips
Point Sets
Overlays
Collapse AttributesAttributes
Local Frame
Appearance
Texture
Properties of an Entity
Collapse Model ItemsModel Items
Items
3D Text
Smart Labels
View Points
Collapse MeasurementsMeasurements
Measurements
Persistent Measurements
Grid
Collapse Operations and AlgorithmsOperations and Algorithms
Boolean Operations
Euclidean Shortest Path
Collapse MovementMovement
Movements
Kinematic Entities
Collision Detection
Collapse Import/ExportImport/Export
Import/Export Overview
Data Flow Sample
STL Tree
Collapse DG Kernel ControlsDG Kernel Controls
Components
DG Kernel Control
Collapse Properies, Methods, EventsProperies, Methods, Events
Properies
Methods
Events
Collapse Interactive FunctionalityInteractive Functionality
View
Context Menu
Measurements
Direct User Access
Modes of DG Kernel
Current Entities
Collapse Selection OverviewSelection Overview
Selection
Selection Event
Collapse Auxiliary ViewsAuxiliary Views
Model Explorer
Birds Eye View
Full Screen window
Collapse Programmatic FunctionalityProgrammatic Functionality
Programming
Queries
Data Types
Object Construction
Generator
Component Context
Initialisation Context
Collapse API ReferenceAPI Reference
Interface List
Vector Space
Collapse General GeometryGeneral Geometry
IPointArray_DG
IPointMatrix_DG
IPointCloud_DG
Collapse CurvesCurves
ICurve_DG
ILine_DG
ICircle_DG
IEllipse_DG
IBSplineCurve_DG
IBSplineCurveInterpolator_DG
ICurveFreeForm_DG
IArcSpline3DCurve_DG
Collapse 2D2D
ICurve2d_DG
IBSplineCurve2d_DG
ICircle2d_DG
ILine2d_DG
IArc_DG
Collapse SurfacesSurfaces
IUVSurface_DG
IPartialSplineProps_DG
IBSplineSurface_DG
IBezierSurface_DG
IPartialBezierProps_DG
IRectangularTrimmedSurface_DG
ISurfaceOfRevolution_DG
Collapse Oriented ObjectsOriented Objects
IObjectOriented_DG
IPlane_DG
ISphere_DG
ICylinder_DG
ICone_DG
ITorus_DG
IBox_DG
IPolygon3D_DG
IGeometricObject_DG
Collapse GeneralGeneral
IElement_DG
IStrip_DG
Collapse ModelModel
IModel_DG
Collapse EntitiesEntities
IEntity_DG
IEntityArray_DG
IStdShape_DG
IStdShapeRef_DG
IDraw_DG
IEntity2d_DG
IModel2d_DG
Collapse GeometryGeometry
IGeometry_DG
IPointSetGeometry_DG
ISegmentStripGeometry_DG
ICurveGeometry_DG
ISurfacePoint_DG
ISurfacePointArray_DG
ILabel_DG
ILabelGeometry_DG
ISticky_DG
Collapse BSpline BRep GeometryBSpline BRep Geometry
Collapse Advanced AlgorithmsAdvanced Algorithms
IBRepChamfer_DG
IBRepDraftAngle_DG
IBRepFillet_DG
IFeaturePrism_DG
IBRepShape_DG
IBRepVertex_DG
IBRepEdge_DG
IBRepWire_DG
IBRepFace_DG
IBRepShell_DG
IBRepSolid_DG
IBRepCompositeSolid_DG
IBRepCompound_DG
IShapeArray_DG
IBRepBuilderEx_DG
IWireArrayToSurfaceBuilder_DG
IBRepGeometry_DG
IBRepBuilder_DG
Collapse Mesh GeometryMesh Geometry
IMesh_DG
IMeshGeometry_DG
IVertex_DG
IVertexSegment_DG
ISimplex_DG
IMeshPoint_DG
IMeshAlgor_DG
IDiffSurface_DG
Collapse AppearenceAppearence
IAppearance_DG
IColor
IMaterial_DG
ITexture_DG
ILineStyle_DG
Collapse MovementMovement
Collapse Collision DetectionCollision Detection
IMetrics_DG
IPathCollisionDetector_DG
IKinematicEntity_DG
IMove_DG
IKinematicSet_DG
ICutEffect_DG
ISpinEffect_DG
IConstraint_DG
Collapse ItemsItems
IModelItem_DG
IItemArray_DG
IDynamicScreenItem_DG
IDynamicScreenItemManager_DG
ISmartLabelManager_DG
Collapse Import / ExportImport / Export
IDataContext_DG
ISTLDataContext_DG
Collapse Operations and AgorithmsOperations and Agorithms
IBooleanEntity_DG
IEuclideanShortestPath_DG
Collapse User DataUser Data
IUserData_DG
Collapse ViewView
IView_DG
ISelection_DG
IScene_DG
ILighting_DG
ILightSource_DG
IViewPoint_DG
IViewPointArray_DG
IMeasurement_DG
IRectangleColor_DG
I2DEditor_DG
IVirtualView_DG
Collapse General ComputingGeneral Computing
IObjectGenerator_DG
IControlInitialisationContext_DG
IGlobalAPI_DG
Collections
IUnknown
IObject_DG
IBitmap_DG
IBlob_DG
IContext_DG
IError_DG
IKCStack
IMenu_KC
IMenuItem_KC
IText
IFont_DG
Collapse ViewsViews
View
Scene
Global Axes
Background
3D Background
Collapse Samples and TutorialsSamples and Tutorials
Sample List
.NET Samples
Delphi and C++ Samples
Collapse GraphicsGraphics
Concepts
3D View
Viewing Volume
Eye Frame
Perspective View
Collapse Math ObjectsMath Objects
Mathematical Objects
Planes
Frames
Transforms
Oriented Objects
Boxes
Collapse CurvesCurves
Curve Technologies
Native Curves
Collapse 2D Elements2D Elements
Geometric Elements
Arcs
Line Strips
Collapse DeprecatedDeprecated
Collapse Deprecated GeometryDeprecated Geometry
Collapse 3DS3DS
Profiles
Surface Patches
Surfaces and Patch Strips
Input Validation
Collapse Lines and CurvesLines and Curves
3DS Curves
Surface Of Revolution
Collapse Deprecated API ReferenceDeprecated API Reference
Collapse ModelModel
Collapse SectionSection
IBoundary
Collapse 3DS3DS
IProfiles
IProfiledElement_KC
Redistribution
Model Viewer
Open Source
Support
Skip Navigation Links Go to DGKC docs Search Documentation


IBoolSectionEx Interface

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

See also 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 entity which implements this IBoolSectionEx interface)

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

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

Remarks

Performs operation indicated by operation on the entity 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 entity. 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 interentity. For example, subtraction of a long and thin cylinder from a sphere will have two closed isolated interentity loops. In that case the newly added object will have two children one per each interentity 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 interentity loops. Each loop is an array (IArray) of IVertex elements, which can be used to obtain coordinates and normals to the surface at the interentity points. 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 interentity 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 interentity curve. Often there are several normals on each side, for example when interentity 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 interentity 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 entity 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 entity 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 interentity loops are calculated and the Boolean operation is not executed, which significantly improves performance.

If context.interentityLine is true a new empty object will be created and added as new child of the first entity. 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 interentity. For example, subtraction of a long and thin cylinder from a sphere will have two closed isolated interentity loops. In that case the newly added object will have two children one per each interentity 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 interentity curve. This calculation is not performed context.interentityLine is false. The curve consists of the isolated linked interentity loops. Each loop is an array (IArray) of IVertex elements, which can be used to obtain coordinates and normals to the surface at the interentity points. See remarks for the previous method for more details.

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 entity 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 entity 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 interentity line of the two surfaces will be added to the model. See comments for the  createIntersLine parameter above for details false
InterentityLineOnly Boolean If true only interentity line is calculated false
ReturnInterentity 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** listIEntity)

Parameters

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

Remarks

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

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