Skip to content

nebs/Organik-iOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Organik-iOS

Organik-iOS is a set of L-System drawing and management classes for iOS. Included is a sample project which included a couple L-System presets.

Organik can draw randomly generated realistic "trees" in core graphics. But more than that, it provides a generic set of classes which you can use to implement your own drawing using L-Systems.

Alt text Alt text

L-System?

L-System is short for Lindenmayer system. Read more about L-Systems on wikipedia

Organik Files

NPLSystem and NPTurtle are the foundation of Organik. Together they manage iterations of an L-System and drawing respectively.

These classes are the "engine", but the "brains" of the system comes from the delegate.

In the NPLSystemLibrary file you will find an abstract base class called NPLSystemRepresentation as well as a few example subclasses. Subclasses of this class can be used as delegates for both the NPLSystem and NPTurtle classes providing both the rules and drawing mechanisms needed for a given system.

NPLSystemView is a UIView subclasses which synchronizes the logic from the NPLSystem and drawing from the NPTurtle and renders the output by animating the resulting path.

How it works

NPLSystem coordinates with its delegate to calculate the system iterations. NPTurtle coordinates with its delegate to create a path based on the NPLSystem iterations. NPLSystemView then uses the turtle's path to draw and animate the system on the screen.

The delegate for both NPLSystem and NPTurtle are the same class in Organik (subclasses of NPLSystemRepresentation). This allows you to define a complete L-System from rules and axiom to rendering in a simple and clean way.

About

iOS L-System drawing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published