Dev notebook: Converting scale & position of circular NSSlider for degrees

The standard Cocoa control NSSlider comes in a circular variety that resembles a rotating knob with an indicator point. Among the ideal applications for such a control is representing a circular angle. In the application I’m developing I wanted to use this to control the angle of the brush image used for drawing. I began … Read moreDev notebook: Converting scale & position of circular NSSlider for degrees

Painting with Trigonometry

I’m excited to share today’s image generated from the application under development: It’s a pretty organic background-pattern sort of texture, but it highlights a few cool things about the app, which is focused on creating beautiful images with mathematical techniques. First, the brush strokes! All of these strokes are ‘points’ drawn with an extra-wide calligraphy … Read morePainting with Trigonometry

Dev notebook: brush-like drawing in Swift, without CGPattern

I’m spending a lot of time in Cocoa drawing and Core Graphics lately, working in Swift. The API around the Core Graphics CGPattern object in Swift is a little challenging – it requires C callbacks and unsafe pointers for basic pattern-creation and drawing functionality. It also doesn’t work exactly as I’d like it to; I … Read moreDev notebook: brush-like drawing in Swift, without CGPattern