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 > KernelCAD Components > Interfaces > Sections > IPointCloud_KC
IPointCloud_KC Interface

IPointCloud_KC Interface

GetAxisAlignedBoundingBox
GetOrientedBoundingBox
FitOrientedBoundingBoxAveragesMethod
GetMinimumOrientedBoundingBox
GetMeanPoint
ReduceData

Operations with point sets. IPointCloud_KC can be queried from ISection interface implemented by Point Set sections

See also: Cloud sample


HRESULT GetAxisAlignedBoundingBox(VARIANT_BOOL localAxes, IBox** box)

Parameters

localAxes - [in] If true the ranges in the returned box will be related to the local axes of the section, which implements this interface. Otherwise the ranges  are related to global axes

box - [out, retval] Interface implemented by new box

Remarks:

Use this method to obtain Axis Aligned Bounding box of the section. If localAxes is true the box will be aligned to locan axes of the point set section


HRESULT GetOrientedBoundingBox(IBox* box)

box - [in, out] Interface implemented by a box created by the caller

Remarks:

This interface calculates dimensions of minimal Oriented Bounding Box of the point set. The method does not change its orientation, which is expected to be set by the caller.

To use this method:

  • Ccreate a new box using KernelCAD > GetModel() > IModel > IDIObjGenerator > IDIObjGenerator.Create(EObjectType.eObjTypeBox)  > IBox.

  • Query I3DObject and IFrame2 from IBox.

  • Use I3DObject and IFrame2 to set location and orientation of the box

  • Call GetOrientedBoundingBox(IBox* box) to calculate dimensions of the box

  • Use methods of IBox to acces the dimensions

See also: Cloud sample


HRESULT FitOrientedBoundingBoxAveragesMethod( int* result, IBox** box)

Parameters

result - [out] The return code: -1 if the set was empty; 0 if there was an internal error. Use IError_KC to obtain textual description of an error

box - [out, retval] Interface implemented by new box

Remarks:

The method calculates orientation and dimension of a "good fit" bounding box, volume of which is close to minimal. The returned box if not guaranteed to be optimal, but it is much faster than the exact method below


HRESULT GetMinimumOrientedBoundingBox( float tolerance, int performanceVsPrecision, int* result, IBox** box)

Parameters

tolerance - Precision of the calculation. It affects performance. Valid range: 1e-5 to 0,3

performanceVsPrecision - Precision of the calculation.  Valid values are 0, 1 or 2. Choose 0 for best performance. Choose 2 for best precision.

result - [out] The return code: -1 if the set was empty; 0 if there was an internal error. Use IError_KC to obtain textual description of an error

box - [out, retval] Interface implemented by new box

Remarks:

The method calculates orientation and dimension of the minimal volume bounding box. The method is computationaly expensive. Use FitOrientedBoundingBoxAveragesMethod() above if fast estimation is sufficient. It is recommended to tune in the parameters experimenting with the application for best performance.


HRESULT GetMeanPoint(DIPoint* mean)

Parameters

mean - The returned mean point of the point set

Remarks:

The method calcualtes the mean point (center of weight) of the set.


HRESULT ReduceData(VARIANT_BOOL leave, int start, int step, int end)

Parameters

leave - If true all points except ones specified in the start, step, end parameters will be deleted. If false only the specified points are deleted

start - The first index of the specified subset of points. Must be less then or equal to end.

step - Only each step-th point is included in the specified subset. Must be greater than zero. when step is 1 no points are skipped

end - The last index of the specified subset of points. Must be greater then or equal to start

Remarks:

The method removes points as specified by the parameters from the point set. Use step = 1 to remove or leave all points form the start, end range.