Skip to content

Commit 9ebcbce

Browse files
committed
homogenize names with lpy instead of pylsystems (2)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/vplants/vplants/trunk/lpy@5325 ab253cce-29fb-0310-bb2f-979600cdbdeb
0 parents  commit 9ebcbce

File tree

111 files changed

+19231
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+19231
-0
lines changed

AUTHORS.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Authors:
2+
Fr�d�ric Boudon

ChangeLog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
29 05 2007:
2+
* First version using sconsX and new version of plantgl

LICENSE.txt

Whitespace-only changes.

PKG-INFO

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Metadata-Version: 1.0
2+
Name: pylsystems
3+
Version: 1.0.0
4+
Summary: Python L-systems Package.
5+
Home-page: http://openalea.gforge.inria.fr/dokuwiki/doku.php?id=packages:visualization:plantgl:plantgl
6+
Author: Frederic Boudon
7+
Author-email: [email protected]
8+
License: GPL
9+
Description:
10+
Lindenmayer systems are a powerfull formalism to describe generation of fractal objects and plants.
11+
12+
Platform: UNKNOWN

README.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Please, read the up to date web page at:
2+
http://openalea.gforge.inria.fr/
3+
4+
5+
6+
7+
8+

SConstruct

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# -*-python-*-
2+
3+
from openalea.sconsx import config, environ
4+
import os, fnmatch
5+
6+
Config= config.Config
7+
ALEAConfig= config.ALEAConfig
8+
ALEAEnvironment= config.ALEAEnvironment
9+
10+
pj= os.path.join
11+
12+
name='pylsystems'
13+
14+
SConsignFile()
15+
16+
options = Options(['../options.py', 'options.py'], ARGUMENTS )
17+
prj_conf= ALEAConfig(name,['boost_python', 'plantgl','qt4'])
18+
19+
# Set all the common options for the package
20+
prj_conf.UpdateOptions( options )
21+
22+
prj_env= Environment( options= options )
23+
prj_conf.Update( prj_env )
24+
25+
# Generate Help available with the cmd scons -h
26+
Help(options.GenerateHelpText(prj_env))
27+
28+
# Set build directory
29+
prefix= prj_env['build_prefix']
30+
BuildDir( prefix, '.' )
31+
32+
prj_env.Prepend(LIBPATH='$build_libdir')
33+
prj_env.Append( CPPPATH = pj( '$build_includedir','pylsystems' ) )
34+
35+
# Build stage
36+
SConscript( pj(prefix,"src/cpp/SConscript"),
37+
exports={"env":prj_env} )
38+
39+
SConscript( pj(prefix,"src/wrapper/SConscript"),
40+
exports={"env":prj_env} )
41+
42+
43+
Default("build")

options_linux.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import os
2+
compiler='gcc'
3+
plantgl_dir = os.path.abspath('../PlantGL')
4+
plantgl_lib=plantgl_dir+'/build-scons/lib'
5+
plantgl_include=plantgl_dir+'/src/cpp'
6+
QTDIR='/usr'

setup.cfg

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Distutils parameters file
2+
# Use this file to specify custom parameters to pass to setup.py script
3+
# Uncomment necessary options
4+
5+
[global]
6+
# verbose=0
7+
8+
[egg_info]
9+
tag_build = .dev
10+
tag_svn_revision = 1
11+
12+
[build]
13+
##### scons parameters (use options.py instead)
14+
#scons-ext-param=
15+
16+
#####scons exe path
17+
#scons-path=C:\Python24
18+
19+
#####distutils build directory
20+
#build-lib=
21+
22+
[install]
23+
24+
#####openalea data directory
25+
#external-prefix=
26+
27+
[bdist_rpm]
28+
requires= python>=2.4, boost, qhull, qt < 4, readline
29+
30+
build_requires= python>=2.4, python-devel
31+
build_requires= boost>= 1.33.1, boost-devel
32+
build_requires= scons >= 0.96.91
33+
build_requires= distx, sconsx
34+
build_requires= qt-devel < 4, qhull-devel, flex, bison
35+
build_requires= readline-devel

setup.py

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# -*- coding: iso-8859-15 -*-
2+
3+
# Header
4+
5+
import os, sys
6+
pj = os.path.join
7+
8+
sys.path.insert(0,pj(os.path.dirname(__file__),'src', 'openalea', 'pylsystems'))
9+
import __version__
10+
11+
##############
12+
# Setup script
13+
14+
# Package name
15+
name = 'pylsystems'
16+
namespace = 'openalea'
17+
pkg_name= namespace + '.' + name
18+
19+
version= __version__.LPY_VERSION_STR
20+
print pkg_name,': version =',version
21+
22+
description= 'PyLsystems package for OpenAlea.'
23+
long_description= '''
24+
A Python version of Lindenmayer Systems.
25+
Based on Dr. Prusinkiewicz et al. cpfg-lpfg specifications.
26+
Implemented by the Virtual Plants team.'''
27+
28+
# Author
29+
author= 'Frederic Boudon'
30+
author_email= '[email protected]'
31+
32+
url= 'http://openalea.gforge.inria.fr/dokuwiki/doku.php?id=packages:vplants:lpy:main'
33+
34+
# LGPL compatible INRIA license
35+
license= 'Cecill V2'
36+
37+
# Scons build directory
38+
build_prefix= "build-scons"
39+
40+
from setuptools import setup
41+
42+
43+
setup(
44+
name="VPlants.PyLsystems",
45+
version=version,
46+
description=description,
47+
long_description=long_description,
48+
author=author,
49+
author_email=author_email,
50+
url=url,
51+
license=license,
52+
53+
scons_scripts = ['SConstruct'],
54+
scons_parameters = ["build_prefix="+build_prefix],
55+
56+
namespace_packages = [namespace],
57+
create_namespaces = True,
58+
59+
# pure python packages
60+
packages = [ pkg_name, pkg_name+'.gui', pkg_name+'.wralea' ],
61+
py_modules = ['pylsysgui_postinstall'],
62+
63+
# python packages directory
64+
package_dir = { '' : 'src',},
65+
66+
# Add package platform libraries if any
67+
include_package_data = True,
68+
package_data = {'' : ['*.pyd', '*.so', '*.lpy'],},
69+
zip_safe = False,
70+
71+
# Specific options of openalea.deploy
72+
lib_dirs = {'lib' : pj(build_prefix, 'lib'),},
73+
bin_dirs = {'bin': pj(build_prefix, 'bin'),},
74+
inc_dirs = {'include' : pj(build_prefix, 'include') },
75+
share_dirs = {'share' : 'share', },
76+
77+
# Dependencies
78+
# entry_points
79+
entry_points = {
80+
"wralea": ["pylsystem = openalea.pylsystems.wralea",],
81+
'gui_scripts': ['lpy = openalea.pylsystems.gui.lsyswindow:main',]
82+
},
83+
84+
postinstall_scripts = ['pylsysgui_postinstall'],
85+
86+
# Dependencies
87+
setup_requires = ['openalea.deploy'],
88+
dependency_links = ['http://openalea.gforge.inria.fr/pi'],
89+
install_requires = ['PyOpenGL', 'plantgl'],
90+
91+
)
92+
93+

share/apicaldominancy.lpy

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
initial_auxin_level = 10.
2+
min_auxin_level = 5.
3+
medium_auxin_level = (initial_auxin_level+min_auxin_level)/2.
4+
5+
mstate = 8
6+
internal_degradation_rate = 0.0
7+
flower_degradation_rate = 0.0
8+
root_auxin_level = 0.0
9+
transport_speed = 1/3. # should be < 1/3. for numerical constraints
10+
maxorder = 4
11+
12+
import time as t
13+
14+
timing = 0
15+
def Start():
16+
global timing
17+
timing = t.time()
18+
19+
def End():
20+
print 'Execution time :',t.time()-timing
21+
22+
def txt(val):
23+
return str(round(val,2))[:5]
24+
25+
Axiom: #(0.5)R(0)M(mstate,0)
26+
27+
derivation length: 500
28+
ignore: +-
29+
production:
30+
31+
32+
M(state,order) :
33+
if state > 0:
34+
angle = 20+70*state/(mstate*(order+1))
35+
if state % 2:
36+
produce I(initial_auxin_level) [+(angle)m(order+1)]M(state-1,order)
37+
else:
38+
produce I(initial_auxin_level) [-(angle)m(order+1)]M(state-1,order)
39+
else:
40+
produce I(initial_auxin_level)L
41+
42+
43+
I(a) < m(order) :
44+
if order >= maxorder:
45+
produce *
46+
if a <= min_auxin_level:
47+
produce M(mstate/(2**order),order)
48+
49+
50+
51+
I(a) > M(state,i) :
52+
produce I(initial_auxin_level)
53+
54+
I(n) < I(a) > L :
55+
produce I((a+(n-a)*transport_speed)*(1-internal_degradation_rate - flower_degradation_rate))
56+
57+
I(n) < I(p) > [I(k)]I(q) :
58+
plevel = p + ((n+q+k)-3*p)*transport_speed - p * internal_degradation_rate
59+
produce I(plevel)
60+
61+
I(n) < I(p) > I(q) :
62+
produce I(p + (n+q-2*p)*transport_speed - p * internal_degradation_rate)
63+
64+
65+
R(r) < I(n) > I(p):
66+
nn = (root_auxin_level+p-2*n)*transport_speed
67+
produce I(n+nn)
68+
69+
R(r) < I(n) > [I(k)]I(p):
70+
nn = (root_auxin_level+p+k-3*n)*transport_speed
71+
produce I(n+nn)
72+
73+
R(r) > I(n) --> R(r+(n-root_auxin_level)*transport_speed)
74+
75+
homomorphism:
76+
77+
I(a) :
78+
col = 1
79+
if min_auxin_level <= a < medium_auxin_level:
80+
col = 4
81+
elif a < min_auxin_level:
82+
col = 3
83+
produce ;(col)F(10)[+(90)f(2);(3)@L(txt(a))]
84+
85+
M(state,i) --> F(2);(2)@O(1)
86+
87+
88+
m(order) --> ;(2)F(1)@O(0.5)
89+
90+
L --> ;(3)@O(1)
91+
92+
R(r) :
93+
produce[+(180)F(max(2*r,1)/10.)@O(max(r,1)/10.)-(90)f(2*max(r,1)/10.);(3)@L(txt(r))]
94+
95+
endlsystem
96+
###### INITIALISATION ######
97+
98+
def __initialiseContext__(context):
99+
context.turtle.setMaterial(1,Material('Brown',Color3(33,22,6),2.72727,Color3(40,40,40),Color3(0,0,0),1,0))

share/ex_lsys_markov.lpy

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
from random import *
2+
p1 = 0.750000
3+
p2 = 0.250000
4+
m = 0
5+
6+
7+
Axiom: #(1)[f(50)+90f(10)]-(90)P(1,0)
8+
derivation length: 100
9+
10+
# A = branching state
11+
# B = non-branching state
12+
13+
def Start():
14+
global m
15+
m = 0
16+
17+
production:
18+
19+
P(x,t) :
20+
if t <= 10 : produce T[G(x)]P(x,t+1)
21+
else :
22+
global m
23+
m = 1
24+
produce *
25+
26+
G(x) :
27+
if m==1 :
28+
produce +(90)S(x)
29+
30+
S(x) :
31+
if random() <= 0.5: produce A(x)
32+
else: produce B(x)
33+
34+
A(x) :
35+
if random() <= p1: produce I[M(x)]A(1-x)
36+
else: produce IB(1-x)
37+
38+
B(x) :
39+
if random() <= p2: produce IB(1-x)
40+
else: produce I[M(x)]A(1-x)
41+
42+
homomorphism:
43+
44+
T : produce ;(1)f(40);(1)@c(1)
45+
M(x) :
46+
if x==0 : produce ;(2)+F(20)
47+
elif x==1 : produce ;(2)-F(20)
48+
49+
I : produce ;(1)F(2)
50+
A(x) : produce ;(1)@O(3)
51+
B(x) : produce ;(2)@O(3)
52+
53+
endlsystem

0 commit comments

Comments
 (0)