SG_ARC structure
The SG_ARC structure is an arc presentation in the three-dimensional space.
Has the following fields
double radius; - arc radius
SG_VECTOR normal; - normal to the arc surface
SG_POINT center; - arc center
SG_POINT begin; - arc start point
SG_POINT end; - arc end point
double begin_angle; - arc beginning angle (in radians)
double angle; - arc opening angle (in radians)
Has the following methods (it is recommended to create arcs using one of the five arcs creating methods):
bool FromThreePoints(const SG_POINT& begP, const SG_POINT& endP, const SG_POINT& midP, bool invert)
Description:
Creates an arc in space by three points.
Arguments:
begP - arc start point
endP - arc end point
midP - arc point
invert - if false an arc with midP is created; if true an arc is "inverted", i.e. an arch complementing the one with midP to a circle will be created
Returned value:
If the function fails returns false, otherwise - true.
Illustration:
invert = false |
|
invert = true |
bool FromCenterBeginEnd(const SG_POINT& cenP, const SG_POINT& begP,const SG_POINT& endP, bool invert)
Description:
Creates an arc in the space by three points.
Arguments:
cenP - arc center
begP - arc start point
endP - arc end point
invert - if false an arc from begP to endP is created; if true the arc is "inverted", i.e. an arc from endP to begP is created
Returned value:
If the function fails returns false, otherwise - true.
Illustration:
invert = false |
|
invert = true |
bool FromBeginEndNormalRadius(const SG_POINT& begP, const SG_POINT& endP, const SG_VECTOR& nrmlV, double rad, bool invert)
Description:
Creates an arc in the space by start and end points, normal and radius.
Arguments:
begP - arc start point
endP - arc end point
nrmlV - normal to an arc surface
rad - arc radius
invert - if false an arc from begP to endP is created; if true the arc is "inverted", i.e. an arc from endP to begP is created
Returned value:
If the function fails returns false, otherwise - true.
Illustration:
invert = false |
|
invert = true |
bool FromCenterBeginNormalAngle(const SG_POINT& cenP, const SG_POINT& begP, const SG_VECTOR& nrmlV, double ang)
Description:
Creates an arc in the space by the center, start point, normal and opening angle.
Arguments:
cenP - arc center
begP - arc start point
nrmlV - normal to an arch surface
ang - arc opening angle
Returned value:
If the function fails returns false, otherwise - true.
Illustration:
bool FromBeginEndNormalAngle(const SG_POINT& begP, const SG_POINT& endP,const SG_VECTOR& nrmlV, double ang)
Description:
Creates an arc in the space by the start and end points, normal and opening angle.
Arguments:
cenP - arc center
begP - arc start point
nrmlV - normal to an arch surface
ang - arc opening angle
Returned value:
If the function fails returns false, otherwise - true.
Illustration:
bool Draw(SG_DRAW_LINE_FUNC line_func) const
Description:
For each line of an arc segment presentation calls the line_func function. Enables you to quickly construct an arc without creating an sgCArc object.
Arguments:
line_func - pointer to a function called for each line of an arc segment presentation.
Returned value:
If the argument value is zero returns false, otherwise - true.
Defined in sg2D.h
See also:
SG_POINT SG_VECTOR sgCArc SG_DRAW_LINE_FUNC