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 > 2D Geometry > IArc
IArc Interface

IArc Interface

GetCurvature
SetCurvature
Init
IsValid
MakeValid
SetEndPoint

The interface is implemented by arcs and 2D straight lines. To access 2D end points of the arc query ILine2D from this interface. Use IArcEx queried from this to perform additional calculations related to arc.

IArc interface is returned from other interfaces which give access to more complex objects. To create a standalone arc to for some calculations call IDIObjGenerator.Create or IDIObjGenerator.Create2 with eType parameter set to eObjTypeArc member of EObjectType enumeration. The returned IUnknown reference has actual type IArc. Use query if your environment does not allow direct cast.

See also Pipes sampleInterface List


HRESULT GetCurvature(double* curv)

Parameters

curv - [out] The returned Curvature of the arc

Remarks:

The method returns Curvature of the arc


HRESULT SetCurvature(double curv)

Parameters

curv - [in] New value for Curvature of the arc

Remarks:

The method does no check validity of the resulting arc, assuming that further modifications may follow before usage of the arc object. If arc has been modified with this method the Init method below must be called prior calling enhanced methods ( any method of IArcEx, except of IArcEx.Radius() )


HRESULT Init(VARIANT_BOOL *success)

Parameters

success - [out, retval] The returned success code. True if the arc was valid or false otherwise.

Remarks:

This method updates internal state of the software object. It must be called after any changes to primary properties of the arc (ends and curvature) and before calling enhanced methods exposed by the arc (any method of IArcEx, except of IArcEx.Radius() ). False return code means that the arc is in invalid state and cannot be initialized. To resolve this issue either set curvature to a number in [-d/2, d/2] range, where d is distance between arc ends or reduce distance between ends to 2/Curvature and call the method again. Note that arcs with curvature 0 (straight lines) are always valid.

Note once this method was called successfully (arc is valid) the arc becomes Initialized. Calling this method again for a initialized arc is not an error and does not affect performance.


HRESULT IsValid(VARIANT_BOOL *success*valid))

Parameters

success - [out, retval]  True if the arc is valid or false otherwise.

Remarks:

HRESULT MakeValid(VARIANT_BOOL *modified)

Parameters

modified - [out,retval] True if curvature was modified and the arc has become valid. False if there were no changes because the arc was valid prior the call

Remarks:

The method exits without any changes and returns false if the arc was valid otherwise it modifies curvature of the arc to the nearest valid value and returns true. See Init() for more information.


HRESULT SetEndPoint(int end, double x, double y)

Parameterss

end - [in] 0 for the first end 1 for the second end. No other values are accepted

x, y - [in] New coordinates of the end point

Remarks:

This method modifies the specified end of the arc. As curvature remains unchanges the arc may become invalid. See Init() above for more information.