├── .github └── workflows │ └── conda-package-build.yml ├── .gitignore ├── .travis.yml ├── AUTHORS.txt ├── CMakeLists.txt ├── ChangeLog.txt ├── LICENSE.txt ├── PKG-INFO ├── Py2Exe-HowTo.txt ├── README.rst ├── appveyor.yml ├── build.sh ├── cmake ├── Anaconda.cmake ├── CXX14.cmake ├── FindPlantGL.cmake ├── FindPython.cmake └── pywrapper.cmake ├── compile-macport.sh ├── conda ├── bld.bat ├── build.sh ├── conda_build_config.yaml ├── icon_64x64.png └── meta.yaml ├── construct.yaml ├── debian ├── changelog ├── compat ├── control ├── copyright ├── lpy.desktop ├── lpy.xpm ├── python-vplants.lpy.install ├── rules └── source │ └── format ├── doc ├── Makefile ├── _conf.py ├── _downloads │ ├── Frame.lpy │ ├── InterpolateColors.lpy │ ├── LineTo.lpy │ ├── advancedRotations.lpy │ ├── basicShapes.lpy │ ├── branching.lpy │ ├── combined.lpy │ ├── filledPolygons.lpy │ ├── generalizedCylinders.lpy │ ├── harderExample.lpy │ ├── longPath.lpy │ ├── movement.lpy │ ├── orientation.lpy │ ├── polygons.lpy │ ├── resolution.lpy │ ├── rotation.lpy │ ├── scale.lpy │ ├── screen.lpy │ ├── setGuide1.lpy │ ├── setGuide2.lpy │ ├── setHLU.lpy │ ├── tropism.lpy │ ├── visualize.lpy │ └── width.lpy ├── _images │ ├── 2D1.png │ ├── 2D2.png │ ├── @R.png │ ├── @R2.png │ ├── F-.png │ ├── F2,5.png │ ├── F3.png │ ├── LineRel1.png │ ├── LineRel2.png │ ├── LineTo.png │ ├── LineTo2.png │ ├── LineToBis.png │ ├── OLineTo.png │ ├── _F.png │ ├── axis.png │ ├── basicPolygon.png │ ├── box.png │ ├── branch.png │ ├── branching1.png │ ├── branching2.png │ ├── branching3.png │ ├── circle.png │ ├── combined.png │ ├── combined2.png │ ├── cook.png │ ├── cook_model.png │ ├── curveS.tiff │ ├── decrease_color.png │ ├── divScale.png │ ├── downArroundL.png │ ├── editor │ │ ├── ex001.png │ │ ├── ex001.xcf │ │ ├── ex002.png │ │ ├── ex003.png │ │ ├── ex004.png │ │ ├── ex005.png │ │ ├── ex006.png │ │ ├── ex007.png │ │ ├── ex008.png │ │ ├── ex009.png │ │ ├── ex010.png │ │ ├── ex011.png │ │ ├── ex012.png │ │ ├── ex013.png │ │ ├── ex014.png │ │ └── ex015.png │ ├── euler.png │ ├── euler2.png │ ├── euler3.png │ ├── euler4.png │ ├── euler5.png │ ├── euler6.png │ ├── ex009.png │ ├── ex009.tiff │ ├── f.png │ ├── f2.png │ ├── filledPolygon1.png │ ├── filledPolygon2.png │ ├── filledPolygon3.png │ ├── filledPolygon4.png │ ├── frame.png │ ├── gallery │ │ ├── gallery.png │ │ └── tomato.png │ ├── generalized.png │ ├── harderExample.png │ ├── increase_color.png │ ├── initialScale.png │ ├── interpolateColors.png │ ├── interpolateColors2.png │ ├── leaf.png │ ├── leaf1.png │ ├── leaf2.png │ ├── leftArroundH.png │ ├── leftArroundU.png │ ├── leuwenberg.png │ ├── leuwenberg_model.png │ ├── loopPolygon.png │ ├── massart.png │ ├── massart_model.png │ ├── moveRel1.png │ ├── moveRel2.png │ ├── moveTo1.png │ ├── moveTo2.png │ ├── multScale.png │ ├── notGeneralized.png │ ├── nozeran.png │ ├── nozeran_model.png │ ├── path.png │ ├── path2.png │ ├── pinpoint1.png │ ├── pinpoint2.png │ ├── pinpoint3.png │ ├── pinpointRel1.png │ ├── pinpointRel2.png │ ├── quad.png │ ├── rescaling.png │ ├── resolution1.png │ ├── resolution2.png │ ├── rightArroundH.png │ ├── rightArroundU.png │ ├── rotation1.png │ ├── rotation2.png │ ├── rotation3.png │ ├── rotation4.png │ ├── rotation5.png │ ├── rotation6.png │ ├── schoute.png │ ├── schoute_model.png │ ├── screenshot2-3d.png │ ├── setColor1.png │ ├── setColor2.png │ ├── setGuide1.png │ ├── setGuide2.png │ ├── setGuide3.png │ ├── setGuide4.png │ ├── setGuide5.png │ ├── sphere.png │ ├── square.png │ ├── turnAround.png │ ├── turtle1.png │ ├── turtle2.png │ ├── turtle3.png │ ├── turtle4.png │ ├── upArroundL.png │ ├── width.png │ ├── width2.png │ └── with_frame.png ├── _themes │ └── sphinx_rtd_theme │ │ ├── __init__.py │ │ ├── breadcrumbs.html │ │ ├── footer.html │ │ ├── layout.html │ │ ├── search.html │ │ ├── searchbox.html │ │ ├── static │ │ ├── css │ │ │ ├── badge_only.css │ │ │ ├── badge_only.css.map │ │ │ ├── theme.css │ │ │ └── theme.css.map │ │ ├── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── Inconsolata-Bold.ttf │ │ │ ├── Inconsolata-Regular.ttf │ │ │ ├── Lato-Bold.ttf │ │ │ ├── Lato-Regular.ttf │ │ │ ├── RobotoSlab-Bold.ttf │ │ │ ├── RobotoSlab-Regular.ttf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ └── fontawesome-webfont.woff2 │ │ └── js │ │ │ ├── modernizr.min.js │ │ │ └── theme.js │ │ ├── theme.conf │ │ └── versions.html ├── conf.py ├── conf.py.bak ├── contents.rst ├── contextesouples.docx ├── gallery.pptx ├── header.helpcard ├── helpcard-generator.py ├── index.rst ├── make.bat ├── predef_com.helpcard └── user │ ├── autosum.rst │ ├── editor.rst │ ├── filesyntax.rst │ ├── helpcard.rst │ ├── installing.rst │ ├── integration.rst │ ├── lsystems.rst │ ├── massart.rst │ ├── overview.txt │ ├── subtelties.rst │ ├── turtleAdvanced.rst │ ├── turtleBasic.rst │ └── tutorial.rst ├── futur ├── multiprocess.py ├── multiprocess.txt └── syntax-example.lpy3 ├── icons ├── bd536042325d768ef04c87bdef9097ff.jpg ├── black-tree-silhouette-for-your-design-vector-9791662.jpg ├── concept-tree.jpg ├── icon-tree-3.jpg └── icone.pptx ├── log.txt ├── lpy-bundle.nsi ├── macos_build.sh ├── mcondabuild.bat ├── metainfo.ini ├── models ├── ArchiModels.zip ├── ArchiModels │ ├── cook.lpy │ ├── leuwenberg.lpy │ ├── massart.lpy │ ├── nozeran.lpy │ └── schoute.lpy ├── archisimple.lpy ├── curves │ ├── bspline.lpy │ ├── chaikin.lpy │ └── decasteljau.lpy ├── diffGeometry │ ├── flatpatch.lpy │ ├── noise_branch-2d.lpy │ ├── noise_branch.lpy │ ├── randombranches.lpy │ └── turtle_on_patch.lpy ├── enviro │ └── leuwenberg-light.lpy ├── lpyimport │ ├── archi.lpy │ └── flower.lpy ├── particles │ ├── .ipynb_checkpoints │ │ ├── Untitled-checkpoint.ipynb │ │ └── particles-checkpoint.lpy │ ├── Untitled.ipynb │ ├── lsystem_1.py │ ├── lsystem_2.py │ ├── lsystem_3.py │ ├── particles-cython.lpy │ └── particles.lpy ├── pascaltriangle │ ├── pascaltriangle1.lpy │ └── pascaltriangle2.lpy ├── pipemodel │ ├── comb-explosion-limited.lpy │ ├── comb-explosion-limited2.lpy │ └── protea.lpy └── spacecolonization │ ├── .ipynb_checkpoints │ └── Untitled-checkpoint.ipynb │ ├── Untitled.ipynb │ └── simplesca.lpy ├── modularityspecification.docx ├── options_conda_win.py ├── options_linux.py ├── p2esetup.py ├── setup.py ├── share ├── abop │ └── chap1 │ │ ├── lsystem-fig1.37.lpy │ │ ├── lsystem-fig1.37b.lpy │ │ ├── lsystem1.4.lpy │ │ └── lsystem1.9.lpy ├── examples │ ├── apicaldominancy.lpy │ ├── dynamicprofile.lpy │ ├── ex_lsys_markov.lpy │ ├── ex_lsystem1.lpy │ ├── ex_lsystem2.lpy │ ├── ex_lsystem3.lpy │ ├── ex_lsystem4.lpy │ ├── ex_lsystem5.lpy │ ├── ex_lsystem5b.lpy │ ├── ex_lsystem6.lpy │ ├── ex_lsystem7.lpy │ ├── ex_pglsymbol.lpy │ ├── ex_vonkoch.lpy │ ├── examples.py │ ├── lpfg_surface_import │ │ ├── leaf_surface.s │ │ └── lpfg_import.lpy │ └── sweepwithpyfunction.lpy ├── extension │ ├── curve2Ddrawing.lpy │ ├── mtgaxiom │ │ ├── evalrange.py │ │ ├── mtgcompare.py │ │ ├── mtgimport.py │ │ ├── walnut.drf │ │ ├── walnut.lpy │ │ ├── walnut.mtg │ │ └── walnut4.lpy │ └── multicore.lpy ├── image │ ├── bjunipc.png │ ├── leaf1.jpg │ ├── leaf2.jpg │ └── mango.png ├── training │ ├── 01-equilat-triangle.lpy │ ├── 02-circle.lpy │ ├── 02b-subdivision-circle.lpy │ ├── 03-koch-curve.lpy │ ├── 04-sierpinski.lpy │ ├── 05-simple-sympodial-plant.lpy │ ├── 06a-simple-differentiation.lpy │ ├── 06b-dev-inflo-archi.lpy │ ├── 07-continuous-growth.lpy │ ├── 08-continuous-growth+branching.lpy │ ├── 09-flower-continous-growth.lpy │ ├── 10-random-tree.lpy │ ├── 11a-markov-1stem.lpy │ ├── 11b-markov-nstems.lpy │ ├── 12-hidden-markov-1stem.lpy │ ├── 13-branched-signal.lpy │ ├── 13-fibonacci.lpy │ ├── 13a-flow1stem-random.lpy │ ├── 13b-flow1stem-diffusecontinuouslyfromroot.lpy │ ├── 13c-flow1stem-diffusecontfromapexwithdeg.lpy │ ├── 14-apical-dominance.lpy │ ├── 15-borchert-honda.lpy │ ├── 16a-branch-bending.lpy │ ├── 16b-branching-system-bending.lpy │ └── 17-open-lsystem-simple-growth.lpy └── tutorial │ ├── 01 - turtle │ ├── .ipynb_checkpoints │ │ └── Test-checkpoint.ipynb │ ├── 01 - equilateral-triangle.lpy │ ├── 02 - red-square.lpy │ ├── 03 - filled-square.lpy │ ├── 04 - polygon-mappleleaf.lpy │ ├── 05 - branches.lpy │ ├── 06 - setguide.lpy │ ├── 07 - sweepsurface.lpy │ ├── 08 - texturedpatch.json │ ├── 08 - texturedpatch.lpy │ ├── 09 - tropism.lpy │ ├── 10 - rotations.json │ ├── 10 - rotations.lpy │ ├── 11 - dynamictropism.lpy │ └── Test.ipynb │ ├── 02 - fractals │ ├── .ipynb_checkpoints │ │ └── Test-checkpoint.ipynb │ ├── Test.ipynb │ ├── barnsleyfern.lpy │ ├── barnsleyfern2.lpy │ ├── barnsleyfern3.lpy │ ├── cantorset.lpy │ ├── dragoncurve.lpy │ ├── gosper.lpy │ ├── hilbert-curve.lpy │ ├── hilbert3d.lpy │ ├── ifs.lpy │ ├── koch-curve.lpy │ ├── peanocurve-simple.lpy │ ├── peanocurve.json │ ├── peanocurve.lpy │ ├── quadratic-koch-island.lpy │ └── sierpinski.lpy │ ├── 03 - subdivision-curves │ ├── bspline.lpy │ ├── chaikin.lpy │ ├── decasteljau.lpy │ ├── dyn_levin_micchelli.lpy │ ├── interpolation.lpy │ ├── interpolation4.lpy │ └── subdivision-circle.lpy │ ├── 04 - simple-plant-archi │ ├── 01 - simple-sympodial-plant.lpy │ ├── 02 - random-tree.lpy │ ├── 03 - simple-differentiation.lpy │ └── 04 - leafyaxis.lpy │ ├── 05 - signals │ ├── 01 - fibonacci-fastinformationtransfer.lpy │ ├── 01 - fibonacci.lpy │ ├── 02 - branched-signal-acropetal.lpy │ ├── 02 - branched-signal-basipetal.lpy │ ├── 03 - flow1stem-random.lpy │ ├── 04 - flow1stem-diffusecontinuouslyfromroot.lpy │ ├── 05 - flow1stem-diffusecontfromapexwithdeg.lpy │ ├── 06 - borchert-honda.lpy │ └── 06 - flow-branching-system.lpy │ ├── 06 - environement │ ├── 01 - open-lsystem-simple-growth.lpy │ ├── 02 - houppier-light.lpy │ ├── 03 - leuwenberg-light.lpy │ ├── Archive.zip │ ├── grid-rootinsoil.lpy │ ├── grid-rootinsoil2.lpy │ ├── grid.py │ ├── interception.txt │ ├── lsystem_5.pyx │ └── spacecolonization.lpy │ ├── 07 - interaction │ └── selectandpaint.lpy │ ├── 08 - various │ ├── particles.lpy │ └── pendulum.lpy │ ├── 09 - carbon │ ├── electricnetwork.lpy │ └── globalpool.lpy │ ├── 10 - graphics │ ├── leaf1.jpg │ ├── leaftexture3.png │ └── orchidee.lpy │ ├── 11 - archimodels │ ├── cook.lpy │ ├── leuwenberg.lpy │ ├── massart.lpy │ ├── nozeran.lpy │ └── schoute.lpy │ ├── 12 - curved-space │ ├── noise_branch-2d.lpy │ ├── noise_branch.lpy │ ├── randombranches.lpy │ ├── sca-on-sphere.lpy │ └── turtle_on_patch.lpy │ ├── 13 - stochastic-topology │ ├── ex_lsys_markov.lpy │ └── note.txt │ └── lpy-paper12-examples │ ├── code2.py │ ├── code4.py │ ├── composition │ ├── A.lpy │ ├── A2B.lpy │ ├── A2C.lpy │ ├── B.lpy │ ├── B2A.lpy │ └── interpretation.lpy │ ├── lsystem1.lpy │ ├── lsystem10.lpy │ ├── lsystem11.lpy │ ├── lsystem3.lpy │ ├── lsystem5.lpy │ ├── lsystem6.lpy │ ├── lsystem7.lpy │ ├── lsystem8.lpy │ ├── lsystem9.lpy │ └── walnut.mtg ├── src ├── cpp │ ├── CMakeLists.txt │ ├── abstractlstring.h │ ├── argcollector.h │ ├── argcollector_core.h │ ├── axialtree.cpp │ ├── axialtree.h │ ├── axialtree_iter.h │ ├── axialtree_manip.h │ ├── compilation.cpp │ ├── compilation.h │ ├── consider.cpp │ ├── consider.h │ ├── debug_tool.cpp │ ├── debug_tool.h │ ├── error.cpp │ ├── error.h │ ├── execution.cpp │ ├── execution.h │ ├── global.h │ ├── interpretation.cpp │ ├── interpretation.h │ ├── lpy.vcproj │ ├── lpy_config.h │ ├── lpy_parser.cpp │ ├── lpy_parser.h │ ├── lpyrun.cpp │ ├── lpyrun.h │ ├── lstringmatcher.cpp │ ├── lstringmatcher.h │ ├── lsyscontext.cpp │ ├── lsyscontext.h │ ├── lsysoptions.cpp │ ├── lsysoptions.h │ ├── lsysrule.cpp │ ├── lsysrule.h │ ├── lsystem.cpp │ ├── lsystem.h │ ├── matching.cpp │ ├── matching.h │ ├── matching_tmpl.h │ ├── module.cpp │ ├── module.h │ ├── moduleclass.cpp │ ├── moduleclass.h │ ├── modulevtable.cpp │ ├── modulevtable.h │ ├── nodemodule.cpp │ ├── nodemodule.h │ ├── packedargs.h │ ├── paramproduction.cpp │ ├── paramproduction.h │ ├── patternmodule.cpp │ ├── patternmodule.h │ ├── patternstring.cpp │ ├── patternstring.h │ ├── plot.cpp │ ├── plot.h │ ├── predefinedmodules.cpp │ ├── stringmatching.cpp │ ├── stringmatching.h │ ├── tracker.cpp │ └── tracker.h ├── lpygui_postinstall.py ├── openalea │ ├── lpy │ │ ├── __init__.py │ │ ├── __lpyfuture__.py │ │ ├── __version__.py │ │ ├── composition.py │ │ ├── cpfg_compat │ │ │ ├── __init__.py │ │ │ ├── cpfg2lpy.py │ │ │ ├── data_import.py │ │ │ ├── func_compat.py │ │ │ └── vafile_import.py │ │ ├── defaultparameters.py │ │ ├── gui │ │ │ ├── abstractobjectmanager.py │ │ │ ├── biglogo.png │ │ │ ├── codeeditor.py │ │ │ ├── compile_ui.py │ │ │ ├── computationtask.py │ │ │ ├── debugger_right_ui.ui │ │ │ ├── debugger_ui.ui │ │ │ ├── documentation.py │ │ │ ├── flower.png │ │ │ ├── generate_ui.py │ │ │ ├── helpcard.txt │ │ │ ├── icons │ │ │ │ ├── BreakPoint.png │ │ │ │ ├── BreakPointGreen.png │ │ │ │ ├── book.png │ │ │ │ ├── closetab.png │ │ │ │ ├── codefile-red.png │ │ │ │ ├── codefile.png │ │ │ │ ├── down.png │ │ │ │ ├── editcopy.png │ │ │ │ ├── editcut.png │ │ │ │ ├── editfind.png │ │ │ │ ├── editpaste.png │ │ │ │ ├── editraise.png │ │ │ │ ├── editredo.png │ │ │ │ ├── editundo.png │ │ │ │ ├── exit.png │ │ │ │ ├── fileclose.png │ │ │ │ ├── filenew.png │ │ │ │ ├── fileopen.png │ │ │ │ ├── filesave.png │ │ │ │ ├── filesaveall.png │ │ │ │ ├── greenarrow16.png │ │ │ │ ├── history.png │ │ │ │ ├── lock.png │ │ │ │ ├── mango.png │ │ │ │ ├── next-green.png │ │ │ │ ├── next.png │ │ │ │ ├── pause.png │ │ │ │ ├── play-green.png │ │ │ │ ├── play-yellow.png │ │ │ │ ├── play.png │ │ │ │ ├── prev-green.png │ │ │ │ ├── prev.png │ │ │ │ ├── print.png │ │ │ │ ├── record.png │ │ │ │ ├── resetzoom.png │ │ │ │ ├── rewind.png │ │ │ │ ├── run.png │ │ │ │ ├── step.png │ │ │ │ ├── svn-add.png │ │ │ │ ├── svn-conflict.png │ │ │ │ ├── svn-modified.png │ │ │ │ ├── svn-normal.png │ │ │ │ ├── up.png │ │ │ │ ├── warningsErrors.png │ │ │ │ ├── warningsErrors16.png │ │ │ │ ├── wrap.png │ │ │ │ ├── zoomin.png │ │ │ │ └── zoomout.png │ │ │ ├── killsimulationdialog.py │ │ │ ├── killsimulationwidget.ui │ │ │ ├── log.txt │ │ │ ├── logdialog.ui │ │ │ ├── logindialog.ui │ │ │ ├── logo.ico │ │ │ ├── logo.png │ │ │ ├── lpy.pyw │ │ │ ├── lpycodeeditor.py │ │ │ ├── lpydock.py │ │ │ ├── lpymainwindow.ui │ │ │ ├── lpypreferences.py │ │ │ ├── lpyprefwidget.ui │ │ │ ├── lpyprofiling.py │ │ │ ├── lpyresources.qrc │ │ │ ├── lpyshell.py │ │ │ ├── lpystudio.py │ │ │ ├── lpystudiodebugger.py │ │ │ ├── lpytabbar.py │ │ │ ├── lpytmpfile.py │ │ │ ├── lpyview3d.py │ │ │ ├── objectdialog.py │ │ │ ├── objectmanagers.py │ │ │ ├── objectpanel.py │ │ │ ├── optioneditordelegate.py │ │ │ ├── plugins │ │ │ │ ├── __init__.py │ │ │ │ ├── curve2dmanager.py │ │ │ │ ├── functionmanager.py │ │ │ │ ├── nurbspatch3dmanager.py │ │ │ │ └── nurbspatchmanager.py │ │ │ ├── pymodulemonitoring.py │ │ │ ├── qt_check.py │ │ │ ├── reformatingcode.py │ │ │ ├── scalareditor.py │ │ │ ├── scalarfloatmetaedit.ui │ │ │ ├── scalarmetaedit.ui │ │ │ ├── settings.py │ │ │ ├── shared_data.py │ │ │ ├── simulation.py │ │ │ ├── streamredirection.py │ │ │ └── svnmanip.py │ │ ├── lsmtg.py │ │ ├── lstring2json.py │ │ ├── lsysparameters │ │ │ ├── __init__.py │ │ │ ├── scalar.py │ │ │ └── schema │ │ │ │ ├── appearance.json │ │ │ │ ├── boolean.json │ │ │ │ ├── category.json │ │ │ │ ├── color.json │ │ │ │ ├── color4.json │ │ │ │ ├── credits.json │ │ │ │ ├── curve.json │ │ │ │ ├── lpy.json │ │ │ │ ├── material.json │ │ │ │ ├── number.json │ │ │ │ ├── options.json │ │ │ │ ├── patch.json │ │ │ │ ├── point2array.json │ │ │ │ ├── point3array.json │ │ │ │ ├── point3matrix.json │ │ │ │ ├── point4array.json │ │ │ │ ├── point4grid.json │ │ │ │ ├── point4matrix.json │ │ │ │ ├── realarray.json │ │ │ │ └── texture2d.json │ │ ├── parameterset.py │ │ ├── pytranslation.py │ │ ├── simlab │ │ │ ├── __init__.py │ │ │ ├── lpy_process.py │ │ │ └── paramtable.py │ │ └── tableparameterset.py │ └── lpy_wralea │ │ ├── __init__.py │ │ ├── __wralea__.py │ │ └── lpy_nodes.py └── wrapper │ ├── CMakeLists.txt │ ├── export_axialtree.cpp │ ├── export_consider.cpp │ ├── export_debugger.cpp │ ├── export_interpretation.cpp │ ├── export_lstring.h │ ├── export_lsyscontext.cpp │ ├── export_lsysoptions.cpp │ ├── export_lsysrule.cpp │ ├── export_lsystem.cpp │ ├── export_lsystem.h │ ├── export_module.cpp │ ├── export_module.h │ ├── export_moduleclass.cpp │ ├── export_nodemodule.cpp │ ├── export_parser.cpp │ ├── export_patternmodule.cpp │ ├── export_patternstring.cpp │ ├── export_plot.cpp │ ├── export_stringmatching.cpp │ ├── lsystems_wrapper.cpp │ └── wraplpy.vcproj ├── test ├── cembedding │ ├── SConstruct │ ├── embeddedlpy │ ├── main.cpp │ └── test_cembedding.py ├── diese_bug.lpy ├── extension │ ├── alias.lpy │ ├── comments.lpy │ ├── filter_string.lpy │ ├── filtering.lpy │ ├── getmodule.lpy │ ├── iterator.lpy │ ├── iterator_end.lpy │ ├── multiplerepexp.lpy │ ├── new.lpy │ ├── norepexp.lpy │ ├── or.lpy │ ├── re-predecessor.lpy │ ├── rigth_match.lpy │ └── unpacking.lpy ├── fibonacci.lpy ├── image │ └── bjunipc.png ├── lpytest │ ├── MoveToBug.lpy │ ├── import_with_module_in_name.lpy │ ├── multiscalexmatching.lpy │ ├── multiscalexmatching2.lpy │ ├── nF.lpy │ ├── nodeposition.lpy │ ├── nodeposition2.lpy │ ├── recursiveproduce.lpy │ ├── sweep.lpy │ ├── tableparameters.lpy │ ├── test_axialmatching.lpy │ ├── test_backward_multimatch.lpy │ ├── test_comment.lpy │ ├── test_complex_match.lpy │ ├── test_components.lpy │ ├── test_concavepoly.lpy │ ├── test_consider_bracket.lpy │ ├── test_consider_per_rule.lpy │ ├── test_deflateargs.lpy │ ├── test_deflatekwd.lpy │ ├── test_emptyline.lpy │ ├── test_endeach_modif.lpy │ ├── test_frame.lpy │ ├── test_framedisplay.lpy │ ├── test_function.lpy │ ├── test_functionalaxiom.lpy │ ├── test_getmod.lpy │ ├── test_getmod_sons.lpy │ ├── test_in_left_context.lpy │ ├── test_in_right_context.lpy │ ├── test_inheritance.lpy │ ├── test_inheritance_simple.lpy │ ├── test_interpretation_turtle.lpy │ ├── test_lateral_msmatch.lpy │ ├── test_leftcontext.lpy │ ├── test_lstring_change.lpy │ ├── test_lstring_change2.lpy │ ├── test_lstring_change3.lpy │ ├── test_lstring_pushpop.lpy │ ├── test_ms_flow.lpy │ ├── test_multiple_inleftcontext.lpy │ ├── test_multiscale_leftcontext.lpy │ ├── test_newleftcontext.lpy │ ├── test_newrightcontext.lpy │ ├── test_nullradius.lpy │ ├── test_olineto.lpy │ ├── test_parametric_inleftcontext.lpy │ ├── test_patch.lpy │ ├── test_patch3d.lpy │ ├── test_path.lpy │ ├── test_path2.lpy │ ├── test_path3.lpy │ ├── test_path4.lpy │ ├── test_path_simple.lpy │ ├── test_pglshape.lpy │ ├── test_pglshapes.lpy │ ├── test_polygon.lpy │ ├── test_pproduce.lpy │ ├── test_profile.lpy │ ├── test_profiler.lpy │ ├── test_pushpop.lpy │ ├── test_recursiveinterpretation.lpy │ ├── test_repexp.lpy │ ├── test_repr.lpy │ ├── test_scalar_category.lpy │ ├── test_scalars.lpy │ ├── test_shape_ids.lpy │ ├── test_startendinterpretation.lpy │ ├── test_stop.lpy │ ├── test_stringleftcontext.lpy │ ├── test_svnadd.lpy │ ├── test_unicode.lpy │ └── turtlewarning.lpy ├── p_h_enviro.lpy ├── plotredirection.py ├── test_axial_matching.lpy ├── test_axial_msmatch.lpy ├── test_axialtree.py ├── test_debugger.py ├── test_dynrules.py ├── test_endeach.py ├── test_enviro.py ├── test_execcontext.py ├── test_extern.py ├── test_fibonacci.py ├── test_find.py ├── test_fname.py ├── test_framedisplay.py ├── test_genscene.py ├── test_geometry.py ├── test_group.lpy ├── test_group.py ├── test_homrule.py ├── test_interpret.py ├── test_kwd.lpy ├── test_kwd.py ├── test_kwd2.lpy ├── test_lpytest.py ├── test_lsysparam_material.py ├── test_lsysparameter.py ├── test_lsystem_as_module.py ├── test_lsystemiterator.py ├── test_matching.py ├── test_matching_future.lpy ├── test_memory.py ├── test_modnamespace.py ├── test_msmatch.lpy ├── test_multiline_produce.lpy ├── test_multiline_produce.py ├── test_nproduce.lpy ├── test_nproduce.py ├── test_parsing.py ├── test_perf.lpy ├── test_pickle.py ├── test_predecessor_at_scale.py ├── test_recursicecall.py ├── test_regexpmatching.py ├── test_selection.lpy ├── test_selection.py ├── test_shareexamples.py ├── test_simple_lsystem.py ├── test_simple_matching.lpy ├── test_starmatching.py ├── test_stringmatching.py ├── test_successor_at_scale.py ├── test_tree_matching.py ├── test_ui.py ├── test_upnamespace.py ├── testresources.py ├── tofix │ ├── LatitudesTest.lpy │ ├── test_all_multiscalematch.lpy │ ├── test_bracketmatching_perf.lpy │ ├── test_derivationlengthinc.lpy │ ├── test_inc1.lpy │ ├── test_inc2.lpy │ └── test_multiscale_rightcontext.lpy └── ui │ ├── test2D.lpy │ ├── test2Dcurve.lpy │ ├── test2Dtext.lpy │ ├── test_interaction.lpy │ ├── test_interpolatecolors.lpy │ ├── test_interpolatetexturebasecolors.lpy │ ├── test_killtask.lpy │ ├── test_quad.lpy │ ├── test_rollToHorizontal.lpy │ ├── test_texture.lpy │ ├── test_textureOnContinuousF.lpy │ ├── test_textureOnF.lpy │ ├── test_textureOnPatch.lpy │ ├── test_ui_error.lpy │ ├── test_ui_matplotlib.lpy │ ├── testbox.lpy │ └── testobj.mtl ├── tmp ├── axiom.txt ├── myscene.ply ├── readaxiom.lpy ├── test-shell.lpy ├── test.lpy ├── testinterpol.lpy ├── testvisu.lpy ├── trianglemix.lpy └── visu.lpy ├── travis.yml ├── treex ├── ex1.json ├── ex2.json ├── json.py └── lilac180-medium2.txt ├── versionmanager.py └── windows_build_dev.bat /.github/workflows/conda-package-build.yml: -------------------------------------------------------------------------------- 1 | name: Building Package 2 | 3 | on: 4 | push: 5 | branches: 6 | - '**' 7 | tags: 8 | - 'v*' 9 | pull_request: 10 | branches: 11 | - '**' 12 | 13 | 14 | jobs: 15 | build: 16 | uses: openalea/github-action-conda-build/.github/workflows/conda-package-build.yml@main 17 | with: 18 | conda-channels: openalea3, conda-forge 19 | secrets: 20 | anaconda_token: ${{ secrets.ANACONDA_TOKEN }} 21 | 22 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | travis.yml -------------------------------------------------------------------------------- /AUTHORS.txt: -------------------------------------------------------------------------------- 1 | Authors: 2 | Frédéric Boudon 3 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/LICENSE.txt -------------------------------------------------------------------------------- /PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 1.0 2 | Name: VPlants.Lpy 3 | Version: 1.6.1.dev-r0 4 | Summary: Lindenmayer Systems in Python package for OpenAlea. 5 | Home-page: http://openalea.gforge.inria.fr/dokuwiki/doku.php?id=packages:vplants:lpy:main 6 | Author: Frederic Boudon 7 | Author-email: frederic.boudon@cirad.fr 8 | License: Cecill V2 9 | Description: A Python version of Lindenmayer Systems. Based on Dr. Prusinkiewicz et al. cpfg-lpfg specifications. Implemented by the Virtual Plants team. 10 | Platform: UNKNOWN 11 | -------------------------------------------------------------------------------- /Py2Exe-HowTo.txt: -------------------------------------------------------------------------------- 1 | - launch python p2esetup.py py2exe 2 | - copy C:\Python25\Lib\site-packages\OpenGL into dist\ 3 | - copy C:\Python25\Lib\site-packages\setuptools-xxx-pyxx.egg into dist\ 4 | - run nsis on lpy-bundle.nsi -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | conda mambabuild . -c conda-forge -c fredboudon --python=3.10 --no-test 2 | -------------------------------------------------------------------------------- /cmake/FindPython.cmake: -------------------------------------------------------------------------------- 1 | find_package(Python3 COMPONENTS Development REQUIRED) 2 | 3 | if (Python3_FOUND) 4 | if (Python3_VERSION_MINOR LESS 6) 5 | message(SEND_ERROR "Python 3.6 or greater is required.") 6 | else() 7 | include_directories(${Python3_INCLUDE_DIRS}) 8 | endif() 9 | 10 | set(BOOST_PYTHON_LIB "python3${Python3_VERSION_MINOR}") 11 | endif() 12 | -------------------------------------------------------------------------------- /compile-macport.sh: -------------------------------------------------------------------------------- 1 | cd build 2 | cmake -DCMAKE_BUILD_TYPE=Release \ 3 | -DPLANTGL_ROOT=../plantgl/build-cmake/ \ 4 | -DCMAKE_INSTALL_PREFIX=../build-cmake/ \ 5 | -DBoost_INCLUDE_DIR=/opt/local/include \ 6 | -LAH .. 7 | make -j 8 8 | make install 9 | cd - -------------------------------------------------------------------------------- /conda/bld.bat: -------------------------------------------------------------------------------- 1 | :: Working Dir 2 | mkdir build 3 | cd build 4 | 5 | :: Build 6 | cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% -DCMAKE_BUILD_TYPE=Release -DPython3_EXECUTABLE=%PYTHON% -LAH .. 7 | if errorlevel 1 exit 1 8 | nmake 9 | if errorlevel 1 exit 1 10 | nmake install 11 | if errorlevel 1 exit 1 12 | 13 | :: Install Python Files 14 | cd .. 15 | %PYTHON% setup.py install 16 | if errorlevel 1 exit 1 17 | -------------------------------------------------------------------------------- /conda/conda_build_config.yaml: -------------------------------------------------------------------------------- 1 | cxx_compiler: 2 | - gxx # [linux] 3 | - clangxx # [osx] 4 | - vs2019 # [win] 5 | compiler_version: 6 | - 11 # [osx] 7 | - 11.2.0 # [linux] 8 | cxx_compiler_version: 9 | - 11 # [osx] 10 | - 11.2.0 # [linux] 11 | MACOSX_DEPLOYMENT_TARGET: # [osx] 12 | - '10.12' # [osx] 13 | MACOSX_SDK_VERSION: # [osx and x86_64] 14 | - '10.12' # [osx and x86_64] 15 | pin_run_as_build: 16 | boost: x.x 17 | openalea.plantgl: x.x -------------------------------------------------------------------------------- /conda/icon_64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/conda/icon_64x64.png -------------------------------------------------------------------------------- /construct.yaml: -------------------------------------------------------------------------------- 1 | # do not edit the following line. It will be updated automatically 2 | {% set version = "2.7.2" %} 3 | 4 | name: openalea.lpy 5 | version: {{ version }} 6 | 7 | channels: 8 | - https://conda.anaconda.org/ethan13310/ 9 | - https://repo.anaconda.com/pkgs/main/ 10 | 11 | specs: 12 | - python 13 | - pyqt 14 | - pyopengl 15 | - pyqglviewer 16 | - scipy 17 | - matplotlib 18 | - openalea.plantgl 19 | - openalea.lpy 20 | 21 | license_file: LICENSE.txt 22 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: vplants-lpy 2 | Maintainer: Frederic Boudon 3 | Section: python 4 | Priority: optional 5 | Build-Depends: python-all (>= 2.6.6-3~), python-setuptools (>= 0.6b3), python-dev, debhelper (>= 7), python-vplants.plantgl, python-openalea.deploy, python-openalea.sconsx, libqt4-dev, libqt4-opengl-dev, libboost-python-dev, libreadline-dev, pkg-config, freeglut3-dev 6 | 7 | Package: python-vplants.lpy 8 | Architecture: any 9 | Depends: ${misc:Depends}, ${python:Depends}, ${shlibs:Depends}, python-vplants.plantgl, python-opengl, pyqglviewer, python-openalea.vpltk 10 | Provides: ${python:Provides} 11 | Description: Lindenmayer Systems in Python package for OpenAlea. 12 | A Python version of Lindenmayer Systems. Based on Dr. Prusinkiewicz et al. cpfg-lpfg specifications. Implemented by the Virtual Plants team. 13 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | This package was debianized by Christophe Pradal on Tue, 21 Sep 2010 16:27:36 +0200. 2 | 3 | It was downloaded from http://gforge.inria.fr/projects/openalea/ 4 | 5 | Upstream Authors: 6 | 7 | Frederic Boudon 8 | 9 | Copyright: 10 | 11 | Copyright (C) 2009-2010 INRIA - CIRAD - INRA 12 | 13 | License: 14 | 15 | This software is governed by the CeCILL-V2 license under French law and 16 | abiding by the rules of distribution of free software. You can use, 17 | modify and/ or redistribute the software under the terms of the CeCILL-V2 18 | license as circulated by CEA, CNRS and INRIA at the following URL 19 | "http://www.cecill.info". 20 | 21 | The Debian packaging is (C) 2010, Christophe Pradal and 22 | is licensed under the GPL, see `/usr/share/common-licenses/GPL'. 23 | 24 | -------------------------------------------------------------------------------- /debian/lpy.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=L-Py 3 | Comment=L-System in Python 4 | Exec=lpy 5 | Icon=lpy 6 | Terminal=false 7 | Type=Application 8 | Categories=Education;Science;Biology; 9 | StartupNotify=true 10 | -------------------------------------------------------------------------------- /debian/python-vplants.lpy.install: -------------------------------------------------------------------------------- 1 | debian/lpy.xpm usr/share/pixmaps 2 | debian/lpy.desktop usr/share/applications 3 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | # This file was automatically generated by stdeb 0.6.0+git at 4 | # Tue, 11 Sep 2012 15:20:08 +0200 5 | 6 | %: 7 | dh $@ --with python2 --buildsystem=python_distutils 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 1.0 2 | -------------------------------------------------------------------------------- /doc/_conf.py: -------------------------------------------------------------------------------- 1 | import os,sys 2 | from os.path import join as pj 3 | 4 | # read sphinx conf.py file 5 | from openalea.misc.sphinx_configuration import * 6 | from openalea.misc.sphinx_tools import sphinx_check_version 7 | from openalea.deploy.metainfo import read_metainfo, compulsary_words 8 | 9 | sphinx_check_version() # check that sphinx version is recent 10 | metadata = read_metainfo('../metainfo.ini') # read metainfo from common file with setup.py 11 | for key in compulsary_words: 12 | exec("%s = '%s'" % (key, metadata[key])) 13 | 14 | f = pj(os.path.dirname(__file__),'..','src', 'openalea', 'lpy','__version__.py') 15 | d = {} 16 | execfile(f,d,d) 17 | version= d['LPY_NUM_VERSION_STR'] 18 | release= d['LPY_RELEASE_STR'] 19 | 20 | # by product that need to be updated: 21 | latex_documents = [('contents', 'main.tex', project + ' documentation', authors, 'manual')] 22 | 23 | project = project + '.' + package 24 | -------------------------------------------------------------------------------- /doc/_downloads/Frame.lpy: -------------------------------------------------------------------------------- 1 | 2 | Axiom: Frame 3 | 4 | derivation length: 1 5 | production: 6 | 7 | 8 | interpretation: 9 | 10 | 11 | endlsystem 12 | -------------------------------------------------------------------------------- /doc/_downloads/InterpolateColors.lpy: -------------------------------------------------------------------------------- 1 | #First Example 2 | 3 | Step = 20 4 | DIncr = 1.0 / Step 5 | 6 | Axiom: 7 | d = 0.0 8 | for i in range(Step): 9 | nproduce InterpolateColors(3, 5, d) F(2.0 / Step) 10 | d += DIncr 11 | produce ;(2) @O(0.15) 12 | 13 | #Second Example 14 | 15 | #Step = 4 16 | #DIncr = 1.0 / Step 17 | 18 | #Axiom: 19 | # d = 0.0 20 | # for i in range(Step): 21 | # nproduce InterpolateColors(2, 6, d) F(2.0 /Step) 22 | # d += DIncr 23 | # produce ;(1) @O(0.15) 24 | 25 | derivation length: 1 26 | production: 27 | 28 | 29 | interpretation: 30 | 31 | 32 | endlsystem 33 | -------------------------------------------------------------------------------- /doc/_downloads/LineTo.lpy: -------------------------------------------------------------------------------- 1 | Axiom: LineTo(0,0,3)[LineTo(0,1,4)]LineTo(0,0,5) 2 | 3 | Axiom: LineTo(0,0,3)[+(90)LineTo(0,1,4)]-(30)LineTo(0,0,5) 4 | 5 | #Axiom: LineTo(0,0,2)[LineTo(0,1,3)Frame]LineTo(0,0,3)[LineTo(0,-1,4)Frame]LineTo(0,0,5) 6 | #Same but change the turtle's orientation on the branches 7 | #Axiom: LineTo(0,0,2)[OLineTo(0,1,3)Frame]LineTo(0,0,3)[OLineTo(0,-1,4)Frame]LineTo(0,0,5) 8 | 9 | #The branch is created from (0,0,2) to (0,1,2) 10 | #Axiom: LineTo(0,0,2)[LineTo(0,1,2)]LineTo(0,0,4) 11 | #The branch is created from (0,0,2) to (0,0+1,2+2) 12 | #Axiom: LineTo(0,0,2)[LineRel(0,1,2)]LineTo(0,0,4) 13 | 14 | derivation length: 1 15 | production: 16 | 17 | 18 | interpretation: 19 | 20 | 21 | endlsystem 22 | -------------------------------------------------------------------------------- /doc/_downloads/advancedRotations.lpy: -------------------------------------------------------------------------------- 1 | Axiom: Frame(2) | Frame(2) 2 | #Axiom: Frame(2) UpReflexion Frame(2) 3 | #Axiom: Frame(2) LeftReflexion Frame(2) 4 | #Axiom: Frame(2) HeadingReflexion Frame(2) 5 | 6 | derivation length: 1 7 | production: 8 | 9 | 10 | interpretation: 11 | 12 | 13 | endlsystem 14 | -------------------------------------------------------------------------------- /doc/_downloads/basicShapes.lpy: -------------------------------------------------------------------------------- 1 | #Draw a sphere of radius 1 2 | Axiom: @O(1) 3 | #Draw a circle of radius 1 4 | #Axiom: @o(1) 5 | #Draw a box of length 1 6 | #Axiom: @B(1) 7 | #Draw a quad of length 1 8 | #Axiom: @b(1) 9 | 10 | #Display some text 11 | #Axiom: @L("This is some text", 18) 12 | 13 | derivation length: 1 14 | production: 15 | 16 | 17 | interpretation: 18 | 19 | 20 | endlsystem 21 | -------------------------------------------------------------------------------- /doc/_downloads/branching.lpy: -------------------------------------------------------------------------------- 1 | #Simple branching 2 | Axiom: F(4)[+F(3)]F(4) 3 | #More branches 4 | #Axiom: F(4)[+F(2)[+F(1)]F(1)]F(3)[-F(1)]F(1) 5 | #Visualizing the frames at different steps 6 | #Axiom: Frame F(4)[+F(2)[+F(1)Frame]F(1)]FrameF(3)[-F(1)]F(1) 7 | #Combined with other primitives 8 | #Axiom: F(4)[+F(2)[+F(1);(3)@O(0.2)]F(1);(3)@O(0.2)]F(3)[-F(1);(3)@O(0.2)]F(1);(3)@O(0.2) 9 | 10 | derivation length: 1 11 | production: 12 | 13 | 14 | interpretation: 15 | 16 | 17 | endlsystem 18 | -------------------------------------------------------------------------------- /doc/_downloads/combined.lpy: -------------------------------------------------------------------------------- 1 | Axiom: F[;+~l]F[;-~l]F[;+~l]F[;-~l]F[;+~l]F[;-~l]F 2 | 3 | #Axiom: ;@B(5),@O(0.5)_(0.5)F(3,0.5)_(0.2)@O(0.5) 4 | 5 | derivation length: 1 6 | production: 7 | 8 | 9 | interpretation: 10 | 11 | 12 | endlsystem 13 | -------------------------------------------------------------------------------- /doc/_downloads/generalizedCylinders.lpy: -------------------------------------------------------------------------------- 1 | #Cylinders not generalized 2 | Axiom: F(2)+(30)F+(30)F+(30)F+(45)F+(45)F@O 3 | 4 | #Cylinders generalized 5 | #Axiom: @GcF(2)+(30)F+(30)F+(30)F+(45)F+(45)F@O@Ge 6 | 7 | derivation length: 1 8 | production: 9 | 10 | 11 | interpretation: 12 | 13 | 14 | endlsystem 15 | -------------------------------------------------------------------------------- /doc/_downloads/harderExample.lpy: -------------------------------------------------------------------------------- 1 | Axiom: F[;-(70)f(0.1)\(80)~l]F[;+(70)f(0.1)/(80)~l][-F[;+(100)f(0.1)/(80)~l][F(1.2);@O(0.2)]-F(0.6)[-f(0.4);(3)@O(0.3)]F(0.6);@O(0.2)]F(1.5)[;+(70)f(0.1)/(70)~l]F(0.1)[+F;@O(0.2)]F;@O(0.2) 2 | 3 | derivation length: 1 4 | production: 5 | 6 | 7 | interpretation: 8 | 9 | 10 | endlsystem 11 | -------------------------------------------------------------------------------- /doc/_downloads/longPath.lpy: -------------------------------------------------------------------------------- 1 | #Equivalent to FF+(20)FF+(20)@D(0.8)FFF 2 | Axiom: nF(2,1)+(20)nF(2,1)+(20)@D(0.8)nF(3,1) 3 | 4 | #Branching shape 5 | #Axiom: nF(2,1)[+(45)nF(2,1)]nF(1,1)[-(45)nF(2,1)]nF(2,1) 6 | 7 | derivation length: 1 8 | production: 9 | 10 | 11 | interpretation: 12 | 13 | 14 | endlsystem 15 | -------------------------------------------------------------------------------- /doc/_downloads/movement.lpy: -------------------------------------------------------------------------------- 1 | #MoveTo using coordinates 2 | Axiom: @M(0,2,0) Frame 3 | 4 | #MoveTo using a vector 5 | #import numpy as np 6 | #v = np.array([0,1,1]) 7 | #Axiom: MoveTo(v) 8 | 9 | #MoveRel 10 | #Axiom: F MoveTo(0,3,0) Frame 11 | #Axiom: F MoveRel(0,3,0) Frame 12 | 13 | derivation length: 1 14 | production: 15 | 16 | 17 | interpretation: 18 | 19 | 20 | endlsystem 21 | -------------------------------------------------------------------------------- /doc/_downloads/orientation.lpy: -------------------------------------------------------------------------------- 1 | #Orient the turtle using coordinates 2 | Axiom: Pinpoint(1,0,0) Frame 3 | #Orient the turtle using a vector 4 | #import numpy as np 5 | #v = np.array([0,1,0]) 6 | #Axiom: Pinpoint(v) Frame 7 | #Another example 8 | #Axiom: Pinpoint(1,1,0) Frame 9 | 10 | #PinpointRel 11 | #Axiom: Frame MoveTo(0,2,0) Pinpoint(1,0,1) Frame 12 | #Axiom: Frame MoveTo(0,2,0) PinpointRel(1,0,1) Frame 13 | 14 | derivation length: 1 15 | production: 16 | 17 | 18 | interpretation: 19 | 20 | 21 | endlsystem 22 | -------------------------------------------------------------------------------- /doc/_downloads/polygons.lpy: -------------------------------------------------------------------------------- 1 | #Basic method 2 | Axiom: Frame(2)+(30)F(5)+(120)F(5)+(120)F(5) 3 | #Procedural method 4 | #Axiom: Frame(2)+F(5)+F(5)+F(5)+F(5)+F(5)+F(5) 5 | # Or equivalently: 6 | #Axiom: 7 | # nproduce Frame(2) 8 | # for i in range(6): 9 | # nproduce +F(5) 10 | 11 | derivation length: 1 12 | production: 13 | 14 | 15 | interpretation: 16 | 17 | 18 | endlsystem 19 | -------------------------------------------------------------------------------- /doc/_downloads/resolution.lpy: -------------------------------------------------------------------------------- 1 | #low resolution 2 | Axiom: SectionResolution(4) FFF@O(0.5) 3 | #better resolution 4 | #Axiom: SectionResolution(60) FFF@O(0.5) 5 | 6 | derivation length: 1 7 | production: 8 | 9 | 10 | interpretation: 11 | 12 | 13 | endlsystem 14 | -------------------------------------------------------------------------------- /doc/_downloads/rotation.lpy: -------------------------------------------------------------------------------- 1 | #Different turtle rotations 2 | Axiom: Frame(2) /(60) Frame(2) 3 | #Axiom: Frame(2) \(60) Frame(2) 4 | #Axiom: Frame(2) ^(60) Frame(2) 5 | #Axiom: Frame(2) &(60) Frame(2) 6 | #Axiom: Frame(2) +(60) Frame(2) 7 | #Axiom: Frame(2) -(60) Frame(2) 8 | 9 | derivation length: 1 10 | production: 11 | 12 | 13 | interpretation: 14 | 15 | 16 | endlsystem 17 | -------------------------------------------------------------------------------- /doc/_downloads/scale.lpy: -------------------------------------------------------------------------------- 1 | Axiom: FF[-F[-F]F]FF 2 | 3 | #Axiom: @D(2)FF[@Dd(1.5)-F[@Di(0.5)-F]F]FF 4 | 5 | derivation length: 1 6 | production: 7 | 8 | 9 | interpretation: 10 | 11 | 12 | endlsystem 13 | -------------------------------------------------------------------------------- /doc/_downloads/screen.lpy: -------------------------------------------------------------------------------- 1 | Axiom: Frame @2DF(0.6)@O(0.2) 2 | 3 | derivation length: 1 4 | production: 5 | 6 | 7 | interpretation: 8 | 9 | 10 | endlsystem 11 | -------------------------------------------------------------------------------- /doc/_downloads/setGuide1.lpy: -------------------------------------------------------------------------------- 1 | from openalea.plantgl.all import Polyline2D 2 | from numpy import arange 3 | 4 | def f(u): 5 | return (u,u**2) 6 | 7 | C0 = Polyline2D([f(u) for u in arange(0,1,0.1)]) # (B) 8 | 9 | L = 10 10 | #L = 6 11 | #L = 15 12 | L0 = 10 13 | Axiom: SetGuide(C0,L0) nF(L, 0.1) 14 | 15 | derivation length: 1 16 | production: 17 | 18 | 19 | interpretation: 20 | 21 | 22 | endlsystem 23 | -------------------------------------------------------------------------------- /doc/_downloads/setGuide2.lpy: -------------------------------------------------------------------------------- 1 | L = 10 2 | #L = 6 3 | #L = 15 4 | L0 = 10 5 | Axiom: Frame SetGuide(C0,L0) nF(L, 0.1) 6 | #Axiom: Sweep(C0,C0,7,1) 7 | 8 | derivation length: 1 9 | production: 10 | 11 | 12 | interpretation: 13 | 14 | 15 | endlsystem 16 | ###### INITIALISATION ###### 17 | 18 | __lpy_code_version__ = 1.1 19 | 20 | def __initialiseContext__(context): 21 | import openalea.plantgl.all as pgl 22 | C0 = pgl.BezierCurve2D( 23 | pgl.Point3Array([(-0.5, 0, 1),(-0.171072, 0.38326, 1),(0.00367107, -0.317181, 1),(0.5, 0, 1)]) , 24 | ) 25 | C0.name = "C0" 26 | panel_0 = ({'active': True, 'visible': True, 'name': 'Panel 1'},[('Curve2D',C0)]) 27 | parameterset = [panel_0,] 28 | context["__functions__"] = [] 29 | context["__curves__"] = [('C0',C0),] 30 | context["__parameterset__"] = parameterset 31 | context["C0"] = C0 32 | -------------------------------------------------------------------------------- /doc/_downloads/setHLU.lpy: -------------------------------------------------------------------------------- 1 | #Setting the HLU 2 | #Using coordinates 3 | Axiom: Frame(2) @R(1,1,1,0,1,0) Frame(2) 4 | #using vectors 5 | #import numpy as np 6 | #h = np.array([0,1,0]) 7 | #u = np.array([1,0,1]) 8 | #Axiom: @R(h,u) Frame(2) 9 | 10 | #Using Euler Angles 11 | 12 | #Axiom: EulerAngles(0,0,0) Frame(2) 13 | #Axiom: EulerAngles(180,0,0) Frame(2) 14 | #Axiom: EulerAngles(180,90,0) Frame(2) 15 | 16 | #3 rotations to arrive to (30,90,60) 17 | #First : 18 | #Axiom: EulerAngles(30,0,0) Frame(2) 19 | #Then : 20 | #Axiom: EulerAngles(30,90,0) Frame(2) 21 | #Finally : 22 | #Axiom: EulerAngles(30,90,60) Frame(2) 23 | 24 | derivation length: 1 25 | production: 26 | 27 | 28 | interpretation: 29 | 30 | 31 | endlsystem 32 | -------------------------------------------------------------------------------- /doc/_downloads/tropism.lpy: -------------------------------------------------------------------------------- 1 | #Elasticity 2 | #Axiom: FF[Elasticity(0.5)+F+F]F[-F]F 3 | 4 | #Tropism 5 | import numpy as np 6 | v = np.array([0,1,2]) 7 | Axiom: FF[@Tp(v)+F+F]F[-F]F 8 | 9 | derivation length: 1 10 | production: 11 | 12 | 13 | interpretation: 14 | 15 | 16 | endlsystem 17 | -------------------------------------------------------------------------------- /doc/_downloads/visualize.lpy: -------------------------------------------------------------------------------- 1 | #Without Frames 2 | Axiom: FF[+ FF]FFF 3 | 4 | #With Frames 5 | #Axiom: Frame FF[+ FF Frame ]F Frame FF 6 | 7 | derivation length: 1 8 | production: 9 | 10 | 11 | interpretation: 12 | 13 | 14 | endlsystem 15 | -------------------------------------------------------------------------------- /doc/_downloads/width.lpy: -------------------------------------------------------------------------------- 1 | #Increase then decrease the width 2 | #Axiom: F_ _ _F!F!F 3 | 4 | #Set the width to 2 then to 3 and finally to 1 5 | Axiom: F_(2)F!(3)F!(1)F 6 | 7 | derivation length: 1 8 | production: 9 | 10 | 11 | interpretation: 12 | 13 | 14 | endlsystem 15 | -------------------------------------------------------------------------------- /doc/_images/2D1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/2D1.png -------------------------------------------------------------------------------- /doc/_images/2D2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/2D2.png -------------------------------------------------------------------------------- /doc/_images/@R.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/@R.png -------------------------------------------------------------------------------- /doc/_images/@R2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/@R2.png -------------------------------------------------------------------------------- /doc/_images/F-.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/F-.png -------------------------------------------------------------------------------- /doc/_images/F2,5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/F2,5.png -------------------------------------------------------------------------------- /doc/_images/F3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/F3.png -------------------------------------------------------------------------------- /doc/_images/LineRel1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/LineRel1.png -------------------------------------------------------------------------------- /doc/_images/LineRel2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/LineRel2.png -------------------------------------------------------------------------------- /doc/_images/LineTo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/LineTo.png -------------------------------------------------------------------------------- /doc/_images/LineTo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/LineTo2.png -------------------------------------------------------------------------------- /doc/_images/LineToBis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/LineToBis.png -------------------------------------------------------------------------------- /doc/_images/OLineTo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/OLineTo.png -------------------------------------------------------------------------------- /doc/_images/_F.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/_F.png -------------------------------------------------------------------------------- /doc/_images/axis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/axis.png -------------------------------------------------------------------------------- /doc/_images/basicPolygon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/basicPolygon.png -------------------------------------------------------------------------------- /doc/_images/box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/box.png -------------------------------------------------------------------------------- /doc/_images/branch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/branch.png -------------------------------------------------------------------------------- /doc/_images/branching1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/branching1.png -------------------------------------------------------------------------------- /doc/_images/branching2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/branching2.png -------------------------------------------------------------------------------- /doc/_images/branching3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/branching3.png -------------------------------------------------------------------------------- /doc/_images/circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/circle.png -------------------------------------------------------------------------------- /doc/_images/combined.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/combined.png -------------------------------------------------------------------------------- /doc/_images/combined2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/combined2.png -------------------------------------------------------------------------------- /doc/_images/cook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/cook.png -------------------------------------------------------------------------------- /doc/_images/cook_model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/cook_model.png -------------------------------------------------------------------------------- /doc/_images/curveS.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/curveS.tiff -------------------------------------------------------------------------------- /doc/_images/decrease_color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/decrease_color.png -------------------------------------------------------------------------------- /doc/_images/divScale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/divScale.png -------------------------------------------------------------------------------- /doc/_images/downArroundL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/downArroundL.png -------------------------------------------------------------------------------- /doc/_images/editor/ex001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/editor/ex001.png -------------------------------------------------------------------------------- /doc/_images/editor/ex001.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/editor/ex001.xcf -------------------------------------------------------------------------------- /doc/_images/editor/ex002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/editor/ex002.png -------------------------------------------------------------------------------- /doc/_images/editor/ex003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/editor/ex003.png -------------------------------------------------------------------------------- /doc/_images/editor/ex004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/editor/ex004.png -------------------------------------------------------------------------------- /doc/_images/editor/ex005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/editor/ex005.png -------------------------------------------------------------------------------- /doc/_images/editor/ex006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/editor/ex006.png -------------------------------------------------------------------------------- /doc/_images/editor/ex007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/editor/ex007.png -------------------------------------------------------------------------------- /doc/_images/editor/ex008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/editor/ex008.png -------------------------------------------------------------------------------- /doc/_images/editor/ex009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/editor/ex009.png -------------------------------------------------------------------------------- /doc/_images/editor/ex010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/editor/ex010.png -------------------------------------------------------------------------------- /doc/_images/editor/ex011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/editor/ex011.png -------------------------------------------------------------------------------- /doc/_images/editor/ex012.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/editor/ex012.png -------------------------------------------------------------------------------- /doc/_images/editor/ex013.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/editor/ex013.png -------------------------------------------------------------------------------- /doc/_images/editor/ex014.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/editor/ex014.png -------------------------------------------------------------------------------- /doc/_images/editor/ex015.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/editor/ex015.png -------------------------------------------------------------------------------- /doc/_images/euler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/euler.png -------------------------------------------------------------------------------- /doc/_images/euler2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/euler2.png -------------------------------------------------------------------------------- /doc/_images/euler3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/euler3.png -------------------------------------------------------------------------------- /doc/_images/euler4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/euler4.png -------------------------------------------------------------------------------- /doc/_images/euler5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/euler5.png -------------------------------------------------------------------------------- /doc/_images/euler6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/euler6.png -------------------------------------------------------------------------------- /doc/_images/ex009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/ex009.png -------------------------------------------------------------------------------- /doc/_images/ex009.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/ex009.tiff -------------------------------------------------------------------------------- /doc/_images/f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/f.png -------------------------------------------------------------------------------- /doc/_images/f2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/f2.png -------------------------------------------------------------------------------- /doc/_images/filledPolygon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/filledPolygon1.png -------------------------------------------------------------------------------- /doc/_images/filledPolygon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/filledPolygon2.png -------------------------------------------------------------------------------- /doc/_images/filledPolygon3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/filledPolygon3.png -------------------------------------------------------------------------------- /doc/_images/filledPolygon4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/filledPolygon4.png -------------------------------------------------------------------------------- /doc/_images/frame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/frame.png -------------------------------------------------------------------------------- /doc/_images/gallery/gallery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/gallery/gallery.png -------------------------------------------------------------------------------- /doc/_images/gallery/tomato.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/gallery/tomato.png -------------------------------------------------------------------------------- /doc/_images/generalized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/generalized.png -------------------------------------------------------------------------------- /doc/_images/harderExample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/harderExample.png -------------------------------------------------------------------------------- /doc/_images/increase_color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/increase_color.png -------------------------------------------------------------------------------- /doc/_images/initialScale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/initialScale.png -------------------------------------------------------------------------------- /doc/_images/interpolateColors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/interpolateColors.png -------------------------------------------------------------------------------- /doc/_images/interpolateColors2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/interpolateColors2.png -------------------------------------------------------------------------------- /doc/_images/leaf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/leaf.png -------------------------------------------------------------------------------- /doc/_images/leaf1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/leaf1.png -------------------------------------------------------------------------------- /doc/_images/leaf2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/leaf2.png -------------------------------------------------------------------------------- /doc/_images/leftArroundH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/leftArroundH.png -------------------------------------------------------------------------------- /doc/_images/leftArroundU.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/leftArroundU.png -------------------------------------------------------------------------------- /doc/_images/leuwenberg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/leuwenberg.png -------------------------------------------------------------------------------- /doc/_images/leuwenberg_model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/leuwenberg_model.png -------------------------------------------------------------------------------- /doc/_images/loopPolygon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/loopPolygon.png -------------------------------------------------------------------------------- /doc/_images/massart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/massart.png -------------------------------------------------------------------------------- /doc/_images/massart_model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/massart_model.png -------------------------------------------------------------------------------- /doc/_images/moveRel1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/moveRel1.png -------------------------------------------------------------------------------- /doc/_images/moveRel2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/moveRel2.png -------------------------------------------------------------------------------- /doc/_images/moveTo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/moveTo1.png -------------------------------------------------------------------------------- /doc/_images/moveTo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/moveTo2.png -------------------------------------------------------------------------------- /doc/_images/multScale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/multScale.png -------------------------------------------------------------------------------- /doc/_images/notGeneralized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/notGeneralized.png -------------------------------------------------------------------------------- /doc/_images/nozeran.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/nozeran.png -------------------------------------------------------------------------------- /doc/_images/nozeran_model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/nozeran_model.png -------------------------------------------------------------------------------- /doc/_images/path.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/path.png -------------------------------------------------------------------------------- /doc/_images/path2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/path2.png -------------------------------------------------------------------------------- /doc/_images/pinpoint1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/pinpoint1.png -------------------------------------------------------------------------------- /doc/_images/pinpoint2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/pinpoint2.png -------------------------------------------------------------------------------- /doc/_images/pinpoint3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/pinpoint3.png -------------------------------------------------------------------------------- /doc/_images/pinpointRel1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/pinpointRel1.png -------------------------------------------------------------------------------- /doc/_images/pinpointRel2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/pinpointRel2.png -------------------------------------------------------------------------------- /doc/_images/quad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/quad.png -------------------------------------------------------------------------------- /doc/_images/rescaling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/rescaling.png -------------------------------------------------------------------------------- /doc/_images/resolution1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/resolution1.png -------------------------------------------------------------------------------- /doc/_images/resolution2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/resolution2.png -------------------------------------------------------------------------------- /doc/_images/rightArroundH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/rightArroundH.png -------------------------------------------------------------------------------- /doc/_images/rightArroundU.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/rightArroundU.png -------------------------------------------------------------------------------- /doc/_images/rotation1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/rotation1.png -------------------------------------------------------------------------------- /doc/_images/rotation2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/rotation2.png -------------------------------------------------------------------------------- /doc/_images/rotation3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/rotation3.png -------------------------------------------------------------------------------- /doc/_images/rotation4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/rotation4.png -------------------------------------------------------------------------------- /doc/_images/rotation5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/rotation5.png -------------------------------------------------------------------------------- /doc/_images/rotation6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/rotation6.png -------------------------------------------------------------------------------- /doc/_images/schoute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/schoute.png -------------------------------------------------------------------------------- /doc/_images/schoute_model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/schoute_model.png -------------------------------------------------------------------------------- /doc/_images/screenshot2-3d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/screenshot2-3d.png -------------------------------------------------------------------------------- /doc/_images/setColor1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/setColor1.png -------------------------------------------------------------------------------- /doc/_images/setColor2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/setColor2.png -------------------------------------------------------------------------------- /doc/_images/setGuide1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/setGuide1.png -------------------------------------------------------------------------------- /doc/_images/setGuide2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/setGuide2.png -------------------------------------------------------------------------------- /doc/_images/setGuide3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/setGuide3.png -------------------------------------------------------------------------------- /doc/_images/setGuide4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/setGuide4.png -------------------------------------------------------------------------------- /doc/_images/setGuide5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/setGuide5.png -------------------------------------------------------------------------------- /doc/_images/sphere.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/sphere.png -------------------------------------------------------------------------------- /doc/_images/square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/square.png -------------------------------------------------------------------------------- /doc/_images/turnAround.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/turnAround.png -------------------------------------------------------------------------------- /doc/_images/turtle1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/turtle1.png -------------------------------------------------------------------------------- /doc/_images/turtle2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/turtle2.png -------------------------------------------------------------------------------- /doc/_images/turtle3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/turtle3.png -------------------------------------------------------------------------------- /doc/_images/turtle4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/turtle4.png -------------------------------------------------------------------------------- /doc/_images/upArroundL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/upArroundL.png -------------------------------------------------------------------------------- /doc/_images/width.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/width.png -------------------------------------------------------------------------------- /doc/_images/width2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/width2.png -------------------------------------------------------------------------------- /doc/_images/with_frame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_images/with_frame.png -------------------------------------------------------------------------------- /doc/_themes/sphinx_rtd_theme/__init__.py: -------------------------------------------------------------------------------- 1 | """Sphinx ReadTheDocs theme. 2 | 3 | From https://github.com/ryan-roemer/sphinx-bootstrap-theme. 4 | 5 | """ 6 | from os import path 7 | 8 | __version__ = '0.2.5b1' 9 | __version_full__ = __version__ 10 | 11 | 12 | def get_html_theme_path(): 13 | """Return list of HTML theme paths.""" 14 | cur_dir = path.abspath(path.dirname(path.dirname(__file__))) 15 | return cur_dir 16 | 17 | # See http://www.sphinx-doc.org/en/stable/theming.html#distribute-your-theme-as-a-python-package 18 | def setup(app): 19 | app.add_html_theme('sphinx_rtd_theme', path.abspath(path.dirname(__file__))) 20 | -------------------------------------------------------------------------------- /doc/_themes/sphinx_rtd_theme/searchbox.html: -------------------------------------------------------------------------------- 1 | {%- if builder != 'singlehtml' %} 2 |
3 |
4 | 5 | 6 | 7 |
8 |
9 | {%- endif %} 10 | -------------------------------------------------------------------------------- /doc/_themes/sphinx_rtd_theme/static/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_themes/sphinx_rtd_theme/static/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /doc/_themes/sphinx_rtd_theme/static/fonts/Inconsolata-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_themes/sphinx_rtd_theme/static/fonts/Inconsolata-Bold.ttf -------------------------------------------------------------------------------- /doc/_themes/sphinx_rtd_theme/static/fonts/Inconsolata-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_themes/sphinx_rtd_theme/static/fonts/Inconsolata-Regular.ttf -------------------------------------------------------------------------------- /doc/_themes/sphinx_rtd_theme/static/fonts/Lato-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_themes/sphinx_rtd_theme/static/fonts/Lato-Bold.ttf -------------------------------------------------------------------------------- /doc/_themes/sphinx_rtd_theme/static/fonts/Lato-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_themes/sphinx_rtd_theme/static/fonts/Lato-Regular.ttf -------------------------------------------------------------------------------- /doc/_themes/sphinx_rtd_theme/static/fonts/RobotoSlab-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_themes/sphinx_rtd_theme/static/fonts/RobotoSlab-Bold.ttf -------------------------------------------------------------------------------- /doc/_themes/sphinx_rtd_theme/static/fonts/RobotoSlab-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_themes/sphinx_rtd_theme/static/fonts/RobotoSlab-Regular.ttf -------------------------------------------------------------------------------- /doc/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /doc/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /doc/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /doc/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /doc/_themes/sphinx_rtd_theme/theme.conf: -------------------------------------------------------------------------------- 1 | [theme] 2 | inherit = basic 3 | stylesheet = css/theme.css 4 | 5 | [options] 6 | typekit_id = hiw1hhg 7 | analytics_id = 8 | sticky_navigation = False 9 | logo_only = 10 | collapse_navigation = False 11 | display_version = True 12 | navigation_depth = 4 13 | prev_next_buttons_location = bottom 14 | canonical_url = 15 | -------------------------------------------------------------------------------- /doc/contextesouples.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/contextesouples.docx -------------------------------------------------------------------------------- /doc/gallery.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/gallery.pptx -------------------------------------------------------------------------------- /doc/header.helpcard: -------------------------------------------------------------------------------- 1 | .title: "L-Py Helpcard" 2 | 3 | L-Py is based on the specification of Lstudio/cpfg-lpfg defined by P. Prusinkiewicz et al. (http://algorithmicbotany.org/lstudio). 4 | 5 | .sub-title: "Predefined Symbols" 6 | 7 | Here is a recap of the predefined symbol used in L-Py with their turtle interpretation: -------------------------------------------------------------------------------- /doc/user/autosum.rst: -------------------------------------------------------------------------------- 1 | .. _lpy_reference: 2 | 3 | Reference guide 4 | ############### 5 | .. contents:: 6 | 7 | Class Inheritance diagram 8 | ========================= 9 | .. .. inheritance-diagram:: openalea.lpy.__lpy_kernel__ 10 | 11 | .. currentmodule:: openalea.lpy.__lpy_kernel__ 12 | 13 | :mod:`openalea.lpy.gui.simulation` module 14 | ========================================= 15 | 16 | .. Download the source file :download:`../../src/openalea/lpy`. 17 | 18 | 19 | .. automodule:: openalea.lpy.__lpy_kernel__ 20 | :members: 21 | :undoc-members: 22 | :inherited-members: 23 | :show-inheritance: 24 | :synopsis: synopsis to be provided 25 | 26 | -------------------------------------------------------------------------------- /doc/user/massart.rst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/doc/user/massart.rst -------------------------------------------------------------------------------- /doc/user/overview.txt: -------------------------------------------------------------------------------- 1 | L-systems were conceived as a mathematical framework for modeling growth of plants. 2 | L-Py is a simulation software that mixes L-systems construction with the Python high-level modeling language. 3 | In addition to this software module, an integrated visual development environment has been developed that facilitates the creation of plant models. 4 | In particular, easy to use optimization tools have been integrated. 5 | Thanks to Python and its modular approach, this framework makes it possible to integrate a variety of tools defined in different modeling context, 6 | in particular tools from the OpenAlea platform. Additionally, it can be integrated as a simple growth simulation module 7 | into more complex computational pipelines. -------------------------------------------------------------------------------- /icons/bd536042325d768ef04c87bdef9097ff.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/icons/bd536042325d768ef04c87bdef9097ff.jpg -------------------------------------------------------------------------------- /icons/black-tree-silhouette-for-your-design-vector-9791662.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/icons/black-tree-silhouette-for-your-design-vector-9791662.jpg -------------------------------------------------------------------------------- /icons/concept-tree.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/icons/concept-tree.jpg -------------------------------------------------------------------------------- /icons/icon-tree-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/icons/icon-tree-3.jpg -------------------------------------------------------------------------------- /icons/icone.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/icons/icone.pptx -------------------------------------------------------------------------------- /mcondabuild.bat: -------------------------------------------------------------------------------- 1 | conda build . -c openalea/label/unstable -c conda-forge -c msys2 --no-test 2 | -------------------------------------------------------------------------------- /metainfo.ini: -------------------------------------------------------------------------------- 1 | [metainfo] 2 | version = 2.7.1 3 | release = 2.7 4 | project = openalea 5 | package = lpy 6 | name = OpenAlea.Lpy 7 | namespace = openalea 8 | pkg_name = openalea.lpy 9 | description = Lindenmayer Systems in Python package for OpenAlea. 10 | long_description= L-Py is a simulation software that mixes L-systems construction with the Python high-level modeling language. 11 | authors = Frederic Boudon 12 | authors_email = frederic.boudon@cirad.fr 13 | url= https://github.com/openalea/lpy 14 | # LGPL compatible INRIA license 15 | license = Cecill-C 16 | -------------------------------------------------------------------------------- /models/ArchiModels.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/models/ArchiModels.zip -------------------------------------------------------------------------------- /models/lpyimport/archi.lpy: -------------------------------------------------------------------------------- 1 | lpyimport flower 2 | 3 | dt = 0.2 4 | 5 | Axiom: Flower(0.1) 6 | 7 | derivation length: 1 8 | production: 9 | 10 | 11 | interpretation: 12 | 13 | 14 | endlsystem 15 | -------------------------------------------------------------------------------- /models/lpyimport/flower.lpy: -------------------------------------------------------------------------------- 1 | module Flower 2 | 3 | Axiom: Flower(0.1) 4 | 5 | name ='flower' 6 | 7 | dt = 0.1 8 | 9 | derivation length: 10 10 | production: 11 | 12 | Flower(t) --> Flower(t+dt) 13 | 14 | interpretation: 15 | 16 | Flower(t) : 17 | nproduce F(t)f(t) ;(4) @O(t) [;(3) 18 | for i in range(12): 19 | nproduce /(30)[&(80) f(t) ~l(2*t)] 20 | nproduce ] 21 | 22 | endlsystem 23 | -------------------------------------------------------------------------------- /models/pascaltriangle/pascaltriangle1.lpy: -------------------------------------------------------------------------------- 1 | # See http://fr.wikipedia.org/wiki/Triangle_de_Pascal 2 | 3 | Axiom: -(90) U(1) 4 | 5 | derivation length: 10 6 | production: 7 | 8 | 9 | U(x) < U(y) > U(z)--> U(x+y) 10 | U(x) < U(y) --> U(x+y) U(y) 11 | U(x) > U(y) --> U(x) 12 | U(x) --> U(x) U(x) 13 | 14 | 15 | interpretation: 16 | 17 | U(x) --> f(1)[+(90)f(0.1) Label(str(x))] 18 | 19 | endlsystem 20 | ###### INITIALISATION ###### 21 | 22 | __lpy_code_version__ = 1.1 23 | 24 | def __initialiseContext__(context): 25 | import openalea.plantgl.all as pgl 26 | Color_1 = pgl.Material("Color_1" , ambient = (0,0,0) , 27 | diffuse = 3 , 28 | specular = (0,0,0) , 29 | ) 30 | Color_1.name = "Color_1" 31 | context.turtle.setMaterial(1,Color_1) 32 | -------------------------------------------------------------------------------- /models/pascaltriangle/pascaltriangle2.lpy: -------------------------------------------------------------------------------- 1 | # See http://fr.wikipedia.org/wiki/Triangle_de_Pascal 2 | # symmetrical version 3 | 4 | Axiom: -(90) U(1) 5 | 6 | derivation length: 10 7 | production: 8 | 9 | 10 | E < U(y) > E--> E 11 | U(x) < E > U(y)--> U(x+y) 12 | 13 | U(x) > E --> U(x) E 14 | E < U(x) --> E U(x) 15 | U(x) --> U(x) E U(x) 16 | 17 | 18 | interpretation: 19 | 20 | U(x) --> f(1)[+(90)f(0.1) Label(str(x))] 21 | 22 | endlsystem 23 | ###### INITIALISATION ###### 24 | 25 | __lpy_code_version__ = 1.1 26 | 27 | def __initialiseContext__(context): 28 | import openalea.plantgl.all as pgl 29 | Color_1 = pgl.Material("Color_1" , ambient = (0,0,0) , 30 | diffuse = 3 , 31 | specular = (0,0,0) , 32 | ) 33 | Color_1.name = "Color_1" 34 | context.turtle.setMaterial(1,Color_1) 35 | -------------------------------------------------------------------------------- /models/spacecolonization/.ipynb_checkpoints/Untitled-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 4 6 | } 7 | -------------------------------------------------------------------------------- /modularityspecification.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/modularityspecification.docx -------------------------------------------------------------------------------- /options_conda_win.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | if 'CPU_COUNT' in os.environ: 4 | num_jobs = os.environ['CPU_COUNT'] 5 | 6 | compiler = 'msvc' 7 | qhull_libs_suffix = 'static' 8 | boost_libs_suffix = '' 9 | -------------------------------------------------------------------------------- /options_linux.py: -------------------------------------------------------------------------------- 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' 7 | -------------------------------------------------------------------------------- /share/abop/chap1/lsystem-fig1.37.lpy: -------------------------------------------------------------------------------- 1 | c = 1 2 | p = 0.3 3 | q = c - p 4 | h = (p*q) ** 0.5 5 | a = 86 6 | 7 | Axiom: _(0.002) -(90) F(1) 8 | 9 | derivation length: 5 10 | production: 11 | 12 | F(x) --> F(x*p) +(a) F(x*h) -(2*a) F(x*h) +(a) F(x*q) 13 | 14 | interpretation: 15 | 16 | 17 | endlsystem 18 | -------------------------------------------------------------------------------- /share/abop/chap1/lsystem-fig1.37b.lpy: -------------------------------------------------------------------------------- 1 | c = 1 2 | p = 0.3 3 | q = c - p 4 | h = (p*q) ** 0.5 5 | a = 86 6 | 7 | Axiom: _(0.002) -(90) G(1,0) 8 | 9 | derivation length: 10 10 | production: 11 | 12 | G(x,t): 13 | if t == 0: produce G(x*p,2) +(a) G(x*h,1) -(2*a) G(x*h,1) +(a) G(x*q,0) 14 | else: produce G(x,t-1) 15 | 16 | interpretation: 17 | 18 | G(x,t) --> F(x) 19 | 20 | endlsystem 21 | -------------------------------------------------------------------------------- /share/abop/chap1/lsystem1.4.lpy: -------------------------------------------------------------------------------- 1 | k = 20 2 | l = 20 3 | 4 | Axiom: A(0) 5 | 6 | derivation length: 40 7 | production: 8 | 9 | A(i) : 10 | if i < k: 11 | produce B(0,i) A(i+1) 12 | 13 | B(j,i) : 14 | if j < l: 15 | produce B(j+1,i) F(0.01) 16 | 17 | interpretation: 18 | B(j,i) --> ,(2 if i % 2 else 3) 19 | 20 | endlsystem 21 | -------------------------------------------------------------------------------- /share/abop/chap1/lsystem1.9.lpy: -------------------------------------------------------------------------------- 1 | R = 1.456 2 | a = 85 3 | 4 | Axiom: _(0.01) A(1) 5 | 6 | derivation length: 11 7 | production: 8 | A(s) --> F(s)[+(a)A(s/R)][-(a)A(s/R)] 9 | 10 | interpretation: 11 | 12 | 13 | endlsystem 14 | -------------------------------------------------------------------------------- /share/examples/ex_lsystem2.lpy: -------------------------------------------------------------------------------- 1 | Axiom: A 2 | derivation length: 24 3 | production: 4 | 5 | A : 6 | produce [+(60)B][-(60)B]F?P(0,0,0)A 7 | 8 | B : 9 | produce F?P(0,0,0)@O(0.2)B 10 | 11 | ?P(x,y,z) : 12 | if 4*y*y +(z-10)**2 > 100: 13 | produce [+(2*z)F][-(2*z)F]% 14 | else: 15 | produce * 16 | -------------------------------------------------------------------------------- /share/examples/ex_lsystem3.lpy: -------------------------------------------------------------------------------- 1 | 2 | Axiom: _(0.1)A 3 | 4 | derivation length: 10 5 | production: 6 | 7 | 8 | A : 9 | produce F(1)[-(60)X(5)B][+(60)X(5)B]A 10 | 11 | B : 12 | produce F(1)B 13 | 14 | X(d): 15 | if d > 0: 16 | produce X(d-1) 17 | else: 18 | produce F(0.3)% 19 | -------------------------------------------------------------------------------- /share/examples/ex_lsystem5.lpy: -------------------------------------------------------------------------------- 1 | from math import * 2 | 3 | 4 | Axiom: A 5 | 6 | consider: K 7 | derivation length: 3 8 | production: 9 | 10 | A : 11 | for i in range(100): 12 | nproduce K(1,i) 13 | 14 | K(x,i)K(y,j) << K(z,m) : 15 | if(z == 1): 16 | produce K(x+y,m) 17 | 18 | homomorphism: 19 | 20 | K(x,i): 21 | logx = log(x) 22 | if(logx < 1): 23 | logx = 1 24 | if i % 4 == 0: 25 | produce [F(logx)f(1)@L(str(x))]&(90)F(logx)^(90) 26 | elif i % 4 == 1: 27 | produce [F(logx)f(1)@L(str(x))]+(90)F(logx)-(90) 28 | elif i % 4 == 2: 29 | produce [F(logx)f(1)@L(str(x))]^(90)F(logx)&(90) 30 | elif i % 4 == 3: 31 | produce [F(logx)f(1)@L(str(x))]-(90)F(logx)+(90) 32 | 33 | endlsystem 34 | -------------------------------------------------------------------------------- /share/examples/ex_lsystem5b.lpy: -------------------------------------------------------------------------------- 1 | from math import * 2 | 3 | 4 | 5 | Axiom: K(1,0)K(1,1)K(1,2) 6 | 7 | consider: K 8 | derivation length: 100 9 | production: 10 | 11 | 12 | K(x,i)K(y,j) << K(z,m) : 13 | if(z == 1): 14 | produce K(x+y,m)K(1,m+1) 15 | 16 | homomorphism: 17 | 18 | K(x,i): 19 | logx = log(x) 20 | if(logx < 1): 21 | logx = 1 22 | if i % 4 == 0: 23 | produce [F(logx)f(1);;;@L(str(x))]&(90)F(logx)^(90) 24 | elif i % 4 == 1: 25 | produce [F(logx)f(1);;;@L(str(x))]+(90)F(logx)-(90) 26 | elif i % 4 == 2: 27 | produce [F(logx)f(1);;;@L(str(x))]^(90)F(logx)&(90) 28 | elif i % 4 == 3: 29 | produce [F(logx)f(1);;;@L(str(x))]-(90)F(logx)+(90) 30 | 31 | endlsystem 32 | -------------------------------------------------------------------------------- /share/examples/ex_pglsymbol.lpy: -------------------------------------------------------------------------------- 1 | from openalea.plantgl.all import * 2 | from math import radians 3 | 4 | Axiom: ;(1)+(10)_(2)F(10);(0)@g(Paraboloid(10,10,2,False))F(7) 5 | 6 | derivation length: 100 7 | production: 8 | 9 | F(x) --> F(x+0.2) 10 | 11 | @g(p) : 12 | p.radius +=0.15 13 | p.height +=0.2 14 | #produce @g(p) 15 | 16 | _(x) --> _(x+0.02) 17 | homomorphism: 18 | 19 | 20 | endlsystem 21 | ###### INITIALISATION ###### 22 | 23 | def __initialiseContext__(context): 24 | from openalea.plantgl.all import Material,Color3 25 | context.turtle.setMaterial(0,Material('Yellow',Color3(60,60,15),3,Color3(40,40,40),Color3(0,0,0),1,0)) 26 | -------------------------------------------------------------------------------- /share/examples/ex_vonkoch.lpy: -------------------------------------------------------------------------------- 1 | 2 | Axiom: -(90)_(0.1)F(50.) 3 | production: 4 | F(x) : produce F(x/3.)+(60)F(x/3.)-(120)F(x/3.)+(60)F(x/3.) 5 | endlsystem 6 | ###### INITIALISATION ###### 7 | 8 | def __initialiseContext__(context): 9 | from openalea.plantgl.all import Material,Color3 10 | context.options.setSelection("Selection Required",0) 11 | context.options.setSelection("Module declaration",0) 12 | -------------------------------------------------------------------------------- /share/examples/examples.py: -------------------------------------------------------------------------------- 1 | import os 2 | from openalea.pylsystems import * 3 | 4 | # os.chdir("D:\Fred\Mes documents\Develop\PGLmodules\examples") 5 | 6 | l = Lsystem("ex_lsystem1.lpy") 7 | l.animate() 8 | 9 | l = Lsystem("ex_lsystem2.lpy") 10 | l.animate() 11 | 12 | l = Lsystem("ex_lsystem3.lpy") 13 | l.animate() 14 | 15 | # tres long 16 | l = Lsystem("ex_lsystem4.lpy") 17 | l.animate() 18 | 19 | l = Lsystem("ex_lsystem5.lpy") 20 | l.animate() 21 | 22 | l = Lsystem("ex_lsystem5b.lpy") 23 | l.animate() 24 | 25 | l = Lsystem("ex_lsystem6.lpy") 26 | l.animate() 27 | 28 | #marche pas bien 29 | l = Lsystem("ex_lsystem7.lpy") 30 | l.animate() 31 | 32 | l = Lsystem("ex_lsys_markov.lpy") 33 | l.animate() 34 | -------------------------------------------------------------------------------- /share/examples/lpfg_surface_import/leaf_surface.s: -------------------------------------------------------------------------------- 1 | -0.75 0.75 -0.02 0.34 -0.01 1.00 2 | CONTACT POINT X: 0.00 Y: 0.00 Z: 0.00 3 | END POINT X: 0.00 Y: 0.00 Z: 0.00 4 | HEADING X: 0.00 Y: 0.00 Z: 1.00 5 | UP X: 0.00 Y: 1.00 Z: 0.00 6 | SIZE: 1.00 7 | patch 8 | TOP COLOR: 0 DIFFUSE: 0.00 BOTTOM COLOR: 0 DIFFUSE: 0.00 9 | AL: ~ A: ~ AR: ~ 10 | L: ~ R: ~ 11 | BL: ~ B: ~ BR: ~ 12 | -0.01 -0.01 1.00 0.00 -0.02 0.99 0.00 -0.01 1.00 0.00 -0.01 1.00 13 | -0.43 0.13 0.76 -0.16 0.34 0.27 0.21 0.34 0.27 0.43 0.12 0.76 14 | -0.75 0.00 0.19 -0.25 0.00 0.19 0.25 0.00 0.19 0.75 0.00 0.19 15 | -0.01 0.00 -0.01 -0.01 0.00 -0.01 0.00 0.00 -0.01 -0.01 0.00 -0.01 16 | -------------------------------------------------------------------------------- /share/examples/sweepwithpyfunction.lpy: -------------------------------------------------------------------------------- 1 | from openalea.plantgl.all import * 2 | from math import sin,pi 3 | 4 | def py2qf(function, start = 0, stop = 1., step = 0.1): 5 | import numpy as np 6 | p = [(u,function(u)) for u in np.arange(start,stop+step,step)] 7 | return QuantisedFunction(p) 8 | 9 | 10 | Axiom: Sweep(Polyline2D([(0,0),(1,0)]), Polyline2D([(-1,0),(1,0)]),1, 0.1, 0.2, py2qf(sin, 0, pi, pi/10.)) 11 | 12 | derivation length: 1 13 | production: 14 | 15 | 16 | interpretation: 17 | 18 | 19 | endlsystem 20 | -------------------------------------------------------------------------------- /share/extension/mtgaxiom/walnut.drf: -------------------------------------------------------------------------------- 1 | # Dressing file for WalnuTree trees 2 | 3 | #SMBPath = D:/Documents/pradal/devlp/vplants/aml/databases/SMBFiles 4 | #SMBPath = ../../../databases/SMBFiles 5 | 6 | #SMBModel entrenoeud = nentn105 7 | 8 | #Class S = entrenoeud 9 | #Class U = entrenoeud 10 | 11 | DiameterUnit = 10 12 | 13 | -------------------------------------------------------------------------------- /share/extension/multicore.lpy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Axiom: 5 | for i in range(500000): nproduce A B 6 | 7 | derivation length: 2 8 | production: 9 | 10 | A : produce B 11 | 12 | B : produce A 13 | 14 | interpretation: 15 | 16 | 17 | endlsystem 18 | -------------------------------------------------------------------------------- /share/image/bjunipc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/share/image/bjunipc.png -------------------------------------------------------------------------------- /share/image/leaf1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/share/image/leaf1.jpg -------------------------------------------------------------------------------- /share/image/leaf2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/share/image/leaf2.jpg -------------------------------------------------------------------------------- /share/image/mango.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/share/image/mango.png -------------------------------------------------------------------------------- /share/training/01-equilat-triangle.lpy: -------------------------------------------------------------------------------- 1 | 2 | derivation length: 0 3 | 4 | Axiom: -(30)F(1)-(120)F(1)-(120)F(1) 5 | ###### INITIALISATION ###### 6 | 7 | __copyright__ = 'open-source GPL' 8 | __description__ = '- change the line width and color\n\n- try to make a circle (approximated by a polygonal line)\n\n' 9 | __institutes__ = 'INRIA - CIRAD Virtual Plants' 10 | __authors__ = 'C. Godin, F. Boudon' 11 | -------------------------------------------------------------------------------- /share/training/02-circle.lpy: -------------------------------------------------------------------------------- 1 | r = 1. 2 | N = 100 3 | 4 | dalpha = 360./N 5 | dl = dalpha*r 6 | 7 | Axiom: C(N) 8 | 9 | derivation length: 1 10 | 11 | production: 12 | 13 | decomposition: 14 | maximum depth: N 15 | 16 | C(n): 17 | if n >= 0 : produce S(dl)C(n-1) 18 | 19 | homomorphism: 20 | 21 | S(dl) : produce _(2)-(dalpha)F(dl) 22 | 23 | endlsystem 24 | ###### INITIALISATION ###### 25 | 26 | __copyright__ = 'open-source GPL' 27 | __description__ = '- change the number of sides of the polygon\n\n- compute the length of the polygone using production rules\n' 28 | __institutes__ = 'INRIA - CIRAD Virtual Plants' 29 | __authors__ = 'C. Godin, F. Boudon' 30 | -------------------------------------------------------------------------------- /share/training/02b-subdivision-circle.lpy: -------------------------------------------------------------------------------- 1 | from math import * 2 | 3 | il = 10. 4 | rl = 0.5 5 | #rl = 1./(sqrt(2)+1) 6 | print (rl) 7 | assert 0 < rl < 1 8 | 9 | Axiom: F(il/2)+(90.)F(il/2)F(il/2)+(90.)F(il/2)F(il/2)+(90.)F(il/2)F(il/2)+(90.)F(il/2) 10 | 11 | derivation length: 10 12 | production: 13 | 14 | F(x)+(a)F(y) : 15 | #assert abs(x-y) < 1e-5 16 | v1 = (1-rl)*sqrt(x**2+y**2)/2. 17 | #assert abs(x*rl-v1) < 1e-5 18 | produce F(x*rl)+(a/2)F(v1)F(v1)+(a/2)F(y*rl) 19 | 20 | homomorphism: 21 | 22 | 23 | endlsystem -------------------------------------------------------------------------------- /share/training/03-koch-curve.lpy: -------------------------------------------------------------------------------- 1 | Axiom: _(0.001)-(90)F(1) 2 | derivation length: 5 3 | 4 | production: 5 | 6 | F(x) : 7 | produce F(x/3.0)+F(x/3.0)--F(x/3.0)+F(x/3.0) 8 | 9 | 10 | endlsystem 11 | ###### INITIALISATION ###### 12 | 13 | __copyright__ = """open-source GPL""" 14 | __description__ = """- start from an axiom representing a triangle with equal side lengths 15 | 16 | - try other fractal rules""" 17 | __institutes__ = """INRIA - CIRAD Virtual Plants""" 18 | __authors__ = """C. Godin, F. Boudon""" 19 | -------------------------------------------------------------------------------- /share/training/04-sierpinski.lpy: -------------------------------------------------------------------------------- 1 | 2 | Axiom: -(90)L(1.0) 3 | 4 | derivation length: 5 5 | 6 | production: 7 | 8 | L(x): 9 | produce +(60)R(x/2)-(60)L(x/2)-(60)R(x/2)+(60) 10 | R(x): 11 | produce -(60)L(x/2)+(60)R(x/2)+(60)L(x/2)-(60) 12 | 13 | homomorphism: 14 | 15 | R(x): # To have a right triangle that has the same normal orientation as L(x) 16 | produce [{-(60)F(x)+(120)F(x)}]f(x) 17 | 18 | L(x): 19 | produce [{F(x)+(120)F(x)}]f(x) 20 | 21 | endlsystem 22 | ###### INITIALISATION ###### 23 | 24 | __copyright__ = """open-source GPL""" 25 | __description__ = """- make a Sierpinski carpet (based on a square instead of triangle)""" 26 | __institutes__ = """INRIA - CIRAD Virtual Plants""" 27 | __authors__ = """C. Godin, F. Boudon""" 28 | -------------------------------------------------------------------------------- /share/training/05-simple-sympodial-plant.lpy: -------------------------------------------------------------------------------- 1 | def alpha(x): 2 | return 30 # try other decreasing functions ex: 30-10*x 3 | 4 | def long(x): 5 | return 1 # try other decreasing functions ex: 50/(x*x) ; 2-x/6+1 6 | 7 | 8 | Axiom: A(1) 9 | 10 | production: 11 | 12 | derivation length: 6 13 | 14 | A(n) : 15 | produce F(long(n))[+(alpha(n))A(n+1)] [-(alpha(n))A(n+1)]F(0.2);(3)@o(0.2) 16 | 17 | endlsystem 18 | ###### INITIALISATION ###### 19 | 20 | def __initialiseContext__(context): 21 | from openalea.plantgl.scenegraph import Material,ImageTexture,Color3 22 | context.turtle.setMaterial(0,Material('default',Color3(0,85,127),1.25984,Color3(40,40,40),Color3(0,0,0),1,0)) 23 | __copyright__ = 'open-source GPL' 24 | __description__ = '- try to apply different functions for branching angle and length of segments' 25 | __institutes__ = 'INRIA - CIRAD Virtual Plants' 26 | __authors__ = 'C. Godin, F. Boudon' 27 | -------------------------------------------------------------------------------- /share/training/06a-simple-differentiation.lpy: -------------------------------------------------------------------------------- 1 | CYCLENB = 10 # Try 11, 12 2 | ADVANCE = 3 # Lateral meristems get older more rapidly than main axis (try 1, 3) 3 | 4 | 5 | Axiom: _(1)A(0) 6 | 7 | derivation length: 8 8 | production: 9 | 10 | A(n) : 11 | if n B 8 | 9 | homomorphism: 10 | 11 | B --> ;(3)F 12 | A --> ;(1)F 13 | 14 | endlsystem 15 | ###### INITIALISATION ###### 16 | 17 | __copyright__ = """opensource GPL""" 18 | __description__ = """change B < A --> B to use fast information transfer 19 | """ 20 | __institutes__ = """INRIA-CIRAD V.Plants team""" 21 | __authors__ = """F. Boudon, C. Godin""" 22 | -------------------------------------------------------------------------------- /share/training/13-fibonacci.lpy: -------------------------------------------------------------------------------- 1 | from math import sqrt 2 | 3 | nbValue = 20 4 | 5 | Axiom: -(90);(3)A(nbValue) 6 | 7 | 8 | derivation length: nbValue+1 9 | 10 | production: 11 | 12 | I(j)I(k) < I(i): 13 | newval = k+j 14 | if newval>=0 : 15 | produce I(newval) 16 | else: 17 | produce 18 | 19 | 20 | 21 | decomposition: 22 | maximum depth: nbValue+1 23 | 24 | A(i) : 25 | if i>0: 26 | produce I(1)A(i-1) 27 | else: 28 | #backward() 29 | produce 30 | 31 | homomorphism: 32 | 33 | 34 | I(i) : 35 | produce f(1)F(1)[+(135);(4)f(sqrt(2.0)*0.5);(2)@L(str(i))]F(5) 36 | ###### INITIALISATION ###### 37 | 38 | __copyright__ = """opensource GPL""" 39 | __description__ = """Change I(j)I(k) < I(i) to use Fast Information Transfer""" 40 | __institutes__ = """INRIA-CIRAD V.Plants""" 41 | __authors__ = """F.Boudon, C.Godin""" 42 | -------------------------------------------------------------------------------- /share/training/17-open-lsystem-simple-growth.lpy: -------------------------------------------------------------------------------- 1 | Axiom: A 2 | derivation length: 24 3 | production: 4 | 5 | A : 6 | produce [+(60)B][-(60)B]F?P(0,0,0)A 7 | 8 | B : 9 | produce F?P(0,0,0)@O(0.2)B 10 | 11 | ?P(x,y,z) : 12 | if 4*y*y +(z-10)**2 > 100: 13 | produce [+(2*z)F][-(2*z)F]% 14 | else: 15 | produce * 16 | ###### INITIALISATION ###### 17 | 18 | __copyright__ = """open-source GPL""" 19 | __institutes__ = """INRIA - CIRAD Virtual Plants""" 20 | __authors__ = """C. Godin, F. Boudon""" 21 | -------------------------------------------------------------------------------- /share/tutorial/01 - turtle/.ipynb_checkpoints/Test-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 4 6 | } 7 | -------------------------------------------------------------------------------- /share/tutorial/01 - turtle/01 - equilateral-triangle.lpy: -------------------------------------------------------------------------------- 1 | 2 | derivation length: 0 3 | 4 | Axiom: -(30)F(1)-(120)F(1)-(120)F(1) 5 | ###### INITIALISATION ###### 6 | 7 | __copyright__ = 'open-source GPL' 8 | __description__ = '- change the line width and color\n\n- try to make a circle (approximated by a polygonal line)\n\n' 9 | __institutes__ = 'INRIA - CIRAD Virtual Plants' 10 | __authors__ = 'C. Godin, F. Boudon' 11 | -------------------------------------------------------------------------------- /share/tutorial/01 - turtle/02 - red-square.lpy: -------------------------------------------------------------------------------- 1 | 2 | derivation length: 0 3 | 4 | Axiom: _(0.01) ,(3) F -(90) F -(90) F -(90) F 5 | ###### INITIALISATION ###### 6 | 7 | __lpy_code_version__ = 1.1 8 | 9 | __copyright__ = 'open-source GPL' 10 | __description__ = 'A red square' 11 | __institutes__ = 'INRIA - CIRAD Virtual Plants' 12 | __authors__ = 'C. Godin, F. Boudon' 13 | -------------------------------------------------------------------------------- /share/tutorial/01 - turtle/03 - filled-square.lpy: -------------------------------------------------------------------------------- 1 | 2 | derivation length: 0 3 | 4 | Axiom: ,(3) _(0.01) F -(90) F -(90) F -(90) F -(90) ,(2) { F -(90) F -(90) F -(90) F } 5 | ###### INITIALISATION ###### 6 | 7 | __lpy_code_version__ = 1.1 8 | 9 | __copyright__ = 'open-source GPL' 10 | __description__ = 'A red square' 11 | __institutes__ = 'INRIA - CIRAD Virtual Plants' 12 | __authors__ = 'C. Godin, F. Boudon' 13 | -------------------------------------------------------------------------------- /share/tutorial/01 - turtle/04 - polygon-mappleleaf.lpy: -------------------------------------------------------------------------------- 1 | 2 | 3 | Axiom: ,(2) { F +(95) F(0.7) -(120) F(0.2) +(80) F -(120) F(0.2) +(80) F(0.5) -(120) F(0.5) +(80) F(0.2) -(120) F(0.5) +(150) F -(120) F(0.3) +(80) F -(120) F +(80) F(0.3) -(120) F +(150) F(0.5) -(120) F(0.2) +(80) F(0.5) -(120) F(0.5) +(80) F(0.2) -(120) F +(120) F(0.2) -(150) F(0.7) +(95) F }(True) 4 | 5 | derivation length: 1 6 | production: 7 | 8 | 9 | interpretation: 10 | 11 | 12 | endlsystem 13 | -------------------------------------------------------------------------------- /share/tutorial/01 - turtle/05 - branches.lpy: -------------------------------------------------------------------------------- 1 | # Bracket makes it possible to specify branches 2 | # Before each opening bracket, the turtle parameters (represented by the Frames) are stored on a stack 3 | # these parameters are pop back when a closing bracket is found 4 | 5 | Axiom: F(2) [ + F [ - F(0.5) ] F Frame(0.5) ] Frame(0.5) F 6 | 7 | derivation length: 1 8 | production: 9 | 10 | 11 | interpretation: 12 | 13 | 14 | endlsystem 15 | -------------------------------------------------------------------------------- /share/tutorial/01 - turtle/08 - texturedpatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "schema": "lpy", 3 | "version": "1.1", 4 | "options": { 5 | "compilation": {}, 6 | "matching": {}, 7 | "processing": {}, 8 | "interaction": {} 9 | }, 10 | "parameters": [ 11 | { 12 | "name": "Panel 1", 13 | "enabled": true, 14 | "scalars": [], 15 | "curves": [] 16 | } 17 | ], 18 | "materials": [] 19 | } -------------------------------------------------------------------------------- /share/tutorial/01 - turtle/09 - tropism.lpy: -------------------------------------------------------------------------------- 1 | Axiom: F [-(90) _(0.05) @Tp(0,0,1 if tropism >= 0 else -1 ) Elasticity(abs(tropism)/1000.) nF(1.5,0.02) ] F 2 | 3 | derivation length: 1 4 | production: 5 | 6 | 7 | interpretation: 8 | 9 | 10 | endlsystem 11 | ###### INITIALISATION ###### 12 | 13 | __lpy_code_version__ = 1.1 14 | 15 | def __initialiseContext__(context): 16 | scalars = [('tropism', 18, -100, 100)] 17 | context["__scalars__"] = scalars 18 | for n,v,mnv,mxv in scalars: 19 | context[n] = v 20 | __description__ = 'You can control the tropism strength with tropism variable in Scalar Tab ' 21 | -------------------------------------------------------------------------------- /share/tutorial/01 - turtle/10 - rotations.lpy: -------------------------------------------------------------------------------- 1 | execContext().turtle.setAngleIncrement(90) 2 | Axiom: ,(7) A 3 | 4 | derivation length: 3 5 | production: 6 | 7 | A --> B-F+CFC+F-D&F^D-F+&&CFC+F+B// 8 | B --> A&F^CFB^F^D^^-F-D^|F^B|FC^F^A// 9 | C --> |D^|F^B-F+C^F^A&&FA&F^C+F+B^F^D// 10 | D --> |CFB-F+B|FA&F^A&&FB-F+B|FC// 11 | 12 | 13 | interpretation: 14 | A --> ,(4) 15 | B --> ,(3) 16 | C --> ,(2) 17 | 18 | endlsystem 19 | ###### INITIALISATION ###### 20 | 21 | __lpy_code_version__ = 1.1 22 | 23 | def __initialiseContext__(context): 24 | import openalea.plantgl.all as pgl 25 | Color_7 = pgl.Material("Color_7" , ambient = (15,15,15) , diffuse = 7 , ) 26 | Color_7.name = "Color_7" 27 | context.turtle.setMaterial(7,Color_7) 28 | -------------------------------------------------------------------------------- /share/tutorial/01 - turtle/11 - dynamictropism.lpy: -------------------------------------------------------------------------------- 1 | from openalea.plantgl.all import * 2 | 3 | target = Vector3(5,0,5) 4 | 5 | def StartEach(): 6 | useGroup(0) 7 | if getIterationNb() == 2: 8 | useGroup(1) 9 | 10 | 11 | module T,I,R 12 | 13 | Axiom: 14 | nproduce T 15 | for i in range(10): 16 | nproduce I(ParameterSet(diameter=0.01*(10-i)+0.1)) ?P R(None, 0) 17 | 18 | derivation length: 10 19 | production: 20 | 21 | group 1: 22 | 23 | I(par) ?P(p) < R(d,e) : 24 | if p.z < target.z : 25 | nproduce R(target-p,0.06-(par.diameter/10)) 26 | else: 27 | nproduce R(None, 0) 28 | 29 | interpretation: 30 | group 0: 31 | 32 | R(d,e) --> [,(2)@O(0.2)] @Tp(d if d is not None else (0,0,1)) @Ts(e) 33 | 34 | T --> [,(3) @M(target) @O(0.2)] 35 | 36 | I(p) --> _(p.diameter) nF(1,0.1) 37 | 38 | endlsystem 39 | -------------------------------------------------------------------------------- /share/tutorial/02 - fractals/barnsleyfern.lpy: -------------------------------------------------------------------------------- 1 | R = 1.8 2 | 3 | Axiom: _(0.01) ,(2) A(1) 4 | 5 | 6 | derivation length: 10 7 | production: 8 | 9 | A(s): 10 | produce F(s/5)-(5)[+(45)A(s/R)]F(s/10)-(5)[/(180)+(45)A(s/R)]F(s/5)A(s/R) 11 | 12 | 13 | interpretation: 14 | 15 | 16 | endlsystem 17 | -------------------------------------------------------------------------------- /share/tutorial/02 - fractals/barnsleyfern2.lpy: -------------------------------------------------------------------------------- 1 | D = 1 2 | R = 1.5 3 | 4 | Axiom: _(0.01) ,(2) A(0) 5 | 6 | 7 | derivation length: 16 8 | production: 9 | 10 | A(d): 11 | if d > 0 : produce A(d-1) 12 | produce F(1)-(5)[+(60)A(D)]F(1)-(5)[/(180)+(60)A(D)]F(1)A(0) 13 | 14 | F(a) --> F(a*R) 15 | 16 | interpretation: 17 | 18 | 19 | endlsystem 20 | -------------------------------------------------------------------------------- /share/tutorial/02 - fractals/barnsleyfern3.lpy: -------------------------------------------------------------------------------- 1 | D = 1 2 | R = 1.5 3 | 4 | R *= R 5 | 6 | Axiom: _(0.01) ,(2) A(0,1) 7 | 8 | 9 | derivation length: 16 10 | production: 11 | 12 | A(d,s): 13 | if d > 0 : produce A(d-1,s) 14 | produce F(s)-(5)[+(60)A(D,s/R)]F(s)-(5)[/(180)+(60)A(D,s/R)]F(s)A(0,s/R) 15 | 16 | 17 | 18 | interpretation: 19 | 20 | 21 | endlsystem 22 | -------------------------------------------------------------------------------- /share/tutorial/02 - fractals/cantorset.lpy: -------------------------------------------------------------------------------- 1 | Axiom: ,(7) +(90)_(0.1)F(1) 2 | 3 | derivation length: 5 4 | production: 5 | 6 | F(x) --> F(x/3.)f(x/3.)F(x/3.) 7 | 8 | interpretation: 9 | 10 | 11 | endlsystem 12 | ###### INITIALISATION ###### 13 | 14 | __lpy_code_version__ = 1.1 15 | 16 | def __initialiseContext__(context): 17 | import openalea.plantgl.all as pgl 18 | Color_7 = pgl.Material("Color_7" , ambient = (0,0,0) , diffuse = 12.3077 , ) 19 | Color_7.name = "Color_7" 20 | context.turtle.setMaterial(7,Color_7) 21 | -------------------------------------------------------------------------------- /share/tutorial/02 - fractals/dragoncurve.lpy: -------------------------------------------------------------------------------- 1 | Axiom: FX 2 | 3 | derivation length: 10 4 | production: 5 | X --> X+(90)YF+(90) 6 | Y --> -(90)FX-(90)Y 7 | 8 | interpretation: 9 | 10 | 11 | endlsystem 12 | -------------------------------------------------------------------------------- /share/tutorial/02 - fractals/gosper.lpy: -------------------------------------------------------------------------------- 1 | Axiom: A 2 | 3 | derivation length: 4 4 | production: 5 | 6 | A --> A-B--B+A++AA+B- 7 | B --> +A-BB--B-A++A+B 8 | 9 | interpretation: 10 | 11 | A --> F 12 | B --> F 13 | 14 | endlsystem 15 | -------------------------------------------------------------------------------- /share/tutorial/02 - fractals/hilbert-curve.lpy: -------------------------------------------------------------------------------- 1 | execContext().turtle.setAngleIncrement(90) 2 | 3 | Axiom: L 4 | 5 | derivation length: 5 6 | production: 7 | 8 | 9 | L --> +RF - LFL - FR + 10 | R --> - LF + RFR + FL - 11 | 12 | interpretation: 13 | 14 | 15 | endlsystem 16 | -------------------------------------------------------------------------------- /share/tutorial/02 - fractals/hilbert3d.lpy: -------------------------------------------------------------------------------- 1 | Axiom: A 2 | context().turtle.setAngleIncrement(90) 3 | 4 | derivation length: 2 5 | production: 6 | 7 | A --> B-F+CFC+F-D&F^D-F+&&CFC+F+B// 8 | B --> A&F^CFB^F^D^^-F-D^|F^B|FC^FA// 9 | C --> |D^|F^B-F+C^F^A&&FA&F^C+F+B^F^D// 10 | D --> |CFB-F+B|FA&FA&&FB-F+B|FC// 11 | 12 | interpretation: 13 | 14 | 15 | endlsystem 16 | -------------------------------------------------------------------------------- /share/tutorial/02 - fractals/ifs.lpy: -------------------------------------------------------------------------------- 1 | module @Ls 2 | 3 | previousString = None 4 | def StartEach(lstring): 5 | # retrieve previous structure 6 | global previousString 7 | previousString = lstring 8 | 9 | # generate global symbol to represent the previous structure 10 | return Lstring('@Ls') 11 | 12 | def StartInterpretation(): 13 | nproduce -(90) 14 | 15 | Axiom: F 16 | 17 | derivation length: 4 18 | 19 | production: 20 | decomposition: 21 | maximum depth: 1 22 | 23 | # generate previous structure with a scaling factor 24 | @Ls : nsproduce(previousString) 25 | 26 | production: 27 | 28 | @Ls --> @Di(1/3.) @Ls + @Ls -- @Ls + @Ls @Di(3.) 29 | 30 | interpretation: 31 | 32 | F --> F 33 | 34 | endlsystem 35 | -------------------------------------------------------------------------------- /share/tutorial/02 - fractals/koch-curve.lpy: -------------------------------------------------------------------------------- 1 | Axiom: _(0.001)-(90)F(1) 2 | derivation length: 5 3 | 4 | production: 5 | 6 | F(x) : 7 | produce F(x/3.0)+F(x/3.0)--F(x/3.0)+F(x/3.0) 8 | 9 | 10 | endlsystem 11 | ###### INITIALISATION ###### 12 | 13 | __copyright__ = """open-source GPL""" 14 | __description__ = """- start from an axiom representing a triangle with equal side lengths 15 | 16 | - try other fractal rules""" 17 | __institutes__ = """INRIA - CIRAD Virtual Plants""" 18 | __authors__ = """C. Godin, F. Boudon""" 19 | -------------------------------------------------------------------------------- /share/tutorial/02 - fractals/peanocurve-simple.lpy: -------------------------------------------------------------------------------- 1 | Axiom: -(90)F(1) 2 | context().turtle.setAngleIncrement(90) 3 | dl = 0.0 4 | dt = 0.0 5 | derivation length: 3 6 | production: 7 | 8 | F(x) --> F(x) + F(x) - F(x) - F(x) - F(x) + F(x) + F(x) + F(x) - F(x) 9 | 10 | 11 | 12 | 13 | interpretation: 14 | 15 | 16 | endlsystem 17 | ###### INITIALISATION ###### 18 | 19 | __lpy_code_version__ = 1.1 20 | 21 | def __initialiseContext__(context): 22 | import openalea.plantgl.all as pgl 23 | Color_1 = pgl.Material("Color_1" , ambient = (0,0,0) , diffuse = 3 , ) 24 | Color_1.name = "Color_1" 25 | context.turtle.setMaterial(1,Color_1) 26 | Color_3 = pgl.Material("Color_3" , ambient = (175,0,0) , diffuse = 1.02857 , ) 27 | Color_3.name = "Color_3" 28 | context.turtle.setMaterial(3,Color_3) 29 | -------------------------------------------------------------------------------- /share/tutorial/02 - fractals/peanocurve.lpy: -------------------------------------------------------------------------------- 1 | Axiom: -(90)F(1) 2 | context().turtle.setAngleIncrement(90) 3 | dl = 0.0 4 | dt = 0.0 5 | derivation length: 3 6 | production: 7 | 8 | F(x) --> F(x*(1-dl)+dt) +(45) F(2*dl)+(45) F(x) - F(x -2*dt) - F(x) -(45) F(2*dl) -(45) ,(2+getIterationNb()) F(x-2*dl -2*dt),(1) +(45)F(2*dl)+(45) F(x) + F(x -2 *dt) + F(x) -(45) F(2*dl) -(45) F(x+dt) 9 | 10 | 11 | 12 | 13 | interpretation: 14 | 15 | 16 | endlsystem 17 | ###### INITIALISATION ###### 18 | 19 | __lpy_code_version__ = 1.1 20 | 21 | def __initialiseContext__(context): 22 | import openalea.plantgl.all as pgl 23 | Color_1 = pgl.Material("Color_1" , ambient = (0,0,0) , diffuse = 3 , ) 24 | Color_1.name = "Color_1" 25 | context.turtle.setMaterial(1,Color_1) 26 | Color_3 = pgl.Material("Color_3" , ambient = (175,0,0) , diffuse = 1.02857 , ) 27 | Color_3.name = "Color_3" 28 | context.turtle.setMaterial(3,Color_3) 29 | -------------------------------------------------------------------------------- /share/tutorial/02 - fractals/quadratic-koch-island.lpy: -------------------------------------------------------------------------------- 1 | execContext().turtle.setAngleIncrement(90) 2 | 3 | Axiom: F - F - F - F 4 | 5 | derivation length: 3 6 | production: 7 | F --> F - F + F + F F - F -F + F 8 | 9 | interpretation: 10 | 11 | 12 | endlsystem 13 | -------------------------------------------------------------------------------- /share/tutorial/02 - fractals/sierpinski.lpy: -------------------------------------------------------------------------------- 1 | 2 | Axiom: -(90)L(1.0) 3 | 4 | derivation length: 5 5 | 6 | production: 7 | 8 | L(x): 9 | produce +(60)R(x/2)-(60)L(x/2)-(60)R(x/2)+(60) 10 | R(x): 11 | produce -(60)L(x/2)+(60)R(x/2)+(60)L(x/2)-(60) 12 | 13 | interpretation: 14 | 15 | R(x): # To have a right triangle that has the same normal orientation as L(x) 16 | produce [{-(60).f(x).+(120)f(x).}]f(x) 17 | 18 | L(x): 19 | produce [{.f(x)+(120).f(x).}]f(x) 20 | 21 | endlsystem 22 | ###### INITIALISATION ###### 23 | 24 | __lpy_code_version__ = 1.1 25 | 26 | __copyright__ = 'open-source GPL' 27 | __description__ = '- make a Sierpinski carpet (based on a square instead of triangle)' 28 | __institutes__ = 'INRIA - CIRAD Virtual Plants' 29 | __authors__ = 'C. Godin, F. Boudon' 30 | -------------------------------------------------------------------------------- /share/tutorial/03 - subdivision-curves/subdivision-circle.lpy: -------------------------------------------------------------------------------- 1 | from math import * 2 | 3 | il = 10. 4 | rl = 0.5 5 | #rl = 1./(sqrt(2)+1) 6 | print (rl) 7 | assert 0 < rl < 1 8 | 9 | Axiom: F(il/2)+(90.)F(il/2)F(il/2)+(90.)F(il/2)F(il/2)+(90.)F(il/2)F(il/2)+(90.)F(il/2) 10 | 11 | derivation length: 10 12 | production: 13 | 14 | F(x)+(a)F(y) : 15 | #assert abs(x-y) < 1e-5 16 | v1 = (1-rl)*sqrt(x**2+y**2)/2. 17 | #assert abs(x*rl-v1) < 1e-5 18 | produce F(x*rl)+(a/2)F(v1)F(v1)+(a/2)F(y*rl) 19 | 20 | homomorphism: 21 | 22 | 23 | endlsystem -------------------------------------------------------------------------------- /share/tutorial/04 - simple-plant-archi/03 - simple-differentiation.lpy: -------------------------------------------------------------------------------- 1 | CYCLENB = 10 # Try 11, 12 2 | ADVANCE = 3 # Lateral meristems get older more rapidly than main axis (try 1, 3) 3 | 4 | 5 | Axiom: _(1)A(0) 6 | 7 | derivation length: 8 8 | production: 9 | 10 | A(n) : 11 | if n I(k+j) 16 | 17 | interpretation: 18 | 19 | I(i) : 20 | produce f(1)F(1)[+(135);(4)f(sqrt(2.0)*0.5);(2)@L(str(i))]F(5) 21 | ###### INITIALISATION ###### 22 | 23 | __lpy_code_version__ = 1.1 24 | 25 | __copyright__ = 'opensource GPL' 26 | __description__ = 'Change I(j)I(k) < I(i) to use Fast Information Transfer' 27 | __institutes__ = 'INRIA-CIRAD V.Plants' 28 | __authors__ = 'F.Boudon, C.Godin' 29 | -------------------------------------------------------------------------------- /share/tutorial/05 - signals/01 - fibonacci.lpy: -------------------------------------------------------------------------------- 1 | from math import sqrt 2 | 3 | nbValues = 20 4 | 5 | Axiom: 6 | nproduce -(90);(3) 7 | for i in range(nbValues): 8 | nproduce I(1) 9 | 10 | derivation length: nbValues+1 11 | 12 | production: 13 | 14 | I(j)I(k) < I(i) --> I(k+j) 15 | 16 | interpretation: 17 | 18 | I(i) : 19 | produce f(1)F(1)[+(135);(4)f(sqrt(2.0)*0.5);(2)@L(str(i))]F(5) 20 | ###### INITIALISATION ###### 21 | 22 | __lpy_code_version__ = 1.1 23 | 24 | __copyright__ = 'opensource GPL' 25 | __description__ = 'Change I(j)I(k) < I(i) to use Fast Information Transfer' 26 | __institutes__ = 'INRIA-CIRAD V.Plants' 27 | __authors__ = 'F.Boudon, C.Godin' 28 | -------------------------------------------------------------------------------- /share/tutorial/05 - signals/02 - branched-signal-acropetal.lpy: -------------------------------------------------------------------------------- 1 | Axiom: A[-A]A[+A]A[-A]B 2 | 3 | derivation length: 3 4 | ignore: +- 5 | production: 6 | 7 | A > B --> B 8 | 9 | interpretation: 10 | 11 | B --> ;(3)F 12 | A --> ;(1)F 13 | 14 | endlsystem 15 | ###### INITIALISATION ###### 16 | 17 | __lpy_code_version__ = 1.1 18 | 19 | __copyright__ = 'opensource GPL' 20 | __description__ = 'change B B to use fast information transfer ' 21 | __institutes__ = 'INRIA-CIRAD V.Plants team' 22 | __authors__ = 'F. Boudon, C. Godin' 23 | -------------------------------------------------------------------------------- /share/tutorial/05 - signals/02 - branched-signal-basipetal.lpy: -------------------------------------------------------------------------------- 1 | Axiom: B[-A]A[+A]A[-A]A 2 | 3 | derivation length: 3 4 | ignore: +- 5 | production: 6 | 7 | B < A --> B 8 | 9 | interpretation: 10 | 11 | B --> ;(3)F 12 | A --> ;(1)F 13 | 14 | endlsystem 15 | ###### INITIALISATION ###### 16 | 17 | __lpy_code_version__ = 1.1 18 | 19 | __copyright__ = 'opensource GPL' 20 | __description__ = 'change B B to use fast information transfer ' 21 | __institutes__ = 'INRIA-CIRAD V.Plants team' 22 | __authors__ = 'F. Boudon, C. Godin' 23 | -------------------------------------------------------------------------------- /share/tutorial/06 - environement/01 - open-lsystem-simple-growth.lpy: -------------------------------------------------------------------------------- 1 | Axiom: A 2 | derivation length: 24 3 | production: 4 | 5 | A : 6 | produce [+(60)B][-(60)B]F?P(0,0,0)A 7 | 8 | B : 9 | produce F?P(0,0,0)@O(0.2)B 10 | 11 | ?P(x,y,z) : 12 | if 4*y*y +(z-10)**2 > 100: 13 | produce [+(2*z)F][-(2*z)F]% 14 | else: 15 | produce * 16 | ###### INITIALISATION ###### 17 | 18 | __copyright__ = """open-source GPL""" 19 | __institutes__ = """INRIA - CIRAD Virtual Plants""" 20 | __authors__ = """C. Godin, F. Boudon""" 21 | -------------------------------------------------------------------------------- /share/tutorial/06 - environement/Archive.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/share/tutorial/06 - environement/Archive.zip -------------------------------------------------------------------------------- /share/tutorial/06 - environement/interception.txt: -------------------------------------------------------------------------------- 1 | 0 2 | 0.4538373913941416 3 | -------------------------------------------------------------------------------- /share/tutorial/07 - interaction/selectandpaint.lpy: -------------------------------------------------------------------------------- 1 | # Should be played with animation 2 | 3 | from openalea.plantgl.all import * 4 | 5 | def StartEach(): 6 | print getIterationNb() 7 | if getIterationNb() >= 3: 8 | frameDisplay(True) 9 | requestSelection('''Iteration %d : Please select a node. 10 | First selection of a node will paint the branching system. 11 | Second will cut it. 12 | To end the simulation, select the sphere''' % getIterationNb()) 13 | useGroup(2) 14 | else: 15 | frameDisplay(False) 16 | useGroup(1) 17 | 18 | Axiom: S A 19 | 20 | derivation length: 7 21 | production: 22 | 23 | X S : 24 | print ('Stop') 25 | Stop() 26 | 27 | group 1: 28 | 29 | A --> F[+FA][-FA]FA 30 | F --> FF 31 | 32 | group 2: 33 | 34 | XX --> % 35 | 36 | interpretation: 37 | 38 | S --> ,(2)@O(1),(1) 39 | 40 | X --> ,(3) 41 | 42 | endlsystem 43 | -------------------------------------------------------------------------------- /share/tutorial/08 - various/pendulum.lpy: -------------------------------------------------------------------------------- 1 | from math import * 2 | g = 9.81 3 | m = 1 4 | dt = 0.1 5 | 6 | module P(theta, length) 7 | 8 | Axiom: P(radians(INITIAL_ANGLE), 0, 1) 9 | 10 | derivation length: 500 11 | production: 12 | 13 | P(theta, dtheta, length): 14 | atheta = -g*sin(theta)/length 15 | dtheta += atheta*dt 16 | theta += dtheta*dt 17 | produce P(theta, dtheta, length) 18 | 19 | interpretation: 20 | 21 | P(theta, dtheta, length) --> ,(5)@O(0.1) _(0.01)LineTo(0,cos(theta-pi/2),sin(theta-pi/2)) ,(3) @O(0.1) 22 | 23 | 24 | endlsystem 25 | ###### INITIALISATION ###### 26 | 27 | __lpy_code_version__ = 1.1 28 | 29 | def __initialiseContext__(context): 30 | scalars = [('INITIAL_ANGLE', 'Integer', 90, 0, 179)] 31 | context["__scalars__"] = scalars 32 | for s in scalars: 33 | if not s[1] == "Category" : context[s[0]] = s[2] 34 | -------------------------------------------------------------------------------- /share/tutorial/10 - graphics/leaf1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/share/tutorial/10 - graphics/leaf1.jpg -------------------------------------------------------------------------------- /share/tutorial/10 - graphics/leaftexture3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/share/tutorial/10 - graphics/leaftexture3.png -------------------------------------------------------------------------------- /share/tutorial/13 - stochastic-topology/note.txt: -------------------------------------------------------------------------------- 1 | GLM -------------------------------------------------------------------------------- /share/tutorial/lpy-paper12-examples/code2.py: -------------------------------------------------------------------------------- 1 | from openalea.plantgl.all import * 2 | from openalea.lpy import * 3 | 4 | def main(): 5 | lsys = Lsystem("lsystem1.lpy") 6 | print (lsys.dr) # This would print 0.02 7 | lsys.axiom = Lstring("Apex(2)",lsys) 8 | lstring = lsys.axiom 9 | timer = Sequencer(0.1) 10 | for i in range(10): 11 | lsys.dr += 0.02 12 | lstring = lsys.derive(lstring,1) 13 | interpretedstring = lsys.interpret(lstring) 14 | scene = lsys.sceneInterpretation(interpretedstring) 15 | Viewer.display(scene) 16 | timer.touch() 17 | 18 | if __name__ == '__main__': 19 | main() -------------------------------------------------------------------------------- /share/tutorial/lpy-paper12-examples/code4.py: -------------------------------------------------------------------------------- 1 | from openalea.lpy import * 2 | from openalea.lpy.composition import * 3 | 4 | 5 | def simulation(): 6 | a = Lsystem('composition/A.lpy') 7 | b = Lsystem('composition/B.lpy') 8 | c = Lsystem('composition/interpretation.lpy') 9 | a2b = Lsystem('composition/A2B.lpy') 10 | b2a = Lsystem('composition/B2A.lpy') 11 | a2c = Lsystem('composition/A2C.lpy') 12 | 13 | lsystem = ComposedLsystem([a,a2b,b,b2a],[a2c,c]) 14 | lstring = lsystem.axiom 15 | print (lstring) 16 | lsystem.animate(nbsteps = 10) 17 | 18 | 19 | if __name__ == '__main__': 20 | simulation() -------------------------------------------------------------------------------- /share/tutorial/lpy-paper12-examples/lsystem1.lpy: -------------------------------------------------------------------------------- 1 | module Apex(age), Internode(length,radius) 2 | MAX_AGE, dr = 10, 0.02 # constants 3 | Axiom: Apex(0) 4 | production: 5 | consider: Internode 6 | derivation length:4 7 | Internode(l,r) --> Internode(l,r+dr) 8 | Apex(age) : 9 | if age < MAX_AGE: 10 | produce Internode(1,0.05)/(137.5)[+(40)Apex(age+1)] Apex(age+1) 11 | interpretation: 12 | 13 | Internode(lp,rp) < Internode(l,r) --> F(l,r) 14 | Internode(l,r) --> _(r)F(l,r) 15 | Apex(age) --> ,(2)@O 16 | endlsystem 17 | 18 | def EndEach(lstring): 19 | print(lstring) -------------------------------------------------------------------------------- /share/tutorial/lpy-paper12-examples/lsystem3.lpy: -------------------------------------------------------------------------------- 1 | def EndEach(lstring): 2 | print (len(lstring), lstring) 3 | 4 | Axiom: A 5 | 6 | derivation length: 10 7 | production: 8 | 9 | A --> B 10 | B --> AB 11 | 12 | interpretation: 13 | 14 | A --> ,(2)F(0.1)f(0.01) 15 | B --> ,(3)F(0.1)f(0.01) 16 | 17 | endlsystem 18 | 19 | -------------------------------------------------------------------------------- /src/cpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # --- Source Files 2 | 3 | file(GLOB_RECURSE SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") 4 | 5 | add_library(lpy SHARED ${SRC_FILES}) 6 | 7 | # --- Linked Libraries 8 | 9 | target_link_libraries(lpy ${PLANTGL_LIBRARIES}) 10 | target_link_libraries(lpy Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Concurrent) 11 | 12 | pgllib_link_python(lpy) 13 | pgllib_link_boost(lpy) 14 | 15 | # --- Preprocessor 16 | 17 | if (WIN32) 18 | # Export DLL on Windows 19 | target_compile_definitions(lpy PRIVATE LPY_MAKEDLL) 20 | endif() 21 | 22 | if (APPLE) 23 | SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -undefined dynamic_lookup") 24 | endif() 25 | 26 | # --- Output Library 27 | 28 | install(TARGETS lpy LIBRARY DESTINATION "lib") 29 | 30 | # --- Install Headers 31 | 32 | install(DIRECTORY "." DESTINATION "include/lpy" FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp") 33 | -------------------------------------------------------------------------------- /src/lpygui_postinstall.py: -------------------------------------------------------------------------------- 1 | # Postinstall scripts 2 | 3 | 4 | def install(): 5 | 6 | from openalea.deploy.shortcut import create_win_shortcut, set_win_reg, create_fd_shortcut 7 | import sys 8 | from os.path import join as pj 9 | 10 | winexe = sys.executable 11 | winexe = winexe.replace('python.exe', 'pythonw.exe') 12 | create_win_shortcut(name = 'L-Py', 13 | target = winexe, 14 | arguments = '"'+pj(sys.prefix, 'Scripts', 'lpy-script.pyw')+'"', 15 | startin = "", 16 | icon = "", 17 | description = "L-Systems in Python", 18 | menugroup = "OpenAlea") 19 | 20 | 21 | 22 | 23 | def uninstall(): 24 | pass 25 | 26 | if __name__ == '__main__': 27 | install() -------------------------------------------------------------------------------- /src/openalea/lpy/cpfg_compat/__init__.py: -------------------------------------------------------------------------------- 1 | from random import uniform 2 | 3 | def select_successor_from_prob(parray): 4 | totprob = sum(parray) 5 | p0 = uniform(0,totprob) 6 | for i,pi in enumerate(parray): 7 | if p0 < pi: 8 | return i 9 | else: p0 -= pi 10 | return len(parray) -------------------------------------------------------------------------------- /src/openalea/lpy/gui/biglogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/biglogo.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/flower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/flower.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/BreakPoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/BreakPoint.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/BreakPointGreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/BreakPointGreen.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/book.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/closetab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/closetab.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/codefile-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/codefile-red.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/codefile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/codefile.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/down.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/editcopy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/editcopy.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/editcut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/editcut.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/editfind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/editfind.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/editpaste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/editpaste.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/editraise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/editraise.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/editredo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/editredo.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/editundo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/editundo.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/exit.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/fileclose.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/fileclose.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/filenew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/filenew.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/fileopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/fileopen.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/filesave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/filesave.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/filesaveall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/filesaveall.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/greenarrow16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/greenarrow16.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/history.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/history.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/lock.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/mango.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/mango.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/next-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/next-green.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/next.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/pause.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/play-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/play-green.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/play-yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/play-yellow.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/play.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/prev-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/prev-green.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/prev.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/print.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/print.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/record.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/record.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/resetzoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/resetzoom.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/rewind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/rewind.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/run.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/step.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/step.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/svn-add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/svn-add.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/svn-conflict.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/svn-conflict.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/svn-modified.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/svn-modified.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/svn-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/svn-normal.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/up.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/warningsErrors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/warningsErrors.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/warningsErrors16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/warningsErrors16.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/wrap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/wrap.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/zoomin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/zoomin.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/icons/zoomout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/icons/zoomout.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/logo.ico -------------------------------------------------------------------------------- /src/openalea/lpy/gui/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/logo.png -------------------------------------------------------------------------------- /src/openalea/lpy/gui/lpy.pyw: -------------------------------------------------------------------------------- 1 | from openalea.lpy.gui.lpystudio import main 2 | 3 | main() -------------------------------------------------------------------------------- /src/openalea/lpy/gui/plugins/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy/gui/plugins/__init__.py -------------------------------------------------------------------------------- /src/openalea/lpy/gui/qt_check.py: -------------------------------------------------------------------------------- 1 | from openalea.plantgl.all import get_pgl_qt_version 2 | import os 3 | 4 | QT_VERSION = get_pgl_qt_version() >> 16 5 | 6 | if QT_VERSION == 6: 7 | os.environ['QT_API'] = 'pyside6' 8 | elif QT_VERSION == 4: 9 | os.environ['QT_API'] = 'pyqt' 10 | else: 11 | os.environ['QT_API'] ='pyqt'+str(QT_VERSION) 12 | 13 | 14 | if QT_VERSION == 4: 15 | os.environ.setdefault('QT_API_VERSION', '2') 16 | 17 | from openalea.plantgl.gui import qt 18 | 19 | if QT_VERSION == 4: 20 | import sip 21 | assert sip.getapi('QString') == 2 22 | -------------------------------------------------------------------------------- /src/openalea/lpy/lsysparameters/schema/appearance.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "appearance", 4 | "anyOf": [ 5 | { 6 | "$ref": "material.json" 7 | }, 8 | { 9 | "$ref": "texture2d.json" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /src/openalea/lpy/lsysparameters/schema/boolean.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "boolean", 4 | "type": "object", 5 | "required": ["name", "value"], 6 | "properties": { 7 | "name": { 8 | "type": "string", 9 | "pattern": "^[^\\d\\W]\\w*\\Z" 10 | }, 11 | "value": { 12 | "type": "boolean" 13 | } 14 | }, 15 | "additionalProperties": false 16 | } 17 | -------------------------------------------------------------------------------- /src/openalea/lpy/lsysparameters/schema/color.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "color", 4 | "type": "array", 5 | "minItems": 3, 6 | "maxItems": 3, 7 | "items": { 8 | "type": "integer", 9 | "minimum": 0, 10 | "maximum": 255 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/openalea/lpy/lsysparameters/schema/color4.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "color4", 4 | "type": "array", 5 | "minItems": 4, 6 | "maxItems": 4, 7 | "items": { 8 | "type": "integer", 9 | "minimum": 0, 10 | "maximum": 255 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/openalea/lpy/lsysparameters/schema/credits.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "creits", 4 | "type": "object", 5 | "properties": { 6 | "authors": { 7 | "type": "string" 8 | }, 9 | "institutes": { 10 | "type": "string" 11 | }, 12 | "copyright": { 13 | "type": "string" 14 | }, 15 | "description": { 16 | "type": "string" 17 | }, 18 | "references": { 19 | "type": "string" 20 | } 21 | }, 22 | "required": [], 23 | "additionalProperties": true 24 | } 25 | -------------------------------------------------------------------------------- /src/openalea/lpy/lsysparameters/schema/lpy.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "L-Py", 4 | "type": "object", 5 | "required": [ 6 | "schema", 7 | "version" 8 | ], 9 | "properties": { 10 | "schema": { 11 | "enum": ["lpy"] 12 | }, 13 | "version": { 14 | "type": "string" 15 | }, 16 | "options": { 17 | "$ref": "options.json" 18 | }, 19 | "parameters": { 20 | "type": "array", 21 | "items": { 22 | "$ref": "category.json" 23 | } 24 | }, 25 | "materials": { 26 | "type": "array", 27 | "items": { 28 | "$ref": "appearance.json" 29 | } 30 | }, 31 | "credits" : { 32 | "$ref": "credits.json" 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/openalea/lpy/lsysparameters/schema/number.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "number", 4 | "type": "object", 5 | "required": ["name", "type", "value", "min", "max"], 6 | "properties": { 7 | "name": { 8 | "type": "string", 9 | "pattern": "^[^\\d\\W]\\w*\\Z" 10 | }, 11 | "type": { 12 | "enum": ["Integer", "Float"] 13 | }, 14 | "value": { 15 | "type": "number" 16 | }, 17 | "min": { 18 | "type": "number" 19 | }, 20 | "max": { 21 | "type": "number" 22 | }, 23 | "precision": { 24 | "type": "number", 25 | "minimum" : 0 26 | } 27 | }, 28 | "additionalProperties": false 29 | } 30 | -------------------------------------------------------------------------------- /src/openalea/lpy/lsysparameters/schema/options.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "options", 4 | "type": "object", 5 | "properties": { 6 | "animation_timestep": { 7 | "type": "number", 8 | "minimum": 0 9 | } 10 | }, 11 | "required": [], 12 | "additionalProperties": true 13 | } 14 | -------------------------------------------------------------------------------- /src/openalea/lpy/lsysparameters/schema/point2array.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "point2array", 4 | "type": "object", 5 | "required": ["type", "data"], 6 | "properties": { 7 | "type": { 8 | "enum": ["Point2Array"] 9 | }, 10 | "data": { 11 | "type": "array", 12 | "minItems": 2, 13 | "items": { 14 | "type": "array", 15 | "minItems": 2, 16 | "maxItems": 2, 17 | "items": { 18 | "type": "number" 19 | } 20 | } 21 | }, 22 | "id": { 23 | "type": "integer" 24 | } 25 | }, 26 | "additionalProperties": false 27 | } 28 | -------------------------------------------------------------------------------- /src/openalea/lpy/lsysparameters/schema/point3array.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "point3array", 4 | "type": "object", 5 | "required": ["type", "data"], 6 | "properties": { 7 | "type": { 8 | "enum": ["Point3Array"] 9 | }, 10 | "data": { 11 | "type": "array", 12 | "minItems": 2, 13 | "items": { 14 | "type": "array", 15 | "minItems": 3, 16 | "maxItems": 3, 17 | "items": { 18 | "type": "number" 19 | } 20 | } 21 | }, 22 | "id": { 23 | "type": "integer" 24 | } 25 | }, 26 | "additionalProperties": false 27 | } 28 | -------------------------------------------------------------------------------- /src/openalea/lpy/lsysparameters/schema/point3matrix.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "point3matrix", 4 | "type": "object", 5 | "required": ["type", "data"], 6 | "properties": { 7 | "type": { 8 | "enum": ["Point3Matrix"] 9 | }, 10 | "data": { 11 | "type": "array", 12 | "minItems": 2, 13 | "items": { 14 | "type": "array", 15 | "minItems": 2, 16 | "items": { 17 | "type": "array", 18 | "minItems": 3, 19 | "maxItems": 3, 20 | "items": { 21 | "type": "number" 22 | } 23 | } 24 | } 25 | }, 26 | "id": { 27 | "type": "integer" 28 | } 29 | }, 30 | "additionalProperties": false 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/openalea/lpy/lsysparameters/schema/point4array.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "point4array", 4 | "type": "array", 5 | "minItems": 2, 6 | "items": { 7 | "type": "array", 8 | "minItems": 4, 9 | "maxItems": 4, 10 | "items": { 11 | "type": "number" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/openalea/lpy/lsysparameters/schema/point4grid.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "point4grid", 4 | "type": "array", 5 | "minItems": 2, 6 | "items": { 7 | "type": "array", 8 | "minItems": 2, 9 | "items": { 10 | "type": "array", 11 | "minItems": 2, 12 | "items": { 13 | "type": "array", 14 | "minItems": 4, 15 | "maxItems": 4, 16 | "items": { 17 | "type": "number" 18 | } 19 | } 20 | } 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /src/openalea/lpy/lsysparameters/schema/point4matrix.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "point4matrix", 4 | "type": "object", 5 | "required": ["type", "data"], 6 | "properties": { 7 | "type": { 8 | "enum": ["Point4Matrix"] 9 | }, 10 | "data": { 11 | "type": "array", 12 | "minItems": 2, 13 | "items": { 14 | "type": "array", 15 | "minItems": 2, 16 | "items": { 17 | "type": "array", 18 | "minItems": 4, 19 | "maxItems": 4, 20 | "items": { 21 | "type": "number" 22 | } 23 | } 24 | } 25 | }, 26 | "id": { 27 | "type": "integer" 28 | } 29 | }, 30 | "additionalProperties": false 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/openalea/lpy/lsysparameters/schema/realarray.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "title": "realarray", 4 | "type": "object", 5 | "required": ["type", "data"], 6 | "properties": { 7 | "type": { 8 | "enum": ["RealArray"] 9 | }, 10 | "data": { 11 | "type": "array", 12 | "minItems": 2, 13 | "items": { 14 | "type": "number" 15 | } 16 | }, 17 | "id": { 18 | "type": "integer" 19 | } 20 | }, 21 | "additionalProperties": false 22 | } 23 | -------------------------------------------------------------------------------- /src/openalea/lpy/simlab/__init__.py: -------------------------------------------------------------------------------- 1 | from lpy_process import * -------------------------------------------------------------------------------- /src/openalea/lpy_wralea/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/src/openalea/lpy_wralea/__init__.py -------------------------------------------------------------------------------- /src/wrapper/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # --- Source Files 2 | 3 | file(GLOB_RECURSE SRC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") 4 | 5 | add_library(__lpy_kernel__ SHARED ${SRC_FILES}) 6 | 7 | # --- Linked Library 8 | 9 | target_link_libraries(__lpy_kernel__ lpy) 10 | target_link_libraries(__lpy_kernel__ ${PLANTGL_LIBRARIES}) 11 | pgllib_link_python(__lpy_kernel__) 12 | pgllib_link_boost(__lpy_kernel__) 13 | 14 | 15 | # --- Dependencies 16 | 17 | add_dependencies(__lpy_kernel__ lpy) 18 | 19 | # --- Output Library 20 | 21 | pglwrapper_install(__lpy_kernel__) 22 | 23 | -------------------------------------------------------------------------------- /test/cembedding/embeddedlpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/test/cembedding/embeddedlpy -------------------------------------------------------------------------------- /test/cembedding/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | 6 | LPY_USING_NAMESPACE 7 | 8 | int main(int argc, char * argv[]) { 9 | bool verbose = false; 10 | if ((argc > 1) && (std::string(argv[1]) == "-v")) { 11 | verbose = true; 12 | } 13 | if (verbose) printf("Lpy_Initialize\n"); 14 | Lpy_Initialize(); 15 | 16 | { 17 | 18 | if (verbose) printf("Create Lsystem\n"); 19 | Lsystem l("../fibonacci.lpy"); 20 | AxialTree a = l.derive(); 21 | printf("'%s'\n",a.c_str()); 22 | // LocalContext l; 23 | // AxialTree a; 24 | 25 | } 26 | 27 | if (verbose) printf("Lpy_Finalize\n"); 28 | Lpy_Finalize(); 29 | 30 | if (verbose) printf("Done.\n"); 31 | return EXIT_SUCCESS; 32 | } -------------------------------------------------------------------------------- /test/cembedding/test_cembedding.py: -------------------------------------------------------------------------------- 1 | 2 | def test_embeddedlpy(): 3 | import os 4 | os.system('scons') 5 | import subprocess 6 | proc = subprocess.Popen(["./embeddedlpy"], stdout=subprocess.PIPE) 7 | out, err = proc.communicate() 8 | out = out.strip() 9 | print(repr(out)) 10 | assert out == "'+(90);(3)I(6765)I(4181)I(2584)I(1597)I(987)I(610)I(377)I(233)I(144)I(89)I(55)I(34)I(21)I(13)I(8)I(5)I(3)I(2)I(1)I(1)'" 11 | 12 | if __name__ == '__main__': 13 | test_embeddedlpy() -------------------------------------------------------------------------------- /test/diese_bug.lpy: -------------------------------------------------------------------------------- 1 | Axiom: #(0.001)-(90)F(1) 2 | derivation length: 5 3 | 4 | production: 5 | 6 | F(x) : 7 | produce F(x/3.0)+F(x/3.0)--F(x/3.0)+F(x/3.0) 8 | 9 | 10 | endlsystem 11 | ###### INITIALISATION ###### 12 | 13 | __copyright__ = """open-source GPL""" 14 | __description__ = """- start from an axiom representing a triangle with equal side lengths 15 | 16 | - try other fractal rules""" 17 | __institutes__ = """INRIA - CIRAD Virtual Plants""" 18 | __authors__ = """C. Godin, F. Boudon""" 19 | -------------------------------------------------------------------------------- /test/extension/alias.lpy: -------------------------------------------------------------------------------- 1 | module A = F 2 | 3 | 4 | Axiom: A(1) 5 | 6 | derivation length: 5 7 | production: 8 | 9 | A(x) --> A(x+1) 10 | 11 | endlsystem 12 | ###### INITIALISATION ###### 13 | 14 | def __initialiseContext__(context): 15 | context.options.setSelection('Module declaration',1) 16 | -------------------------------------------------------------------------------- /test/extension/comments.lpy: -------------------------------------------------------------------------------- 1 | Axiom: A(1)#(3) 2 | 3 | derivation length: 5 4 | production: 5 | 6 | A(x) --> A(x+1) # test 7 | 8 | endlsystem -------------------------------------------------------------------------------- /test/extension/filter_string.lpy: -------------------------------------------------------------------------------- 1 | values = range(10) 2 | Axiom: A(3)A(-1) 3 | 4 | derivation length: 1 5 | production: 6 | 7 | *(n in 'AB' , x in values): 8 | print '* = ',n,', x =',x 9 | 10 | 11 | homomorphism: 12 | 13 | 14 | endlsystem 15 | -------------------------------------------------------------------------------- /test/extension/filtering.lpy: -------------------------------------------------------------------------------- 1 | values = range(10) 2 | Axiom: A(3)A(-1) 3 | 4 | derivation length: 1 5 | production: 6 | 7 | A(x not in values): 8 | print 'not in',x 9 | 10 | A(x in values): 11 | print 'in',x 12 | 13 | *(n not in ['A','B'], x in values): 14 | print '* not in A in',x 15 | assert False 16 | 17 | *(n in ['A','B'], x in values): 18 | print '* in A in',x 19 | 20 | A(x < 2): 21 | print '<2 ',x 22 | 23 | homomorphism: 24 | 25 | 26 | endlsystem 27 | -------------------------------------------------------------------------------- /test/extension/getmodule.lpy: -------------------------------------------------------------------------------- 1 | def EndEach(lstring): 2 | print lstring 3 | 4 | module B(t), C 5 | 6 | Axiom: DAB(1) 7 | 8 | 9 | derivation length: 2 10 | production: 11 | 12 | D --> H 13 | 14 | $d=D < $h=H << $a=A > $b=B : 15 | print a,d,h,b,b.t 16 | b.t = 2 17 | produce $b K 18 | 19 | B(h) --> B(h+1) 20 | 21 | 22 | homomorphism: 23 | 24 | 25 | endlsystem 26 | -------------------------------------------------------------------------------- /test/extension/iterator.lpy: -------------------------------------------------------------------------------- 1 | from random import random 2 | 3 | def EndEach(lstring): 4 | print lstring 5 | 6 | Axiom: A(10) 7 | 8 | derivation length: 3 9 | production: 10 | 11 | A(x): 12 | for i in xrange(x+3,3,-1): 13 | nproduce I(i)[+B(i-1)][-B(i-2)] 14 | produce I(i) 15 | 16 | B(x): 17 | nproduce D 18 | for i in xrange(x,0,-1): 19 | if random() < 0.5: 20 | nproduce I(i) 21 | else: 22 | nproduce J(i,x) 23 | produce C 24 | 25 | D > ?I(i): 26 | m = i.next() 27 | print m, i.next() 28 | print m.name, m[0], m[0:len(m)] 29 | 30 | homomorphism: 31 | 32 | 33 | endlsystem 34 | -------------------------------------------------------------------------------- /test/extension/iterator_end.lpy: -------------------------------------------------------------------------------- 1 | from random import random 2 | 3 | def EndEach(lstring): 4 | print lstring 5 | 6 | Axiom: A(10)[GB[GC]]E 7 | 8 | derivation length: 3 9 | ignore: G 10 | production: 11 | 12 | A(x) > [?I(i)]: 13 | m = i.next(True) 14 | assert m.name == 'B' 15 | m = i.next(True) 16 | assert m.name == '[' 17 | m = i.next(True) 18 | assert m.name == 'C' 19 | m = i.next(True) 20 | assert m.name == ']' 21 | m = i.next(True) 22 | assert m.name == ']' 23 | try: 24 | m = i.next(True) 25 | assert False and 'iterator go out of its branch' 26 | except: 27 | print 'Iterator correctly end up at end of branch' 28 | pass 29 | 30 | homomorphism: 31 | 32 | 33 | endlsystem 34 | -------------------------------------------------------------------------------- /test/extension/multiplerepexp.lpy: -------------------------------------------------------------------------------- 1 | Axiom: AB(0)[B(1)B(2)[C(8)][D(9)]B(5)][J(3)B(4)[E(10)][G(11)]]B(6) 2 | 3 | 4 | derivation length: 1 5 | production: 6 | A > B(y) x([*(n1,*a1)B(b)x([*(n2,ma2)])]) B(z) : 7 | print 'match : y=',y,',n1=',repr(n1),',a1=',a1,',b=',b,',z=',z,',n2=',repr(n2),',ma2=',ma2 8 | 9 | homomorphism: 10 | 11 | 12 | endlsystem -------------------------------------------------------------------------------- /test/extension/new.lpy: -------------------------------------------------------------------------------- 1 | Axiom: A(1)B(2) 2 | 3 | def EndEach(lstring): 4 | print lstring 5 | 6 | derivation length: 10 7 | production: 8 | 9 | A(*args) --> A(*args) 10 | 11 | *(n,*args) : 12 | args[0] +=1 13 | produce new(n,*args) 14 | 15 | homomorphism: 16 | 17 | 18 | endlsystem 19 | -------------------------------------------------------------------------------- /test/extension/norepexp.lpy: -------------------------------------------------------------------------------- 1 | Axiom: AB(0)B(6) 2 | 3 | 4 | derivation length: 1 5 | production: 6 | A > B(y) x([B(b)]) B(z) : 7 | print 'match : y=',y,',b=',b,',z=',z 8 | 9 | homomorphism: 10 | 11 | 12 | endlsystem 13 | -------------------------------------------------------------------------------- /test/extension/or.lpy: -------------------------------------------------------------------------------- 1 | Axiom: AB(0)C(1)D(2)AE(4)AF(5)G(6) 2 | 3 | derivation length: 4 4 | production: 5 | 6 | A > or( B(x)C(y)D(z), E(i), F(j)G(k) ): 7 | print x,y,z,i,j,k 8 | produce H 9 | 10 | homomorphism: 11 | 12 | 13 | endlsystem 14 | ###### INITIALISATION ###### 15 | 16 | def __initialiseContext__(context): 17 | context.options.setSelection('Early return when no matching',0) 18 | -------------------------------------------------------------------------------- /test/extension/re-predecessor.lpy: -------------------------------------------------------------------------------- 1 | def EndEach(lstring): 2 | print lstring 3 | 4 | Axiom: AIJIJIJIDF 5 | 6 | derivation length: 3 7 | production: 8 | 9 | A all(or(I,J)) : 10 | produce B 11 | 12 | 13 | 14 | homomorphism: 15 | 16 | 17 | endlsystem 18 | ###### INITIALISATION ###### 19 | 20 | def __initialiseContext__(context): 21 | context.options.setSelection('String matching',3) 22 | -------------------------------------------------------------------------------- /test/extension/rigth_match.lpy: -------------------------------------------------------------------------------- 1 | Axiom: AB[C][D]E 2 | 3 | derivation length: 1 4 | production: 5 | 6 | A > BE : 7 | print 'match' 8 | 9 | homomorphism: 10 | 11 | 12 | endlsystem 13 | -------------------------------------------------------------------------------- /test/extension/unpacking.lpy: -------------------------------------------------------------------------------- 1 | Axiom: A(1)B(2) 2 | 3 | def EndEach(lstring): 4 | print lstring 5 | 6 | derivation length: 10 7 | production: 8 | 9 | A(*args) --> A(*args) 10 | 11 | *(n,*args) : 12 | args[0] +=1 13 | produce B(*args) 14 | 15 | homomorphism: 16 | 17 | 18 | endlsystem 19 | -------------------------------------------------------------------------------- /test/fibonacci.lpy: -------------------------------------------------------------------------------- 1 | from math import sqrt 2 | 3 | nbValue = 20 4 | 5 | Axiom: +(90);(3)A(nbValue) 6 | 7 | #def Start(): 8 | # 9 | 10 | derivation length: 2 11 | 12 | production: 13 | I(k) >> I(i)I(j): 14 | #print 'Transform I(',k,') > I(',i,')I(',j,')' 15 | newval = i+j 16 | if newval>=0 : 17 | produce I(newval) 18 | else: 19 | produce 20 | 21 | decomposition: 22 | maximum depth: 100 23 | A(i) : 24 | if i>0: 25 | produce I(1)A(i-1) 26 | else: 27 | #print 'Backward' 28 | backward() 29 | produce 30 | homomorphism: 31 | I(i) : 32 | produce f(0.1)F(0.9)[-(135);(4)f(sqrt(2.0)*0.5)@L(str(i))] 33 | endlsystem 34 | 35 | -------------------------------------------------------------------------------- /test/image/bjunipc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/test/image/bjunipc.png -------------------------------------------------------------------------------- /test/lpytest/MoveToBug.lpy: -------------------------------------------------------------------------------- 1 | # with Pt2=0,1,0 the line is drawn from 0,0,10 to 0,1,0 2 | # with Pt2=0,0,1 the line is drawn from 0,0,10 to 0,0,11 3 | 4 | # following generates incorrect line, to fix save y component to something small in pt2! 5 | Axiom: Pt1(0,0,10) Pt2(0,0,0) 6 | # following generates correct line 7 | # Axiom: -(90) Frame Pt1(0,10,0) Pt2(0,0,0) 8 | # following generates correct line 9 | #Axiom: Pt1(10,0,0) Pt2(0,0,0) 10 | 11 | derivation length: 1 12 | production: 13 | 14 | interpretation: 15 | 16 | # same thing happens if you use LineTo or MoveTo for the first pt 17 | Pt1(x,y,z): 18 | produce MoveTo(x,y,z) Sphere(0.5) [@M(x,y,z) SetColor(2) Sphere(1.0)] 19 | 20 | Pt2(x,y,z): 21 | produce LineTo(x,y,z) Sphere(0.5) [@M(x,y,z) SetColor(3) Sphere(1.0)] 22 | 23 | endlsystem 24 | -------------------------------------------------------------------------------- /test/lpytest/recursiveproduce.lpy: -------------------------------------------------------------------------------- 1 | lcode = """ 2 | Axiom: A 3 | production: 4 | A --> BCD 5 | """ 6 | 7 | def End(lstring): 8 | assert lstring == Lstring("GHJ") 9 | 10 | Axiom: E 11 | 12 | derivation length: 1 13 | production: 14 | 15 | E: 16 | nproduce G 17 | l = Lsystem() 18 | l.set(lcode) 19 | plstring = l.iterate() 20 | produce HJ 21 | 22 | interpretation: 23 | 24 | 25 | endlsystem 26 | -------------------------------------------------------------------------------- /test/lpytest/test_axialmatching.lpy: -------------------------------------------------------------------------------- 1 | matched = False 2 | 3 | def StartEach(): 4 | global matched 5 | matched = False 6 | 7 | def EndEach(): 8 | global matched 9 | assert matched 10 | 11 | Axiom: I(0) [ I(1) [ I(2) I(3) ] I(4) ] 12 | 13 | 14 | derivation length: 1 15 | production: 16 | 17 | [ I(x) [ < I(y) > I(z): 18 | global matched 19 | matched = True 20 | assert (x,y,z) == (1,2,3) 21 | 22 | 23 | interpretation: 24 | 25 | 26 | endlsystem 27 | -------------------------------------------------------------------------------- /test/lpytest/test_backward_multimatch.lpy: -------------------------------------------------------------------------------- 1 | backward() 2 | 3 | Axiom: [] 4 | 5 | derivation length: 1 6 | production: 7 | 8 | [] --> F 9 | 10 | interpretation: 11 | 12 | 13 | endlsystem 14 | ###### INITIALISATION ###### 15 | 16 | __lpy_code_version__ = 1.1 17 | 18 | def __initialiseContext__(context): 19 | context.options.setSelection('Module matching',0) 20 | context.options.setSelection('String matching',0) 21 | -------------------------------------------------------------------------------- /test/lpytest/test_comment.lpy: -------------------------------------------------------------------------------- 1 | # produce toto ) 2 | # --> titi ) 3 | ' produce toto )' 4 | " produce toto )" 5 | ' --> titi )' 6 | " --> titi )" 7 | a = ' produce toto )' 8 | b = " produce toto )" 9 | c = ' --> titi )' 10 | d = " --> titi )" 11 | 12 | Axiom: A 13 | 14 | derivation length: 1 15 | production: 16 | 17 | A --> B 18 | 19 | B : 20 | # produce toto 21 | # --> titi ) 22 | ' produce toto )' 23 | " produce toto )" 24 | ' --> titi )' 25 | " --> titi )" 26 | produce A 27 | 28 | endlsystem 29 | -------------------------------------------------------------------------------- /test/lpytest/test_complex_match.lpy: -------------------------------------------------------------------------------- 1 | matched = False 2 | 3 | def Start(): 4 | global matched 5 | matched = False 6 | 7 | def EndEach(lstring): 8 | assert matched == True 9 | 10 | module P : scale = 1 11 | module B : scale = 2 12 | module N : scale = 3 13 | 14 | Axiom: PBN(0)BN(1) 15 | 16 | derivation length: 1 17 | production: 18 | 19 | P < N(x): 20 | if x == 1: 21 | global matched 22 | matched = True 23 | 24 | 25 | 26 | homomorphism: 27 | 28 | 29 | endlsystem 30 | ###### INITIALISATION ###### 31 | 32 | __lpy_code_version__ = 1.1 33 | 34 | def __initialiseContext__(context): 35 | context.options.setSelection('String matching',3) 36 | -------------------------------------------------------------------------------- /test/lpytest/test_components.lpy: -------------------------------------------------------------------------------- 1 | module A(nbcomponents) : scale = 1 2 | module B : scale = 2 3 | 4 | Axiom: A(3) B [ B A(1) B ] B A(2) B B 5 | 6 | derivation length: 1 7 | production: 8 | $A(a): 9 | print(a.components_at_scale(2)) 10 | assert len(a.components()) == a.nbcomponents 11 | assert len(a.components_at_scale(2)) == a.nbcomponents 12 | 13 | 14 | interpretation: 15 | 16 | 17 | endlsystem 18 | -------------------------------------------------------------------------------- /test/lpytest/test_concavepoly.lpy: -------------------------------------------------------------------------------- 1 | from openalea.plantgl.all import pgl_support_extension 2 | 3 | def End(lstring,lscene): 4 | print(len(lscene)) 5 | faceset = lscene[-1].geometry 6 | print(list(map(list,faceset.indexList))) 7 | # assert faceset.indexList == [[1,2,3],[3,4,5],[0,1,3,5],[0,5,6,7],[7,8,9],[9,10,11],[7,9,11],[0,7,11]] 8 | if pgl_support_extension('CGAL'): 9 | indexList = list(map(list,faceset.indexList)) 10 | assert indexList == [[0,11,10],[10,9,8],[0,10,8,7,6],[0,6,5,4],[0,4,3,2],[0,2,1]] or indexList == [[10, 9, 8], [0, 11, 10, 8], [0, 8, 7, 6], [0, 6, 5, 4], [0, 4, 3, 2], [0, 2, 1]] 11 | 12 | 13 | Axiom: +(90) BP F-F++F-F++F-F++F-F++F-F++F-F EP(True) 14 | #Axiom: -(90) BP F+F--F+F--F+F--F+F--F+F--F+F EP(True) 15 | 16 | derivation length: 1 17 | production: 18 | 19 | 20 | interpretation: 21 | 22 | 23 | endlsystem 24 | -------------------------------------------------------------------------------- /test/lpytest/test_consider_bracket.lpy: -------------------------------------------------------------------------------- 1 | from openalea.plantgl.all import * 2 | 3 | def EndEach(lstring): 4 | print(lstring) 5 | assert lstring == Lstring("M(4) [ M(1) ] M(2) M(1)") 6 | 7 | backward() 8 | consider: NM 9 | Axiom: N(0) [ N(0) ] N(0) N(0) 10 | 11 | derivation length: 1 12 | production: 13 | 14 | group 0: 15 | 16 | 17 | N(r) >> x([M(lnbelem)]) or( M(anbelem), None ) : 18 | v = 1 19 | if lnbelem : v += sum(lnbelem) 20 | if anbelem : v += anbelem 21 | produce M(v) 22 | 23 | # N(r) --> M(1) 24 | 25 | 26 | interpretation: 27 | 28 | 29 | endlsystem 30 | -------------------------------------------------------------------------------- /test/lpytest/test_consider_per_rule.lpy: -------------------------------------------------------------------------------- 1 | def EndEach(lstring,lscene): 2 | assert len(lscene) == 4 3 | 4 | Axiom: F[+A][A]-A 5 | 6 | derivation length: 1 7 | production: 8 | 9 | ignore:+ 10 | F [ < A --> [;f@O] 11 | 12 | ignore:- 13 | F < A --> [;;f@O] 14 | 15 | ignore: 16 | T --> T 17 | 18 | interpretation: 19 | 20 | 21 | endlsystem 22 | -------------------------------------------------------------------------------- /test/lpytest/test_deflateargs.lpy: -------------------------------------------------------------------------------- 1 | def End(lstring): 2 | print(lstring, type(lstring[0][0])) 3 | assert lstring == Lstring('A(0,1)') 4 | 5 | module A(x,y) 6 | 7 | Axiom: A(0,0) 8 | 9 | derivation length: 1 10 | production: 11 | 12 | A(*p) : 13 | print(p) 14 | p[1] += 1 15 | produce A(*p) 16 | 17 | interpretation: 18 | 19 | 20 | endlsystem 21 | -------------------------------------------------------------------------------- /test/lpytest/test_deflatekwd.lpy: -------------------------------------------------------------------------------- 1 | def End(lstring): 2 | print(lstring, type(lstring[0][0])) 3 | assert lstring == Lstring('A(0,1)') 4 | 5 | module A(x,y) 6 | 7 | Axiom: A(0,0) 8 | 9 | derivation length: 1 10 | production: 11 | 12 | A(**p) : 13 | print(p) 14 | p['y'] += 1 15 | #del p['x'] 16 | #p['z'] = 0 17 | produce A(**p) 18 | 19 | interpretation: 20 | 21 | 22 | endlsystem 23 | -------------------------------------------------------------------------------- /test/lpytest/test_emptyline.lpy: -------------------------------------------------------------------------------- 1 | Axiom: A 2 | 3 | derivation length: 1 4 | production: 5 | 6 | A: 7 | pass 8 | 9 | 10 | 11 | produce A 12 | B : 13 | produce B 14 | 15 | interpretation: 16 | 17 | 18 | endlsystem 19 | -------------------------------------------------------------------------------- /test/lpytest/test_endeach_modif.lpy: -------------------------------------------------------------------------------- 1 | def EndEach(lstring): 2 | assert len(lstring) == getIterationNb()+1 3 | lstring += 'B' 4 | global ok 5 | ok = True 6 | return lstring 7 | 8 | derivation length : 5 9 | 10 | ok = False 11 | 12 | def End(): 13 | assert ok == True 14 | 15 | Axiom: A 16 | production: 17 | A --> A 18 | 19 | endlsystem -------------------------------------------------------------------------------- /test/lpytest/test_frame.lpy: -------------------------------------------------------------------------------- 1 | 2 | sc = None 3 | 4 | def End(lstring,scene): 5 | global sc 6 | sc = scene 7 | 8 | Axiom: F +(0) a ?F 9 | 10 | derivation length: 90 11 | production: 12 | 13 | +(x) --> +(x+1) 14 | 15 | a > ?F(*arg): 16 | if getIterationNb() % 10 == 0: 17 | print(arg) 18 | 19 | homomorphism: 20 | a --> Frame(2,0.8,1.5) 21 | 22 | endlsystem 23 | -------------------------------------------------------------------------------- /test/lpytest/test_framedisplay.lpy: -------------------------------------------------------------------------------- 1 | r = 1. 2 | N = 100 3 | 4 | dalpha = 360./N 5 | dl = dalpha*r 6 | 7 | def StartEach(): 8 | frameDisplay(getIterationNb()%10 == 0) 9 | pass 10 | 11 | def End(): 12 | frameDisplay(True) 13 | 14 | Axiom: C(N) 15 | 16 | derivation length: N 17 | 18 | production: 19 | 20 | C(n): 21 | if n >= 0 : produce S(dl)C(n-1) 22 | 23 | homomorphism: 24 | 25 | S(dl) : produce _(2)-(dalpha)F(dl) 26 | 27 | endlsystem 28 | ###### INITIALISATION ###### 29 | 30 | def __initialiseContext__(context): 31 | context.animation_timestep = 0.062 32 | -------------------------------------------------------------------------------- /test/lpytest/test_functionalaxiom.lpy: -------------------------------------------------------------------------------- 1 | 2 | def End(lstring): 3 | assert len(lstring) == 20 4 | 5 | Axiom: 6 | for i in range(10): 7 | nproduce F f 8 | 9 | derivation length: 1 10 | production: 11 | 12 | 13 | interpretation: 14 | 15 | 16 | endlsystem 17 | -------------------------------------------------------------------------------- /test/lpytest/test_getmod.lpy: -------------------------------------------------------------------------------- 1 | result = {} 2 | 3 | def StartEach(): 4 | global result 5 | result = {} 6 | 7 | def EndEach(lstring): 8 | global result 9 | print(result) 10 | assert result == { 'A' : (0, '[B]'), 'B' : (1, 'None') } 11 | assert lstring == 'AAAB' 12 | 13 | module A 14 | module B: base = A 15 | 16 | 17 | Axiom: AB 18 | 19 | derivation length: 1 20 | production: 21 | 22 | $A(a) : 23 | global result 24 | assert a.name in 'AB' 25 | print(a.name,'sons[',a.position(),']=',a.sons()) 26 | result[a.name] = (a.position(),str(a.sons())) 27 | produce A $a 28 | 29 | endlsystem 30 | ###### INITIALISATION ###### 31 | 32 | __lpy_code_version__ = 1.1 33 | 34 | def __initialiseContext__(context): 35 | context.options.setSelection('Module inheritance',1) 36 | -------------------------------------------------------------------------------- /test/lpytest/test_getmod_sons.lpy: -------------------------------------------------------------------------------- 1 | module A 2 | module B : base = A 3 | 4 | def End(lstring): 5 | assert lstring == 'A[+B]B[+B[+A]A]B[+A]A[+B[+A]A[+A[+B]B]A[+B]B]B[+A]A[+A[+B]B]A[+B]B' 6 | 7 | 8 | Axiom: A[+B]B 9 | 10 | derivation length: 2 11 | production: 12 | 13 | $A(a) : 14 | assert a.name in 'AB' 15 | print(a.name,'sons[',a.position(),']=' , a.sons()) 16 | produce new('A' if a.name == 'B' else 'B')[+$a]$a 17 | 18 | 19 | interpretation: 20 | A --> ,(3)F 21 | B --> ,(2)F 22 | 23 | endlsystem 24 | ###### INITIALISATION ###### 25 | 26 | __lpy_code_version__ = 1.1 27 | 28 | def __initialiseContext__(context): 29 | context.options.setSelection('Module inheritance',1) 30 | -------------------------------------------------------------------------------- /test/lpytest/test_in_left_context.lpy: -------------------------------------------------------------------------------- 1 | Axiom: D D A(1) B 2 | 3 | derivation length: 1 4 | production: 5 | 6 | B : 7 | params = {} 8 | if inLeftContext('A(x)', params) : 9 | assert InLeftContext(G) == False 10 | assert InLeftContext(D) == True 11 | produce C 12 | else: 13 | raise ValueError('inLeftContext') 14 | 15 | interpretation: 16 | 17 | 18 | endlsystem 19 | -------------------------------------------------------------------------------- /test/lpytest/test_in_right_context.lpy: -------------------------------------------------------------------------------- 1 | Axiom: B A(1) D K D 2 | 3 | derivation length: 1 4 | production: 5 | 6 | B : 7 | params = {} 8 | print('A') 9 | if inRightContext('A(x)', params) : 10 | assert params['x'] == 1 11 | print('G') 12 | assert InRightContext(G) == False 13 | print('D') 14 | assert InRightContext(D) == True 15 | produce C 16 | else: 17 | raise ValueError('inRightContext') 18 | 19 | interpretation: 20 | 21 | 22 | endlsystem 23 | -------------------------------------------------------------------------------- /test/lpytest/test_inheritance.lpy: -------------------------------------------------------------------------------- 1 | module A(t) 2 | module B : base = A, scale = 2 3 | module C(x) : base = (A,B) # perfect 4 | 5 | assert ModuleClass.get('C').issubclass(ModuleClass.get('A')) 6 | 7 | Axiom: C(1,2) 8 | 9 | derivation length: 1 10 | production: 11 | 12 | A(*args): 13 | print('A(',args,')') 14 | 15 | B(*args): 16 | print('B(',args,')') 17 | 18 | C(*args): 19 | print('C(',args,')') 20 | 21 | interpretation: 22 | 23 | 24 | endlsystem 25 | ###### INITIALISATION ###### 26 | 27 | def __initialiseContext__(context): 28 | context.options.setSelection('Module inheritance',1) 29 | -------------------------------------------------------------------------------- /test/lpytest/test_inheritance_simple.lpy: -------------------------------------------------------------------------------- 1 | module A 2 | module B : base = A 3 | 4 | assert ModuleClass.get('B').issubclass(ModuleClass.get('A')) 5 | 6 | Axiom: B 7 | 8 | derivation length: 1 9 | production: 10 | 11 | A: 12 | print('Find A') 13 | 14 | *(name): 15 | print('find',name) 16 | 17 | interpretation: 18 | 19 | 20 | endlsystem 21 | ###### INITIALISATION ###### 22 | 23 | def __initialiseContext__(context): 24 | context.options.setSelection('Module inheritance',1) 25 | -------------------------------------------------------------------------------- /test/lpytest/test_interpretation_turtle.lpy: -------------------------------------------------------------------------------- 1 | # Help on turtle: 2 | # from openalea.plantgl.all import * 3 | # help(PglTurtle) 4 | 5 | def StartInterpretation(turtle): 6 | turtle.add_parameter('toto',0) 7 | pass 8 | 9 | def EndInterpretation(turtle): 10 | pass 11 | 12 | Axiom: 13 | for i in range(5): 14 | nproduce K 15 | nproduce A(0) 16 | nproduce [ 17 | for i in range(5): 18 | nproduce K 19 | nproduce A(1) ] 20 | nproduce [ 21 | for i in range(10): 22 | nproduce K 23 | nproduce A(2) ] 24 | 25 | derivation length: 1 26 | production: 27 | 28 | 29 | interpretation: 30 | 31 | K : 32 | turtle.toto += 1 33 | 34 | turtle.left(60) 35 | turtle.nF(3,0.1) 36 | turtle.sphere(0.5) 37 | 38 | A(i): 39 | values = { 0 : 5, 1 : 10, 2 : 15 } 40 | print(turtle.toto) 41 | assert turtle.toto == values[i] 42 | 43 | endlsystem 44 | -------------------------------------------------------------------------------- /test/lpytest/test_lateral_msmatch.lpy: -------------------------------------------------------------------------------- 1 | module A : scale = 3 2 | module B : scale = 2 3 | 4 | Axiom: A(0)B[B[BA(1)]]BA(2) 5 | 6 | derivation length: 1 7 | production: 8 | 9 | A(x) > [[A(y)]] : 10 | print(x,y) 11 | 12 | 13 | homomorphism: 14 | 15 | 16 | endlsystem 17 | ###### INITIALISATION ###### 18 | 19 | def __initialiseContext__(context): 20 | context.options.setSelection('String matching',3) 21 | -------------------------------------------------------------------------------- /test/lpytest/test_leftcontext.lpy: -------------------------------------------------------------------------------- 1 | Axiom: AE[B[D]] C 2 | 3 | ignore: E 4 | 5 | derivation length: 1 6 | production: 7 | 8 | A < C : 9 | print('matched') 10 | 11 | interpretation: 12 | 13 | 14 | endlsystem 15 | -------------------------------------------------------------------------------- /test/lpytest/test_lstring_change.lpy: -------------------------------------------------------------------------------- 1 | from openalea.lpy.__lpyfuture__ import * 2 | 3 | iterbackup = 1 4 | 5 | @enable_string_discard 6 | def EndEach(): 7 | if getIterationNb() == iterbackup: 8 | DiscardNewString() 9 | 10 | 11 | 12 | def End(lstring): 13 | print('End', len(lstring), lstring) 14 | assert len(lstring) == 1 15 | 16 | Axiom: A 17 | 18 | derivation length: 3 19 | production: 20 | 21 | A : 22 | if getIterationNb() == iterbackup : 23 | produce FFA 24 | 25 | interpretation: 26 | 27 | 28 | endlsystem 29 | ###### INITIALISATION ###### 30 | 31 | __lpy_code_version__ = 1.1 32 | 33 | def __initialiseContext__(context): 34 | context.options.setSelection('Early return when no matching',0) 35 | -------------------------------------------------------------------------------- /test/lpytest/test_lstring_change2.lpy: -------------------------------------------------------------------------------- 1 | 2 | def EndEach(lstring): 3 | lstring[0][0] = 2 4 | 5 | def End(lstring): 6 | print('End', lstring) 7 | assert lstring[0][0] == 2 8 | 9 | Axiom: A(1) 10 | 11 | derivation length: 1 12 | production: 13 | 14 | A(x) --> A(x) 15 | 16 | interpretation: 17 | 18 | 19 | endlsystem 20 | ###### INITIALISATION ###### 21 | 22 | __lpy_code_version__ = 1.1 23 | 24 | def __initialiseContext__(context): 25 | context.options.setSelection('Early return when no matching',0) 26 | -------------------------------------------------------------------------------- /test/lpytest/test_lstring_change3.lpy: -------------------------------------------------------------------------------- 1 | from openalea.lpy.__lpyfuture__ import * 2 | 3 | iterbackup = 1 4 | 5 | 6 | def End(lstring): 7 | print('End', len(lstring), lstring) 8 | assert len(lstring) == 1 9 | 10 | Axiom: A 11 | 12 | derivation length: 3 13 | production: 14 | 15 | A : 16 | if getIterationNb() == iterbackup : 17 | produce BA 18 | 19 | decomposition: 20 | 21 | B : 22 | DiscardNewString() 23 | produce B 24 | 25 | interpretation: 26 | 27 | 28 | endlsystem 29 | ###### INITIALISATION ###### 30 | 31 | __lpy_code_version__ = 1.1 32 | 33 | def __initialiseContext__(context): 34 | context.options.setSelection('Early return when no matching',0) 35 | -------------------------------------------------------------------------------- /test/lpytest/test_multiple_inleftcontext.lpy: -------------------------------------------------------------------------------- 1 | NBB = 10 2 | 3 | Axiom: 4 | nproduce C 5 | for i in range(NBB): 6 | nproduce B 7 | produce A 8 | 9 | derivation length: 1 10 | production: 11 | 12 | A : 13 | nbB = 0 14 | while InLeftContext(B): 15 | nbB += 1 16 | print('Found',nbB,'B') 17 | assert nbB == NBB 18 | produce C 19 | 20 | interpretation: 21 | 22 | 23 | endlsystem 24 | -------------------------------------------------------------------------------- /test/lpytest/test_multiscale_leftcontext.lpy: -------------------------------------------------------------------------------- 1 | nbMsLeftMatch = 0 2 | nbMsNewLeftMatch = 0 3 | 4 | def Start(): 5 | global nbMsLeftMatch,nbMsNewLeftMatch 6 | nbMsLeftMatch = 0 7 | nbMsNewLeftMatch = 0 8 | 9 | def End(): 10 | assert nbMsLeftMatch == 6 11 | assert nbMsNewLeftMatch == 6 12 | 13 | module U: scale = 1 14 | module I : scale = 2 15 | 16 | Axiom: U I I I U I I I 17 | 18 | derivation length: 1 19 | production: 20 | 21 | U < I: 22 | global nbMsLeftMatch 23 | nbMsLeftMatch += 1 24 | 25 | U << I: 26 | global nbMsNewLeftMatch 27 | nbMsNewLeftMatch += 1 28 | 29 | 30 | interpretation: 31 | 32 | 33 | endlsystem 34 | ###### INITIALISATION ###### 35 | 36 | __lpy_code_version__ = 1.1 37 | 38 | def __initialiseContext__(context): 39 | context.options.setSelection('String matching',3) 40 | -------------------------------------------------------------------------------- /test/lpytest/test_newleftcontext.lpy: -------------------------------------------------------------------------------- 1 | def EndEach(lstring): 2 | print(lstring) 3 | assert lstring == 'BSABSA' 4 | 5 | Axiom: B A B A 6 | 7 | derivation length: 1 8 | production: 9 | 10 | S << A --> A 11 | 12 | A --> SA 13 | 14 | interpretation: 15 | 16 | 17 | endlsystem 18 | -------------------------------------------------------------------------------- /test/lpytest/test_newrightcontext.lpy: -------------------------------------------------------------------------------- 1 | def EndEach(lstring): 2 | print(lstring) 3 | assert lstring == 'B A S B A S' 4 | 5 | Axiom: B A B A 6 | 7 | derivation length: 1 8 | production: 9 | 10 | A >> S --> A 11 | 12 | A --> AS 13 | 14 | interpretation: 15 | 16 | 17 | endlsystem 18 | -------------------------------------------------------------------------------- /test/lpytest/test_nullradius.lpy: -------------------------------------------------------------------------------- 1 | from openalea.plantgl.all import * 2 | def End(lstring,lscene): 3 | assert type(lscene[0].geometry) == Cone 4 | assert type(lscene[2].geometry.geometry.geometry) == Cone 5 | assert type(lscene[1].geometry) == Polyline 6 | 7 | Axiom: F(1,0);F(1);F(1,0.1) 8 | 9 | derivation length: 1 10 | production: 11 | 12 | 13 | interpretation: 14 | 15 | 16 | endlsystem 17 | -------------------------------------------------------------------------------- /test/lpytest/test_parametric_inleftcontext.lpy: -------------------------------------------------------------------------------- 1 | Axiom: A(2) B 2 | 3 | derivation length: 1 4 | production: 5 | 6 | B : 7 | args = {} 8 | if InLeftContext(A(x), args) : 9 | print(args['x']) 10 | 11 | 12 | 13 | 14 | interpretation: 15 | 16 | 17 | endlsystem 18 | -------------------------------------------------------------------------------- /test/lpytest/test_path_simple.lpy: -------------------------------------------------------------------------------- 1 | Axiom: ^(-90) Frame _(5) SetContour(section,True) StartGC() SetGuide(guide,10,False,True) A(10) 2 | 3 | derivation length: 10 4 | production: 5 | 6 | A(0) --> 7 | A(x) --> F(1)A(x-1) 8 | 9 | interpretation: 10 | 11 | 12 | endlsystem 13 | ###### INITIALISATION ###### 14 | 15 | def __initialiseContext__(context): 16 | from openalea.plantgl.all import QuantisedFunction,NurbsCurve2D,Point3Array,Vector3,RealArray 17 | curves = [('guide', NurbsCurve2D(Point3Array([Vector3(0.572361,-0.0289827,1),Vector3(-0.202523,0.282869,1),Vector3(0.187837,-0.197416,1),Vector3(-0.35292,-0.020702,1)]))), ('section', NurbsCurve2D(Point3Array([Vector3(-0.635458,-0.0697211,1),Vector3(-0.5,0.059761,1),Vector3(-0.166667,-0.199203,1),Vector3(0.0179283,0.13745,1),Vector3(0.166667,-0.167331,1),Vector3(0.5,0,1),Vector3(0.623506,-0.121514,1)])))] 18 | context["__curves__"] = curves 19 | for n,c in curves: 20 | context[n] = c 21 | -------------------------------------------------------------------------------- /test/lpytest/test_pglshape.lpy: -------------------------------------------------------------------------------- 1 | from openalea.plantgl.all import * 2 | b = Translated((0,2,0),Box(1,2,3)) 3 | Axiom: @g(b) 4 | 5 | derivation length: 1 6 | production: 7 | 8 | 9 | interpretation: 10 | 11 | 12 | endlsystem 13 | -------------------------------------------------------------------------------- /test/lpytest/test_pglshapes.lpy: -------------------------------------------------------------------------------- 1 | from openalea.plantgl.all import * 2 | sc = Scene([Sphere(),Translated((0,0,2),Box())]) 3 | Axiom: ff[-f F @g(Shape(Cone(),Material((255,0,0))))][+f @g(Material((0,255,0))) F @g(Cone()) ] [^(90) @g(Material((0,0,255))) F SetColor() F ] [ &(90) F ] f @g(sc) 4 | 5 | derivation length: 1 6 | production: 7 | 8 | 9 | interpretation: 10 | 11 | 12 | endlsystem 13 | -------------------------------------------------------------------------------- /test/lpytest/test_polygon.lpy: -------------------------------------------------------------------------------- 1 | from openalea.plantgl.all import * 2 | 3 | def get_primitive(obj): 4 | res = obj 5 | while hasattr(res,'geometry'): 6 | res = res.geometry 7 | return res 8 | 9 | def End(lstring,lscene): 10 | assert len(lscene) == 4 11 | assert isinstance(get_primitive(lscene[0]),Cylinder) 12 | assert isinstance(get_primitive(lscene[1]),Cylinder) 13 | assert isinstance(get_primitive(lscene[2]),Cylinder) 14 | 15 | assert isinstance(get_primitive(lscene[3]),Mesh) 16 | 17 | Axiom: {.f(1)[+(90)F][F][-(90)F] } 18 | 19 | derivation length: 1 20 | production: 21 | 22 | 23 | interpretation: 24 | 25 | 26 | endlsystem 27 | -------------------------------------------------------------------------------- /test/lpytest/test_pproduce.lpy: -------------------------------------------------------------------------------- 1 | def f(x): 2 | nproduce A(x) 3 | 4 | Axiom: B(1) 5 | derivation length: 2 6 | production: 7 | 8 | B : 9 | f(2) 10 | 11 | 12 | 13 | B(x) : 14 | try: 15 | nproduce ( 16 | C(3) 17 | A(1,x) 18 | B(2/0) 19 | ) 20 | except Exception as e: 21 | print (e) 22 | 23 | A(x): 24 | x /0 25 | 26 | endlsystem 27 | -------------------------------------------------------------------------------- /test/lpytest/test_profiler.lpy: -------------------------------------------------------------------------------- 1 | def toto(i): 2 | range(i) 3 | 4 | def test(i): 5 | toto(300*i) 6 | 7 | Axiom: AB 8 | 9 | derivation length: 1 10 | production: 11 | 12 | A: 13 | test(1) 14 | 15 | B: 16 | test(2) 17 | 18 | interpretation: 19 | 20 | 21 | endlsystem 22 | ###### INITIALISATION ###### 23 | 24 | def __initialiseContext__(context): 25 | context.animation_timestep = 0.05 26 | -------------------------------------------------------------------------------- /test/lpytest/test_pushpop.lpy: -------------------------------------------------------------------------------- 1 | 2 | def StartInterpretation(turtle): 3 | turtle.clear_parameters() 4 | print('SI',hasattr(turtle,'test'), len(turtle._pystack)) 5 | 6 | Axiom: [ A [ C D(False) ] D(True) ] D(False) A [ E D(False) ] D(True) 7 | 8 | derivation length: 1 9 | production: 10 | 11 | 12 | interpretation: 13 | 14 | A: 15 | turtle.add_parameter('test',True) 16 | 17 | C: 18 | turtle.remove_parameter('test') 19 | 20 | D(expected): 21 | print(hasattr(turtle,'test'), len(turtle._pystack)) 22 | assert hasattr(turtle,'test') == expected 23 | 24 | E: 25 | turtle.clear_parameters() 26 | 27 | endlsystem 28 | -------------------------------------------------------------------------------- /test/lpytest/test_recursiveinterpretation.lpy: -------------------------------------------------------------------------------- 1 | def EndEach(lstring, lscene): 2 | assert len(lscene) == 1 3 | 4 | Axiom: A 5 | 6 | derivation length: 1 7 | production: 8 | 9 | 10 | interpretation: 11 | maximum depth: 2 12 | 13 | A --> B 14 | B --> F 15 | 16 | endlsystem 17 | -------------------------------------------------------------------------------- /test/lpytest/test_repexp.lpy: -------------------------------------------------------------------------------- 1 | Axiom: I(0)I(1)A 2 | 3 | derivation length: 1 4 | production: 5 | 6 | x(I(t)) < A: 7 | assert t == [0,1] 8 | produce B 9 | 10 | interpretation: 11 | 12 | 13 | endlsystem 14 | -------------------------------------------------------------------------------- /test/lpytest/test_repr.lpy: -------------------------------------------------------------------------------- 1 | class A: 2 | def __init__(self): 3 | pass 4 | 5 | def EndEach(lstring): 6 | print(lstring) 7 | print(repr(lstring)) 8 | 9 | Axiom: B(A()) 10 | 11 | derivation length: 1 12 | production: 13 | 14 | B(a) --> B(a) 15 | 16 | homomorphism: 17 | 18 | 19 | endlsystem -------------------------------------------------------------------------------- /test/lpytest/test_scalar_category.lpy: -------------------------------------------------------------------------------- 1 | Axiom: 2 | 3 | derivation length: 1 4 | production: 5 | 6 | 7 | interpretation: 8 | 9 | 10 | endlsystem 11 | ###### INITIALISATION ###### 12 | 13 | __lpy_code_version__ = 1.1 14 | 15 | def __initialiseContext__(context): 16 | scalars = [('test', None), ('default_scalar', 42.85, 0.0, 99.99, 2), ('new category of balalala', None), ('default_bool', True), ('default_scalar', 19.64, 0.0, 99.99, 2), ('toto', None), ('default_scalar', 55.35, 0.0, 99.99, 2), ('default_bool', True)] 17 | context["__scalars__"] = scalars 18 | for s in scalars: 19 | if not s[1] is None : context[s[0]] = s[1] 20 | -------------------------------------------------------------------------------- /test/lpytest/test_scalars.lpy: -------------------------------------------------------------------------------- 1 | print(length) 2 | print(mybool) 3 | 4 | initial_view = 5 5 | 6 | Axiom: _(radius)A 7 | 8 | derivation length: length 9 | production: 10 | 11 | A --> FA 12 | 13 | interpretation: 14 | 15 | 16 | endlsystem 17 | ###### INITIALISATION ###### 18 | 19 | def __initialiseContext__(context): 20 | scalars = [('radius', 59, 0, 99), ('length', 29, 0, 99), ('mybool', False, False, True)] 21 | context["__scalars__"] = scalars 22 | for n,v,mnv,mxv in scalars: 23 | context[n] = v 24 | -------------------------------------------------------------------------------- /test/lpytest/test_shape_ids.lpy: -------------------------------------------------------------------------------- 1 | def End(lstring,lscene): 2 | lsceneids = list(lscene.todict().keys()) 3 | lsceneids.sort() 4 | assert len(lsceneids) == lstring.count('A') + lstring.count('B') + lstring.count('C') 5 | assert lsceneids == [2,5,7,10,12,15] 6 | 7 | Axiom: @Tp(0,0,1) [ A [ + B ] C [- B ] A [+ B ] ] 8 | 9 | derivation length: 1 10 | production: 11 | 12 | 13 | interpretation: 14 | maximum depth: 3 15 | A --> D 16 | D --> E 17 | E --> F @O(0.2) F 18 | B --> H 19 | H --> I 20 | I --> fFfF 21 | C --> J 22 | J --> K 23 | K --> f @O f @O 24 | 25 | 26 | 27 | endlsystem 28 | -------------------------------------------------------------------------------- /test/lpytest/test_startendinterpretation.lpy: -------------------------------------------------------------------------------- 1 | def StartInterpretation(): 2 | print('StartInterpretation') 3 | produce @O(0.2)+(90) 4 | 5 | 6 | def EndInterpretation(): 7 | produce @O(0.2) 8 | 9 | def End(lstring,lscene): 10 | assert len(lscene) == 3 11 | pass 12 | 13 | Axiom: F 14 | 15 | derivation length: 1 16 | production: 17 | 18 | 19 | interpretation: 20 | 21 | 22 | endlsystem 23 | -------------------------------------------------------------------------------- /test/lpytest/test_stop.lpy: -------------------------------------------------------------------------------- 1 | def EndEach(): 2 | assert getIterationNb() <= 101 3 | 4 | 5 | Axiom: A(0) 6 | 7 | derivation length: 500 8 | production: 9 | 10 | A(x) : 11 | if x > 100: 12 | Stop() 13 | else: 14 | produce BA(x+1) 15 | 16 | 17 | 18 | interpretation: 19 | 20 | B --> F(0.1) 21 | 22 | endlsystem 23 | -------------------------------------------------------------------------------- /test/lpytest/test_stringleftcontext.lpy: -------------------------------------------------------------------------------- 1 | Axiom: I(0)I(1)A 2 | 3 | derivation length: 1 4 | production: 5 | 6 | I(t) < A : 7 | print('ok',t) 8 | assert t == 1 9 | 10 | interpretation: 11 | 12 | 13 | endlsystem 14 | ###### INITIALISATION ###### 15 | 16 | __lpy_code_version__ = 1.1 17 | 18 | def __initialiseContext__(context): 19 | context.options.setSelection('String matching',0) 20 | -------------------------------------------------------------------------------- /test/lpytest/test_svnadd.lpy: -------------------------------------------------------------------------------- 1 | Axiom: 2 | 3 | derivation length: 1 4 | production: 5 | 6 | 7 | interpretation: 8 | 9 | 10 | endlsystem 11 | -------------------------------------------------------------------------------- /test/lpytest/test_unicode.lpy: -------------------------------------------------------------------------------- 1 | #coding: utf-8 2 | # test special character: é è § 3 | Axiom: A(u'é') é 4 | 5 | derivation length: 1 6 | production: 7 | 8 | é --> é 9 | 10 | interpretation: 11 | 12 | A(t) --> Label(t) 13 | 14 | endlsystem 15 | ###### INITIALISATION ###### 16 | 17 | __lpy_code_version__ = 1.1 18 | 19 | __description__ = 'test special character such as \xe9' 20 | -------------------------------------------------------------------------------- /test/lpytest/turtlewarning.lpy: -------------------------------------------------------------------------------- 1 | 2 | Axiom: A ?H(0) 3 | 4 | derivation length: 10 5 | production: 6 | 7 | ?H(v) --> ?H(v) 8 | 9 | interpretation: 10 | 11 | A --> SetColor(getIterationNb() % 7) 12 | 13 | endlsystem 14 | ###### INITIALISATION ###### 15 | 16 | __lpy_code_version__ = 1.1 17 | 18 | def __initialiseContext__(context): 19 | context.options.setSelection('Warning with Turtle inconsistency',0) 20 | -------------------------------------------------------------------------------- /test/p_h_enviro.lpy: -------------------------------------------------------------------------------- 1 | from random import uniform 2 | 3 | matched = False 4 | 5 | def End(): 6 | assert matched == True, "?P and ?H not matched" 7 | 8 | Axiom: I(10)?P?H?L 9 | 10 | derivation length: 1 11 | production: 12 | 13 | 14 | I(x) > ?P(p)?H(h)?L(l): 15 | global matched 16 | matched = True 17 | produce I(x) 18 | 19 | homomorphism: 20 | 21 | I(x) --> F(x) 22 | 23 | endlsystem -------------------------------------------------------------------------------- /test/plotredirection.py: -------------------------------------------------------------------------------- 1 | import openalea.lpy as lpy 2 | 3 | class PlotRedirection: 4 | def __init__(self): 5 | class Plotter: 6 | def __init__(self): pass 7 | def plot(self,scene): pass 8 | self.myplotter = Plotter() 9 | lpy.registerPlotter(self.myplotter) 10 | def __del__(self): 11 | lpy.cleanPlotter() 12 | -------------------------------------------------------------------------------- /test/test_axial_matching.lpy: -------------------------------------------------------------------------------- 1 | matched = False 2 | 3 | def Start(): 4 | global matched 5 | matched = False 6 | 7 | def EndEach(lstring): 8 | assert matched == True 9 | 10 | module A 11 | 12 | Axiom: A(1)[E]B(2)[C(3)[E][E]D(4)]D(5) 13 | 14 | derivation length: 1 15 | ignore: +- 16 | 17 | production: 18 | 19 | A(a) < B(b) > [C(c)]D(d) : 20 | global matched 21 | matched = True 22 | print('a =',a,',b =',b,',c =',c,',d =',d) 23 | assert d == 5 24 | produce B(b) 25 | 26 | endlsystem 27 | ###### INITIALISATION ###### 28 | 29 | def __initialiseContext__(context): 30 | context.options.setSelection('String matching',3) 31 | -------------------------------------------------------------------------------- /test/test_axial_msmatch.lpy: -------------------------------------------------------------------------------- 1 | matched = False 2 | 3 | def Start(): 4 | global matched 5 | matched = False 6 | 7 | def EndEach(lstring): 8 | assert matched == True 9 | 10 | module A : scale = 2 11 | module C, B,D : scale = 1 12 | 13 | 14 | Axiom: A(1)[A(2)C(0)]B(2)[A(3)C(0)[D(1)C(1)]]A(5)D(5) 15 | 16 | derivation length: 1 17 | ignore: +- 18 | 19 | production: 20 | 21 | 22 | A(a) < B(b) > [C(c)]D(d) : 23 | global matched 24 | matched = True 25 | print('a =',a,',b =',b,',c =',c,',d =',d) 26 | assert d == 5 27 | produce B(b) 28 | 29 | endlsystem 30 | ###### INITIALISATION ###### 31 | 32 | def __initialiseContext__(context): 33 | context.options.setSelection('String matching',3) 34 | -------------------------------------------------------------------------------- /test/test_dynrules.py: -------------------------------------------------------------------------------- 1 | from openalea.lpy import * 2 | 3 | code = """ 4 | def EndEach(lstring): 5 | print ('Lstring [',getIterationNb(),']: ',lstring) 6 | 7 | def End(lstring): 8 | assert len(lstring) == 1 and lstring[0] == 'C' 9 | 10 | Axiom: A 11 | 12 | derivation length: 2 13 | production: 14 | 15 | A : 16 | __lsystem__.addRule('''B --> C''') 17 | produce B 18 | 19 | endlsystem 20 | """ 21 | 22 | def test_dynrule(): 23 | ''' Test dynamicall addition of rule in the lsystem ''' 24 | l = Lsystem() 25 | l.set(code) 26 | #l.iterate() 27 | 28 | if __name__ == '__main__': 29 | test_dynrule() -------------------------------------------------------------------------------- /test/test_enviro.py: -------------------------------------------------------------------------------- 1 | from openalea.plantgl.all import * 2 | from openalea.lpy import * 3 | from testresources import get_filename 4 | 5 | def test_enviro(): 6 | """ Test whether environment module ?P works """ 7 | l = Lsystem(get_filename('p_h_enviro.lpy')) 8 | res = l.iterate() 9 | assert res[1][0] == Vector3(0,0,10) and "homomorphism not applied before ?P" -------------------------------------------------------------------------------- /test/test_extern.py: -------------------------------------------------------------------------------- 1 | from openalea.lpy import * 2 | 3 | code = """ 4 | extern(a=1) 5 | 6 | assert 'a' in globals() 7 | assert 'a' in __externs__ 8 | """ 9 | 10 | def test_extern_default(): 11 | l = Lsystem() 12 | l.setCode(code+'assert a == 1') 13 | 14 | def test_extern_externalset(): 15 | l = Lsystem() 16 | l.setCode(code+'assert a == 2',parameters={'a':2}) 17 | 18 | code2 = """ 19 | extern('b') 20 | 21 | assert 'b' in globals() 22 | assert 'b' in __externs__ 23 | assert b == 1 24 | """ 25 | 26 | def test_extern_external_check(): 27 | l = Lsystem() 28 | l.setCode(code2,parameters={'b':1}) 29 | -------------------------------------------------------------------------------- /test/test_fibonacci.py: -------------------------------------------------------------------------------- 1 | from openalea.lpy import * 2 | from testresources import get_filename 3 | 4 | 5 | def test_backward(): 6 | """ Computation of the fibonnacci series using fast transfer in backward direction """ 7 | l = Lsystem(get_filename('fibonacci.lpy')) 8 | a = l.iterate() 9 | print(a) 10 | assert a[2][0] == 6765, "Lpy failed to compute fibonacci test" 11 | assert a[3][0] == 4181, "Lpy failed to compute fibonacci test" 12 | assert a[21][0] == 1, "Lpy failed to compute fibonacci test" 13 | 14 | if __name__ == '__main__': 15 | test_backward() 16 | -------------------------------------------------------------------------------- /test/test_find.py: -------------------------------------------------------------------------------- 1 | from openalea.lpy import * 2 | 3 | def test_find(): 4 | l = LsysContext() 5 | l.makeCurrent() 6 | a = AxialTree('ABAABBACBABA') 7 | assert a.find('C') == 7 8 | -------------------------------------------------------------------------------- /test/test_fname.py: -------------------------------------------------------------------------------- 1 | from openalea.lpy import * 2 | 3 | def test_fname(): 4 | l = Lsystem() 5 | l.fname = 'toto.lpy' 6 | 7 | 8 | # l = Lsystem() 9 | # l = LsysContext() -------------------------------------------------------------------------------- /test/test_genscene.py: -------------------------------------------------------------------------------- 1 | from openalea.lpy import * 2 | from openalea.plantgl.all import * 3 | 4 | 5 | def sc2dict(s): 6 | d = {} 7 | for i in s: 8 | if i.id not in d: 9 | d[i.id] = [] 10 | d[i.id].append(i) 11 | return d 12 | 13 | 14 | lcode = """ 15 | Axiom:A 16 | production: 17 | A --> A[+A]A[-A] 18 | homomorphism: 19 | maximum depth:2 20 | A --> BCB 21 | B --> F 22 | C --> f@Of 23 | endlsystem 24 | """ 25 | 26 | 27 | def test_generateScene(): 28 | """ Test Lsystem generation of a scene using homomorphism """ 29 | l = Lsystem() 30 | l.set(lcode) 31 | a = l.iterate() 32 | sc = l.sceneInterpretation(a) 33 | assert len(sc) == 4*3 34 | d = sc2dict(sc) 35 | assert len(d) == 4 36 | 37 | if __name__ == '__main__': 38 | test_generateScene() 39 | -------------------------------------------------------------------------------- /test/test_group.py: -------------------------------------------------------------------------------- 1 | from openalea.lpy import * 2 | from testresources import get_filename 3 | 4 | 5 | def test_group(): 6 | """ Test group of rules """ 7 | l = Lsystem(get_filename('test_group.lpy')) 8 | l.iterate() 9 | 10 | if __name__ == '__main__': 11 | test_group() -------------------------------------------------------------------------------- /test/test_homrule.py: -------------------------------------------------------------------------------- 1 | from openalea.lpy import * 2 | from openalea.plantgl.all import Scene 3 | 4 | def test_addHomRule(): 5 | """ Regression around 010708 """ 6 | s="PANNN[+ANNN][-ANNN]AN" 7 | l = Lsystem() 8 | tree = AxialTree(s) 9 | l.addInterpretationRule('N --> F', 0) 10 | geom_tree = l.interpret(tree) 11 | scene = l.sceneInterpretation(geom_tree) 12 | assert len(scene) == 10, "len(scene) == %d instead of 10"%len(scene) 13 | undeclare('P,A,N') 14 | assert len(LsysContext.currentContext().declaredModules()) == 0 15 | 16 | if __name__ == '__main__': 17 | test_addHomRule() 18 | 19 | -------------------------------------------------------------------------------- /test/test_interpret.py: -------------------------------------------------------------------------------- 1 | from openalea.lpy import * 2 | 3 | code = """ 4 | Axiom: A(0) 5 | production: 6 | interpretation: 7 | A(x): produce F(x)@0(2*x) 8 | """ 9 | def test_interpret(): 10 | l = Lsystem() 11 | l.setCode(code) 12 | ls = l.interpret(l.axiom) -------------------------------------------------------------------------------- /test/test_kwd.py: -------------------------------------------------------------------------------- 1 | from openalea.lpy import * 2 | from testresources import get_filename 3 | 4 | def test_kwd(): 5 | ''' test matching with **kwd ''' 6 | for optionvalue in [1,2]: 7 | l = Lsystem(get_filename('test_kwd.lpy')) 8 | l.context().options.setSelection('Module matching',optionvalue) 9 | l.iterate() 10 | 11 | def test_kwd2(): 12 | ''' test matching with **kwd ''' 13 | for optionvalue in [1,2]: 14 | l = Lsystem(get_filename('test_kwd2.lpy')) 15 | l.context().options.setSelection('Module matching',optionvalue) 16 | l.iterate() 17 | -------------------------------------------------------------------------------- /test/test_lsystem_as_module.py: -------------------------------------------------------------------------------- 1 | from openalea.lpy import * 2 | 3 | 4 | def test_lsystem_as_module(): 5 | lc = LsysContext() 6 | lc.makeCurrent() 7 | l = Lsystem() 8 | l.set(""" 9 | test1 = 1 10 | Axiom:A 11 | production: 12 | A --> BA 13 | """ 14 | ) 15 | assert l.test1 == 1 16 | l.test1 = 2 17 | assert l.test1 == 2 18 | assert l.context()['test1'] == 2 19 | print(('Axiom:',l.axiom)) 20 | l.axiom = 'B' 21 | print((l.axiom, type(l.axiom))) 22 | assert type(l.axiom) == AxialTree and l.axiom == Lstring('B') 23 | 24 | if __name__ == '__main__': 25 | test_lsystem_as_module() 26 | -------------------------------------------------------------------------------- /test/test_lsystemiterator.py: -------------------------------------------------------------------------------- 1 | from openalea.lpy import * 2 | 3 | 4 | def test_iterator(): 5 | l = Lsystem() 6 | l.set(""" 7 | Axiom:A 8 | derivation length: 4 9 | production: 10 | A --> BA 11 | """ 12 | ) 13 | for lstring in l: 14 | print(lstring) 15 | 16 | 17 | if __name__ == '__main__': 18 | test_iterator() 19 | -------------------------------------------------------------------------------- /test/test_matching_future.lpy: -------------------------------------------------------------------------------- 1 | 2 | matched = False 3 | 4 | def End(): 5 | assert matched 6 | 7 | Axiom: A[I[E]H]HB[C[E]D]D 8 | 9 | derivation length: 1 10 | ignore: +- 11 | 12 | production: 13 | 14 | A[I]H < B : 15 | global matched 16 | matched = True 17 | produce B 18 | 19 | endlsystem 20 | -------------------------------------------------------------------------------- /test/test_msmatch.lpy: -------------------------------------------------------------------------------- 1 | module A,C : scale = 2 2 | module T,B : scale = 1 3 | 4 | Axiom: TA(1)[BA(4)]A(2)[BA(3)C] 5 | 6 | matched = False 7 | 8 | def Start(): 9 | global matched 10 | matched = False 11 | 12 | def EndEach(lstring): 13 | print (lstring) 14 | assert matched == True 15 | 16 | derivation length: 1 17 | production: 18 | 19 | TA(x)B < C: 20 | global matched 21 | matched = True 22 | print (x) 23 | produce C 24 | 25 | homomorphism: 26 | 27 | 28 | endlsystem 29 | ###### INITIALISATION ###### 30 | 31 | def __initialiseContext__(context): 32 | context.options.setSelection('String matching',3) 33 | -------------------------------------------------------------------------------- /test/test_multiline_produce.lpy: -------------------------------------------------------------------------------- 1 | def End(lstring): 2 | assert len(lstring) == 3 3 | for i in range(3): 4 | n = lstring[i].name 5 | assert n != '\n' 6 | assert n != '\r' 7 | assert n != '\t' 8 | assert n != ' ' 9 | 10 | module CA 11 | 12 | Axiom: A 13 | 14 | derivation length: 1 15 | production: 16 | 17 | A : 18 | produce (B 19 | CA #test 20 | D 21 | ) 22 | test = 3 23 | 24 | interpretation: 25 | 26 | D --> F 27 | 28 | endlsystem 29 | -------------------------------------------------------------------------------- /test/test_multiline_produce.py: -------------------------------------------------------------------------------- 1 | from openalea.lpy import * 2 | from testresources import get_filename 3 | 4 | def test_multi_line(): 5 | l = Lsystem(get_filename('test_multiline_produce.lpy')) 6 | l.iterate() -------------------------------------------------------------------------------- /test/test_nproduce.lpy: -------------------------------------------------------------------------------- 1 | def nprod(): 2 | nproduce D 3 | 4 | matched = False 5 | 6 | def StartEach(): 7 | global matched 8 | matched = False 9 | 10 | def EndEach(): 11 | assert matched == True, 'No matching found' 12 | 13 | 14 | Axiom: A 15 | 16 | derivation length: 4 17 | production: 18 | 19 | A : 20 | global matched 21 | nproduce I 22 | matched = True 23 | produce B 24 | 25 | B: 26 | global matched 27 | nproduce C 28 | matched = True 29 | 30 | C: 31 | global matched 32 | nprod() 33 | matched = True 34 | 35 | D: 36 | global matched 37 | matched = True 38 | produce 39 | 40 | I --> 41 | endlsystem -------------------------------------------------------------------------------- /test/test_nproduce.py: -------------------------------------------------------------------------------- 1 | from openalea.lpy import * 2 | from testresources import get_filename 3 | 4 | def test_nproduce(verbose = False): 5 | """ Test use of nproduce """ 6 | l=Lsystem(get_filename('test_nproduce.lpy')) 7 | if verbose: print((l.axiom)) 8 | res = l.derive(1) 9 | if verbose: print(res) 10 | assert len(res) == 2 and res[1].name == 'B' 11 | res = l.derive(res,1,1) 12 | if verbose: print(res) 13 | assert len(res) == 1 and res[0].name == 'C' 14 | res = l.derive(res,2,1) 15 | if verbose: print(res) 16 | assert len(res) == 1 and res[0].name == 'D' 17 | res = l.derive(res,3,1) 18 | if verbose: print(res) 19 | assert len(res) == 0 20 | 21 | if __name__ == '__main__': 22 | import sys 23 | if '-v' in sys.argv or '--verbose' in sys.argv : 24 | verbose = True 25 | else: 26 | verbose = False 27 | test_nproduce(verbose) -------------------------------------------------------------------------------- /test/test_perf.lpy: -------------------------------------------------------------------------------- 1 | Axiom: A 2 | 3 | from time import clock 4 | timer = 0 5 | 6 | def Start(): 7 | global timer 8 | timer = clock() 9 | 10 | def End(): 11 | print('time=',clock()-timer) 12 | 13 | 14 | derivation length: 100 15 | production: 16 | 17 | A : 18 | for i in range(1000): 19 | nproduce BC(0)C(0)C(0)C(0)C(0)C(0)C(0)C(0)C(0)C(0)C(0)C(0)C(0)C(0)C(0)C(0)C(0)C(0)C(0)C(0) 20 | 21 | C(x) --> C(0) 22 | 23 | D(y) : produce D(0) 24 | 25 | homomorphism: 26 | 27 | 28 | endlsystem 29 | ###### INITIALISATION ###### 30 | 31 | def __initialiseContext__(context): 32 | context.options.setSelection('Optimization',2) 33 | -------------------------------------------------------------------------------- /test/test_pickle.py: -------------------------------------------------------------------------------- 1 | from openalea.lpy import * 2 | import pickle 3 | 4 | def test_pickle_lsystem(): 5 | l = Lsystem(r'../share/tutorial/04 - simple-plant-archi/02 - random-tree.lpy') 6 | ls = l.derive(10) 7 | buffer = pickle.dumps(l) 8 | print(buffer) 9 | nl = pickle.loads(buffer) 10 | assert l.derive(ls,1) == nl.derive(ls,1) 11 | 12 | def test_pickle_lstring(): 13 | l = Lsystem(r'../share/tutorial/04 - simple-plant-archi/02 - random-tree.lpy') 14 | ls = l.derive(10) 15 | buffer = pickle.dumps(ls) 16 | print(buffer) 17 | nls = pickle.loads(buffer) 18 | assert str(ls) == str(nls) 19 | 20 | if __name__ == '__main__': 21 | test_pickle_lstring() -------------------------------------------------------------------------------- /test/test_recursicecall.py: -------------------------------------------------------------------------------- 1 | from openalea.lpy import * 2 | 3 | code = """ 4 | l = None 5 | started = False 6 | 7 | def Start(): 8 | global started 9 | started = True 10 | assert not l is None 11 | assert l.isRunning() 12 | canIterate = False 13 | try: 14 | l.iterate() 15 | canIterate = True 16 | except: 17 | pass 18 | assert canIterate == False and 'Can call recursivelly iterate on the same Lsystem' 19 | 20 | Axiom:A 21 | production: 22 | A --> A 23 | endlsystem 24 | """ 25 | 26 | def test_recursecall(): 27 | """ Test blocking of Lsystem when recursivelly called (multithread support).""" 28 | l = Lsystem() 29 | l.set(code) 30 | l.context()['l'] = l 31 | l.iterate() 32 | assert l.context()['started'] == True 33 | l.clear() 34 | 35 | if __name__ == '__main__': 36 | test_recursecall() -------------------------------------------------------------------------------- /test/test_selection.lpy: -------------------------------------------------------------------------------- 1 | def Start(): 2 | setSelectionAlwaysRequired(True) 3 | pass 4 | 5 | Axiom: N [ + N N ] [ - N ] N 6 | 7 | derivation length: 3 8 | production: 9 | 10 | X --> % 11 | 12 | homomorphism: 13 | maximum depth: 2 14 | 15 | N --> ABA 16 | A --> fFf 17 | B --> @O 18 | 19 | endlsystem 20 | -------------------------------------------------------------------------------- /test/test_shareexamples.py: -------------------------------------------------------------------------------- 1 | from openalea.lpy import * 2 | import os, glob 3 | 4 | def get_share_examples(): 5 | d = os.path.os.path.dirname(__file__) 6 | sharepath = os.path.join(d,os.path.pardir,'share','examples') 7 | 8 | lpyfiles = glob.glob(os.path.join(sharepath,'*.lpy')) 9 | return lpyfiles 10 | 11 | def exec_share_example(lfile): 12 | try: 13 | l = Lsystem(lfile) 14 | l.iterate() 15 | except Exception as e : 16 | print('Example file :',lfile) 17 | raise e 18 | 19 | 20 | def test_share_examples(): 21 | """ Test all lpy examples from share/ repository """ 22 | for lfile in get_share_examples(): 23 | yield exec_share_example, lfile 24 | 25 | if __name__ == '__main__': 26 | for e,f in test_share_examples(): 27 | e(f) -------------------------------------------------------------------------------- /test/test_simple_lsystem.py: -------------------------------------------------------------------------------- 1 | from openalea.lpy import * 2 | 3 | def test_axiom(): 4 | l = Lsystem() 5 | l.setCode(''' 6 | module AA 7 | Axiom: AA 8 | ''') 9 | print('Axiom:',l.axiom) 10 | assert (len(l.axiom) == 1) 11 | 12 | 13 | if __name__ == '__main__': 14 | test_axiom() 15 | -------------------------------------------------------------------------------- /test/test_simple_matching.lpy: -------------------------------------------------------------------------------- 1 | matched = None 2 | 3 | def StartEach(): 4 | global matched 5 | matched = None 6 | 7 | 8 | def EndEach(): 9 | print (getIterationNb(),matched) 10 | assert not matched is None 11 | if getIterationNb() == 5: 12 | assert matched == 1 13 | else: 14 | assert matched == 2 15 | 16 | Axiom: I(5) 17 | 18 | derivation length: 6 19 | production: 20 | 21 | I(0) : 22 | global matched 23 | matched = 1 24 | produce * 25 | 26 | I(x): 27 | global matched 28 | matched = 2 29 | produce I(x-1) 30 | 31 | endlsystem 32 | -------------------------------------------------------------------------------- /test/test_stringmatching.py: -------------------------------------------------------------------------------- 1 | from openalea.lpy import * 2 | 3 | def test_stringmatching(): 4 | """ Test StringMatching structure """ 5 | a = StringMatching() 6 | a.addIdentity(2) 7 | a.addIdentity(3) 8 | a.append(1,5) 9 | a.addIdentity(1) 10 | a.append(1,2) 11 | b = a.begin() 12 | for i in range(15): 13 | b.nextValues() 14 | assert tuple(b.values()) == (10,15) -------------------------------------------------------------------------------- /test/testresources.py: -------------------------------------------------------------------------------- 1 | def get_filename(fname, pymodname = __file__): 2 | import os 3 | return os.path.join(os.path.dirname(pymodname), fname) 4 | -------------------------------------------------------------------------------- /test/tofix/test_all_multiscalematch.lpy: -------------------------------------------------------------------------------- 1 | ok = 0 2 | 3 | def StartEach(): 4 | global ok 5 | ok = 0 6 | 7 | def EndEach(): 8 | print ok 9 | assert ok == 2 10 | 11 | module D : scale = 1 12 | module I : scale = 1 13 | 14 | Axiom: D I I D I I I 15 | 16 | derivation length: 1 17 | production: 18 | 19 | 20 | D > x(I,1) : 21 | global ok 22 | ok += 1 23 | 24 | interpretation: 25 | 26 | 27 | endlsystem 28 | ###### INITIALISATION ###### 29 | 30 | __lpy_code_version__ = 1.1 31 | 32 | def __initialiseContext__(context): 33 | context.options.setSelection('String matching',3) 34 | -------------------------------------------------------------------------------- /test/tofix/test_derivationlengthinc.lpy: -------------------------------------------------------------------------------- 1 | def End(): 2 | assert getIterationNb() == 9 3 | 4 | Axiom: A(0) 5 | 6 | derivation length: 5 7 | production: 8 | 9 | A(x): 10 | if x == 3: 11 | __lsystem__.derivationLength = 10 12 | 13 | interpretation: 14 | 15 | 16 | endlsystem 17 | -------------------------------------------------------------------------------- /test/tofix/test_inc1.lpy: -------------------------------------------------------------------------------- 1 | def EndEach(lstring): 2 | print lstring 3 | 4 | Axiom: A 5 | 6 | derivation length: 5 7 | production: 8 | 9 | A : 10 | print 'applied' 11 | produce B 12 | 13 | interpretation: 14 | 15 | 16 | endlsystem 17 | -------------------------------------------------------------------------------- /test/tofix/test_multiscale_rightcontext.lpy: -------------------------------------------------------------------------------- 1 | nbMsRightMatch = 0 2 | nbMsNewRightMatch = 0 3 | 4 | def Start(): 5 | global nbMsLeftMatch,nbMsNewRightMatch 6 | backward() 7 | nbMsRightMatch = 0 8 | nbMsNewRightMatch = 0 9 | 10 | def End(): 11 | assert nbMsRightMatch == 6 12 | assert nbMsNewRightMatch == 6 13 | 14 | module U: scale = 1 15 | module I : scale = 2 16 | 17 | Axiom: U I I I U I I I U 18 | 19 | derivation length: 1 20 | production: 21 | 22 | I > U: 23 | global nbMsRightMatch 24 | nbMsRightMatch += 1 25 | 26 | I >> U: 27 | global nbMsNewRightMatch 28 | nbMsNewRightMatch += 1 29 | 30 | 31 | interpretation: 32 | 33 | 34 | endlsystem 35 | ###### INITIALISATION ###### 36 | 37 | __lpy_code_version__ = 1.1 38 | 39 | def __initialiseContext__(context): 40 | context.options.setSelection('String matching',3) 41 | -------------------------------------------------------------------------------- /test/ui/test2D.lpy: -------------------------------------------------------------------------------- 1 | Axiom: @2D @M(X-1,Y-1) -(90) F(0.9) +(90) F(0.5) +(60) F(2) 2 | 3 | derivation length: 1 4 | production: 5 | 6 | 7 | interpretation: 8 | 9 | 10 | endlsystem 11 | ###### INITIALISATION ###### 12 | 13 | __lpy_code_version__ = 1.1 14 | 15 | def __initialiseContext__(context): 16 | scalars = [('X', 'Float', 0.0, 0.0, 2.0, 2), ('Y', 'Float', 0.0, 0.0, 2.0, 2)] 17 | context["__scalars__"] = scalars 18 | for s in scalars: 19 | if not s[1] is None : context[s[0]] = s[1] 20 | -------------------------------------------------------------------------------- /test/ui/test2Dcurve.lpy: -------------------------------------------------------------------------------- 1 | mycurve.width = 5 2 | Axiom: @2D @g(mycurve,1.5) 3 | 4 | derivation length: 1 5 | production: 6 | 7 | 8 | interpretation: 9 | 10 | 11 | endlsystem 12 | ###### INITIALISATION ###### 13 | 14 | __lpy_code_version__ = 1.1 15 | 16 | def __initialiseContext__(context): 17 | panel_0 = ({'active': True, 'visible': False, 'name': 'Panel 1'},[]) 18 | import openalea.plantgl.all as pgl 19 | mycurve = pgl.NurbsCurve2D( 20 | ctrlPointList = pgl.Point3Array([(-0.5, 0, 1),(-0.321212, 0.4, 1),(-0.00606059, -0.240909, 1),(0.5, 0.177273, 1)]) , 21 | ) 22 | mycurve.name = "mycurve" 23 | panel_1 = ({'active': True, 'visible': True, 'name': 'Panel 2'},[('Curve2D',mycurve)]) 24 | parameterset = [panel_0,panel_1,] 25 | context["__functions__"] = [] 26 | context["__curves__"] = [('mycurve',mycurve),] 27 | context["__parameterset__"] = parameterset 28 | context["mycurve"] = mycurve 29 | -------------------------------------------------------------------------------- /test/ui/test2Dtext.lpy: -------------------------------------------------------------------------------- 1 | Axiom: @2D @M(0,0,0) Label('test') 2 | 3 | derivation length: 1 4 | production: 5 | 6 | 7 | interpretation: 8 | 9 | 10 | endlsystem 11 | -------------------------------------------------------------------------------- /test/ui/test_interaction.lpy: -------------------------------------------------------------------------------- 1 | def EndEach(): 2 | if getIterationNb() == 2: 3 | requestSelection('Please select a branch to cut') 4 | 5 | Axiom: A 6 | 7 | derivation length:5 8 | production: 9 | 10 | A --> F[-A]FA 11 | X --> ,(3)@O(0.2) % 12 | 13 | interpretation: 14 | 15 | A --> ,(2)@O 16 | 17 | endlsystem 18 | ###### INITIALISATION ###### 19 | 20 | __lpy_code_version__ = 1.1 21 | 22 | __description__ = 'Test of interaction' 23 | -------------------------------------------------------------------------------- /test/ui/test_interpolatecolors.lpy: -------------------------------------------------------------------------------- 1 | from openalea.plantgl.all import * 2 | 3 | dt = 0.05 4 | 5 | Axiom: [ I(2,3) ] [ @M(0,2,0) I(2,5) ] [ @M(0,4,0) I(3,5) ] 6 | 7 | derivation length: 1 8 | production: 9 | 10 | I(c1,c2): 11 | for t in xrange(int(1/dt)): 12 | nproduce InterpolateColors(c1,c2,t*dt) @g(Box(0.5))f(1) 13 | 14 | 15 | endlsystem 16 | -------------------------------------------------------------------------------- /test/ui/test_interpolatetexturebasecolors.lpy: -------------------------------------------------------------------------------- 1 | Axiom: InterpolateTextureBaseColors(5,6,0.0) ,(20) @b(1) 2 | 3 | nbsteps = 10 4 | 5 | dt = 1./nbsteps 6 | 7 | derivation length: nbsteps 8 | production: 9 | 10 | InterpolateTextureBaseColors(a,b,t) --> InterpolateTextureBaseColors(a,b,t+dt) 11 | interpretation: 12 | 13 | 14 | endlsystem 15 | ###### INITIALISATION ###### 16 | 17 | __lpy_code_version__ = 1.1 18 | 19 | def __initialiseContext__(context): 20 | import openalea.plantgl.all as pgl 21 | PGL_140591750434928 = pgl.ImageTexture("PGL_140591750434928" , "/Users/fboudon/Develop/vplants/branches/mangosim/share/textures/leaf.png" , ) 22 | PGL_140591750434928.name = "PGL_140591750434928" 23 | Color_20 = pgl.Texture2D(image = PGL_140591750434928 , ) 24 | Color_20.name = "Color_20" 25 | context.turtle.setMaterial(20,Color_20) 26 | -------------------------------------------------------------------------------- /test/ui/test_killtask.lpy: -------------------------------------------------------------------------------- 1 | 2 | 3 | Axiom: A 4 | 5 | derivation length: 2 6 | production: 7 | 8 | A: 9 | print 'count' 10 | a = 0 11 | for i in xrange(50000000): 12 | a+=1 13 | print a 14 | produce A 15 | 16 | interpretation: 17 | 18 | 19 | endlsystem 20 | -------------------------------------------------------------------------------- /test/ui/test_quad.lpy: -------------------------------------------------------------------------------- 1 | Axiom: Quad + Quad Quad(1,0) Quad Quad(1,0.1) 2 | 3 | derivation length: 1 4 | production: 5 | 6 | 7 | interpretation: 8 | 9 | 10 | endlsystem 11 | -------------------------------------------------------------------------------- /test/ui/test_rollToHorizontal.lpy: -------------------------------------------------------------------------------- 1 | Axiom: &(130) /(60) @h Frame 2 | 3 | derivation length: 1 4 | production: 5 | 6 | 7 | interpretation: 8 | 9 | 10 | endlsystem 11 | -------------------------------------------------------------------------------- /test/ui/test_textureOnF.lpy: -------------------------------------------------------------------------------- 1 | Axiom: _(0.5) ,(5) SectionResolution(60) TextureCoeff(USCALE/100.,VSCALE/100.) TextureRotation(ROTATION,0.5,0.5) TextureTranslation(UTRANSLATION/100.,VTRANSLATION/100.) F(2) 2 | 3 | derivation length: 1 4 | production: 5 | 6 | 7 | interpretation: 8 | 9 | 10 | endlsystem 11 | ###### INITIALISATION ###### 12 | 13 | __lpy_code_version__ = 1.1 14 | 15 | def __initialiseContext__(context): 16 | from openalea.plantgl.scenegraph import Material, Texture2D, ImageTexture,Color3 17 | context.turtle.setMaterial(5,Texture2D(name='APPID_1_64251048',image=ImageTexture(filename='''../src/openalea/lpy/gui/biglogo.png'''),)) 18 | scalars = [('USCALE', 90, 1, 100), ('VSCALE', 30, 1, 100), ('ROTATION', 359, 0, 359), ('UTRANSLATION', 0, 0, 100), ('VTRANSLATION', 0, 0, 100)] 19 | context["__scalars__"] = scalars 20 | for n,v,mnv,mxv in scalars: 21 | context[n] = v 22 | -------------------------------------------------------------------------------- /test/ui/test_ui_error.lpy: -------------------------------------------------------------------------------- 1 | Axiom: A 2 | 3 | derivation length: 1 4 | production: 5 | 6 | A : 7 | 1/0 8 | produce B 9 | 10 | homomorphism: 11 | 12 | 13 | endlsystem 14 | -------------------------------------------------------------------------------- /test/ui/test_ui_matplotlib.lpy: -------------------------------------------------------------------------------- 1 | from matplotlib.pyplot import * 2 | from random import * 3 | 4 | plot(range(100),[uniform(0,10) for i in xrange(100)]) 5 | show() 6 | 7 | Axiom: A 8 | 9 | derivation length: 1 10 | production: 11 | 12 | 13 | interpretation: 14 | 15 | 16 | endlsystem 17 | -------------------------------------------------------------------------------- /test/ui/testbox.lpy: -------------------------------------------------------------------------------- 1 | Axiom: Box + Box Box(1,0) Box Box(1,0.1) 2 | 3 | derivation length: 1 4 | production: 5 | 6 | 7 | interpretation: 8 | 9 | 10 | endlsystem 11 | -------------------------------------------------------------------------------- /test/ui/testobj.mtl: -------------------------------------------------------------------------------- 1 | newmtl APPID_2_140592763701232 2 | Ka 0.0 0.0 0.705882352941 3 | Kd 0.0 0.0 0.705882352941 4 | Ks 0.0 0.0 0.705882352941 5 | Tr 0.0 6 | \map_Ka "/Users/fboudon/Develop/vplants/branches/mangosim/share/textures/leaf.png" 7 | illum 2 8 | -------------------------------------------------------------------------------- /tmp/axiom.txt: -------------------------------------------------------------------------------- 1 | A(3)F(5)[+A(3)]F(3)[-A(2)] 2 | -------------------------------------------------------------------------------- /tmp/myscene.ply: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openalea/lpy/9433221ab5fda7d0c7214f14f7f978298293f84b/tmp/myscene.ply -------------------------------------------------------------------------------- /tmp/readaxiom.lpy: -------------------------------------------------------------------------------- 1 | Axiom: 2 | ls = Lstring(file('axiom.txt').read()) 3 | nsproduce(ls) 4 | 5 | production: 6 | 7 | interpretation: 8 | A(x) --> @O 9 | -------------------------------------------------------------------------------- /tmp/test-shell.lpy: -------------------------------------------------------------------------------- 1 | 2 | def f(x): 3 | return x+1 4 | 5 | 6 | Axiom: 7 | 8 | derivation length: 1 9 | production: 10 | 11 | 12 | interpretation: 13 | 14 | 15 | endlsystem 16 | -------------------------------------------------------------------------------- /tmp/test.lpy: -------------------------------------------------------------------------------- 1 | depth = 4 2 | Axiom: 3 | nproduce I(depth) [B(depth)] [B(depth)] I(depth) 4 | 5 | derivation length: 1 6 | production: 7 | decomposition: 8 | maximum depth:depth+1 9 | B(x) : 10 | nproduce I(x) 11 | if x > 0 : produce [B(x-1)] [B(x-1)] 12 | 13 | production: 14 | 15 | I(v) > x([I(p)]) or(I(a),None): 16 | print '+',v, p,a 17 | 18 | I(v) : 19 | p,a = [], None 20 | params = {} 21 | while InRightContext([I(p)], params): 22 | p.append(params['p']) 23 | if InRightContext(I(a), params): 24 | a = params['a'] 25 | print '>',v, p,a 26 | 27 | 28 | 29 | interpretation: 30 | 31 | 32 | endlsystem 33 | ###### INITIALISATION ###### 34 | 35 | __lpy_code_version__ = 1.1 36 | 37 | def __initialiseContext__(context): 38 | context.options.setSelection('Axiom decomposition',1) 39 | -------------------------------------------------------------------------------- /tmp/testvisu.lpy: -------------------------------------------------------------------------------- 1 | interpretations = Lsystem('visu.lpy') 2 | def EndEach(lstring): 3 | return lstring, interpretations.sceneInterpretation(lstring) 4 | 5 | 6 | Axiom: L 7 | 8 | derivation length: 1 9 | production: 10 | 11 | 12 | interpretation: 13 | 14 | 15 | endlsystem 16 | ###### INITIALISATION ###### 17 | 18 | __lpy_code_version__ = 1.1 19 | 20 | def __initialiseContext__(context): 21 | import openalea.plantgl.all as pgl 22 | Color_7 = pgl.Material("Color_7" , ambient = (87,13,19) , diffuse = 1.83908 , ) 23 | Color_7.name = "Color_7" 24 | context.turtle.setMaterial(7,Color_7) 25 | -------------------------------------------------------------------------------- /tmp/trianglemix.lpy: -------------------------------------------------------------------------------- 1 | from pylab import * 2 | from time import time --------------------------------------------------------------------------------