Skip to content

cf_draw_tri

Category: draw
GitHub: cute_draw.h


Draws a triangle wireframe.

void cf_draw_tri(CF_V2 p0, CF_V2 p1, CF_V2 p2, float thickness, float rounding);
Parameters Description
p0 A corner of the triangle.
p1 A corner of the triangle.
p2 A corner of the triangle.
thickness The thickness of each line to draw.
rounding Corner radius in world units. The shape keeps its extent, clamped to what it can hold.

Remarks

Rounding is clamped to the inscribed circle's radius, where the triangle becomes that circle. The line runs inward from the edges, so the whole stroke lies within the triangle.

cf_draw_tri_fill