PolyPath2D

Inherits: PolyNode2D < Node2D < CanvasItem < Node < Object

Turns Path2D into a buffered path.

Description

Generates a buffered outline defined by curves added with Path2D. The PolyPath2D must have at least one Path2D added as a child with Curve2D defined. The process of curve deflation is done via PolyOffset2D internally, so you can use buffer_parameters to configure offsetting behavior.

Note: the class makes sure that changes to Curve2D in Path2D lead to automatic updates in PolyPath2D using internal process callback on each idle frame. If you’d like to optimize the updating behavior, you can turn off internal processing using Node.set_process_internal method.

Property Descriptions

Default 32.0
Setter set_buffer_offset(value)
Getter get_buffer_offset()

Determines the width of a deflated curve, which is width = buffer_offset * 2.


Setter set_buffer_parameters(value)
Getter get_buffer_parameters()

Configures offset parameters such as join type, end type, miter limit.


  • int tessellation_stages
Default 4
Setter set_tessellation_stages(value)
Getter get_tessellation_stages()

The number of subdivisions a curve segment may face before it is considered approximate enough. Decrease the default value if you want to improve decomposition performance in sacrifice of accuracy. For more information, see Curve2D.tessellate.


  • float tessellation_tolerance_degrees
Default 4.0
Setter set_tessellation_tolerance_degrees(value)
Getter get_tessellation_tolerance_degrees()

Controls how many degrees the midpoint of a segment may deviate from the real curve, before the segment has to be subdivided. Increase the default value if you want to improve decomposition performance in sacrifice of accuracy. For more information, see Curve2D.tessellate.