ADD: first version, including physics model and pattern editing.