Skip to content

Smooth & fast line drawing from touch inputs for UIViews using Quartz

Notifications You must be signed in to change notification settings

jmonegro/Smooth-Line-View

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smooth line UIView

The goal of this project is to create a UIView that can generate smooth lines from touch input in a reasonably fast manner without moving to a more complex framework like OpenGL.

This view uses two methods of smoothing:

  1. Catmull Rom spline: (Shows in red.) This seems to have the best results as far as curve smoothing. However it gets really slow over a certain number of points. So I switch interpolation methods to the following for more complex curves…
  2. Bezier Interpolation: (Shows in green.) This method is very fast and doesn't care how complex the path is. The view uses some math to calculate the control points. The results aren't as good as the Catmull Rom but much faster and with more complex shapes the differences are hard to notice.

TODO

  • Still need to find the best threshold to switch to Bezier from Catmull Rom.

Examples

  • alt text
  • alt text

About

Smooth & fast line drawing from touch inputs for UIViews using Quartz

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published