PolyOffsetParameters2D¶
Inherits: Resource < Reference < Object
A set of parameters to configure various polygon and polyline deflating and inflating related methods in PolyOffset2D.
Properties¶
| float | arc_tolerance | 0.25 |
| EndType | end_type | 3 |
| JoinType | join_type | 0 |
| float | miter_limit | 2.0 |
Enumerations¶
enum JoinType:
- JOIN_SQUARE = 0 — Squaring is applied uniformly at all convex edge joins at
1 * delta. - JOIN_ROUND = 1 — While flattened paths can never perfectly trace an arc, they are approximated by a series of arc chords.
- JOIN_MITER = 2 — There’s a necessary limit to mitered joins since offsetting edges that join at very acute angles will produce excessively long and narrow “spikes”. For any given edge join, when miter offsetting would exceed that maximum distance, “square” joining is applied.
enum EndType:
- END_POLYGON = 0 — Endpoints are joined using one of the
JOIN_*values and the path filled as a polygon. - END_JOINED = 1 — Endpoints are joined using one of the
JOIN_*values and the path filled as a polyline. - END_BUTT = 2 — Endpoints are squared off with no extension.
- END_SQUARE = 3 — Endpoints are squared off and extended by
deltaunits. - END_ROUND = 4 — Endpoints are rounded off and extended by
deltaunits.
Property Descriptions¶
- float arc_tolerance
| Default | 0.25 |
| Setter | set_arc_tolerance(value) |
| Getter | get_arc_tolerance() |
The maximum distance the flattened path will deviate from the mathematical representation of an arc. Smaller values will increase smoothness at a cost of performance. Only relevant when join_type is set to JOIN_ROUND.
- EndType end_type
| Default | 3 |
| Setter | set_end_type(value) |
| Getter | get_end_type() |
See END_* constants in EndType.
- JoinType join_type
| Default | 0 |
| Setter | set_join_type(value) |
| Getter | get_join_type() |
See JOIN_* constants in JoinType.
- float miter_limit
| Default | 2.0 |
| Setter | set_miter_limit(value) |
| Getter | get_miter_limit() |
The maximum distance in multiples of delta that vertices can be offset from their original positions before squaring is applied. The default value is 2.0 (twice delta) which is the smallest value that’s allowed to avoid generating unacceptably long ‘spikes’ at very acute angles.