Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

This demo showcases my functions that can:

  1. calculate the outline of a given path (open or closed)
  2. create a smoothed version of a path using bezier curves

The functions come in 3 flavours:

  1. UIbezier methods
  2. functions that accept a CGPath as input (read about the limitations below)
  3. C functions that accept array of floats as input

I have also added a helper funtion that can print a CGPath in the console (usefull for debugging).

To use the functions include the header file "CGutilities.h" and use the soruce files: "CGutilities.m", "CGutilitiesBezier.m"

These functions are used in Soundbeam app :

In this demo 5 input paths are used. Some of them have their outline calculated and rendered in red color. Some are "smoothened" and then rendered.
The user can alter the tension of the control points of the bezier curves.

Core Animation is used to animate custom propertis: the width of the outline and the angle of the rotation of one of the input paths.

Video running the demo:

Older video:

My blog's post:

The way the outline is calculated:

The math behind control points calculations:

The functions have some limitations. So read CGutilities.h carefully


this project demonstrates the use of a custom function that computes the outline for a given path




No releases published


No packages published