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 > IObjectPosition_KC
IObjectPosition_KC Interface

IObjectPosition_KC Interface

FindStableTangentialPlane

The interface calculates position and orientation of a 3D plane  which is tangential to the surface of the obejct at least at three isolated points. From different prospective the method calculates which its side can be used to put it into a stable position on a flat surface. IObjectPosition_KC can be queried from ISection interface


HRESULT FindStableTangentialPlane(DIPoint* pt0, DIPoint* pt1, DIPoint* pt2, double distMax, int* result )

Parameters

pt0, pt1, pt2 - [in,out] Points in global coordinates close to the surface which will be modified to identify a stable tangential plane

distMax- [in] maximal distance from the initial point or 0 if no restriction required. See remarks.

result - [out] - The return code: > 0 means success. Any other return values mean thet there was an error

Return value codes:

2 Solution found, but was restricted by distMax for one or more points

1 Success

0  Unknown internal error

-1 Could not calculate projection to the surface of starting points. Can be caused by incorrect type of section or incorrect initial position relative to surface geometry

-2 The initial points were collinear or have become collinear during the calcualtion

-3 a point reached edge of the surface

-4 At least two points converged into one

-5 Infinite loop. Solution can not be achieved

Remarks

Assuming pt0, pt1 and pt2 points are close to the surface of this object (the object this interface was queried from) and do not lie on the same line the method modifies position of the points in such way that they define a stable plane. Stable plane is tangential to the surface of the obejct at least at three different non-collinear points and the object lies completely on one side of the plane, namely on the negative side.

ppt0, pt1 and pt2 are also assumed to be arranged in CCW direction looking from outside of the object or more correctly from end of normal to the surface.

NNotice that not every starting configuration pt0, pt1, pt2 results in a stable plane. The points have to be relatively close to three isolated locally concave areas on the surface. The algorithm returns an error (result<=0) if during execution a point reached edge of the surface or two or more points converged.

If i>distMax>0 modifications of all three points are restricted to area of the surface not further than distMax from the initial point. Set distMax to 0 to avoid the restriction, which is the default recommended behaiviour. If distMax>0 and one or more points were restricted the returned result value is 2.

Use error codes above or IError_KC to obtain description of the error if the returned result is less or equal to 0.

Completely convex objects do not have a stable tangential plane. Point set for such an object will either return an error indicating converged points or will converge to corners of a single simplex for meshed surfaces./p>