ArcToMetafileCommandCreateCubicCurves Method |
Calculates a set of cubic curves which are able to replace the arc.
Namespace: RAYLASE.Marker.VectorGraphicElement.MetafileCommandAssembly: RAYLASE.Marker.VectorGraphicElement (in RAYLASE.Marker.VectorGraphicElement.dll) Version: 2.19.0
Syntaxpublic override List<CubicCurveToMetafileCommand> CreateCubicCurves()
Return Value
ListCubicCurveToMetafileCommandThe list of cubic curves representing the arc.
Remarks
An arc with center point C, start point S, sweep angle phi and
end point E is to be replaced approximately by a cubic curve
with the control points C0, C1, C2 and C3:
^
| . . . . .
| . .
| . .E = C4
| . . .
| . . ..
| . . \ . .
| . . \ . . C2
| . C . phi | .
| . . / . . C1
| . . / . .
| . . ..
| . . .
| . .
| . . S = C0
| . . . . .
|
+------------------------------------------------>
The control points have to be on the circle's tangents Ts and Te
through the points S and E. This can be achieved by the formulas
- C0 = S
- C1 = S + l*Ts
- C2 = E - l*Te
- C3 = E
with
- Ts = Uz x CS (cross product between S-C and the unit vector in z direction)
- Te = Uz x CE (cross product between E-C and the unit vector in z direction)
- l = 4/3 * tan(phi/4)
This is valid only for reasonable small angles phi, i. e. angles
not larger than 90 degrees. Larger arcs are splitted therefore by
deviding the sweep angle by 90 degrees.
See Also