Package: cairo

Function cairo-set-miter-limit

Lambda List

cairo-set-miter-limit (cr limit)

Arguments

cr -- a cairo-t context
limit -- a double float with the miter limit to set

Details

Sets the current miter limit within the Cairo context.

If the current line join style is set to :miter, see the cairo-set-line-join function, the miter limit is used to determine whether the lines should be joined with a bevel instead of a miter. Cairo divides the length of the miter by the line width. If the result is greater than the miter limit, the style is converted to a bevel.

As with the other stroke parameters, the current line miter limit is examined by the cairo-stroke, cairo-stroke-extents, and cairo-stroke-to-path functions, but does not have any effect during path construction.

The default miter limit value is 10.0, which will convert joins with interior angles less than 11 degrees to bevels instead of miters. For reference, a miter limit of 2.0 makes the miter cutoff at 60 degrees, and a miter limit of 1.414 makes the cutoff at 90 degrees.

A miter limit for a desired angle in radians can be computed as:
(setf limit (/ 1.0d0 (sin (/ angle 2.0d0))))  
 

See also

2021-12-12