Home Page > KernelCAD Models > Mathematical Objects > Frames
Frames
Frames
Frame is a system of coordinate axes.
It is uniquely determined by 3D point of its origin in global coordinates and 3D
vectors of its axes. To be valid, vectors of the axes must have length 1.0 and
be perpendicular to each other. Programmatically frames are manipulated by
frame interfaces
Frame is very important and frequently used concept because it
represents purified concept of location and orientation.
Nearly all items in 3D scene of KernelCAD have intrinsic frame member
(property) called local frame, which defines location and orientation of the
object (section). Geometry of a section is always defined relative to its local
axes to make it invariant under any movement.
To create a new (standalone) frame call
IDIObjGenerator.Create or
IDIObjGenerator.Create2 with
eType parameter set to eObjTypeFrame member of
EObjectType
enumeration. The returned IUnknown reference
has actual type
IFrame and can be safely cast to or queried from to convert to
IFrame type.
Frames and Transforms
There is a close correspondence between farmes and transforms of 3D space. In
particular this correspondence allows perfoming multiplication operation on
frames similar to composition of transforms. See more details at
Transforms topic Drawing a frame
Local frame of a section is rendered if the visibility flag controlled by
ISection.GetVisibleFlag() /
ISection.SetVisible() is on.
A standalone frame can be added to the scene with the help of
Frame Graphic Item, which
is a software object implementing
IGraphicItem. To draw a
frame:
See CreateFrameGraphicItem() method of
Collision Path
sample for an example.
A permanent object, which represents a frame and can be saved with the model
can be modeled in 3D Debugger or created programmatically using
Line Strips
|