Trying to export lpy model into MTG or XYZ coordinates

Hello,
I would like to export my Lpy model into some format in which my arhitecture can be understood by other people not familiar with LPy I don’t know if the best format is MTG or if there is a way to extract the spatial coordinates of my architecture.
I was aproaching the problem using the YOUTUBE lessons from prof @godin ( MC 15 LPy Application Programming Interface and LPy Tools library) and I discovered the LPy tools ( Point_sampler documentation — lpy_tools 0.1.0 documentation (inria.fr).

However I really can’t manage to install lpy_tools
I tired with:
1)

conda install lpy_tools -c mosaic -c fredboudon -c conda-forge 

as suggested here: MOSAIC / lpy_tools · GitLab (inria.fr)

conda install -c mosaic lpy_tools

as suggested here: Lpy Tools :: Anaconda.org

I don’t know what I can do.
can somebody help me?

Thanks so much
Francesca

1 Like

Hi Francesca,
Nice to read you.
With Fred(@fredboudon ), we have developed a full mapping between lpy and MTG in both directions (LPy to MTG and MTG 2 LPy). You can read the doc here : 9. Lsystem and MTGs — openalea.mtg 2.1.2 documentation
And there are several examples in the test repository (github.com/openalea/mtg/test)

from openalea.lpy import *
from openalea.mtg.io import lpy2mtg, mtg2lpy, axialtree2mtg, mtg2axialtree

exported_symbols = ['A', 'B', 'C']

def export_to_mtg(lstring):
  parameters = {}
  scales = {}
  for m in exported_symbols:
    mod = ModuleClass.get(m)
    scales[m] = mod.scale
    parameters[m] = mod.parameterNames
  return axialtree2mtg(lstring,scales,None,parameters)

To install lpy and mtg from openalea

conda install openalea.lpy openalea.mtg -c openalea3 -c conda-forge
2 Likes

Hi Francesca,

You can export your l-scenes as standard obj file just by saving it using a .dot extension:

scene.save(f’out/my_plant.obj’)

Best
Ch.

| Francesca
November 14 |

  • | - |

Hello,
I would like to export my Lpy model into some format in which my arhitecture can be understood by other people not familiar with LPy I don’t know if the best format is MTG or if there is a way to extract the spatial coordinates of my architecture.
I was aproaching the problem using the YOUTUBE lessons from prof @godin ( MC 15 LPy Application Programming Interface and LPy Tools library) and I discovered the LPy tools ( Point_sampler documentation — lpy_tools 0.1.0 documentation (inria.fr).

However I really can’t manage to install lpy_tools
I tired with:
1)

conda install lpy_tools -c mosaic -c fredboudon -c conda-forge 

as suggested here: MOSAIC / lpy_tools · GitLab (inria.fr)

conda install -c mosaic lpy_tools

as suggested here: Lpy Tools :: Anaconda.org

I don’t know what I can do.
can somebody help me?

Thanks so much
Francesca


Visit Topic or reply to this email to respond.

To unsubscribe from these emails, click here.

Christophe Godin

Inria team MOSAIC (Mosaic – Mathematical Modeling of Developmental Biology)
UMR RDP (Reproduction et Développement des Plantes),
Univ Lyon, ENS de Lyon, UCB Lyon 1, CNRS, INRA, Inria
Ecole Normale Supérieure de Lyon
46 allée d’Italie
69364 Lyon Cedex 07, France

tel: +33 4 72 72 88 26
assist: + 33 4 72 72 80 37
email : christophe.godin@inria.fr

RDP: Laboratoire Reproduction et DÉveloppement des Plantes - Vive les plantes !

2 Likes

Thanks so much @godin I succeded in export it as .obj.
However I did not succed in export the mtg file @pradal the “ModuleClass.get(m)” output “none” and the rest of the code is aborted

anyway I hope that .obj file it’s ok for my purposes. thanks so much everyone

cheers,

Francesca

1 Like

Good afternoon,
i succeded in exporting my model in .obj format. I am wandering if there a way to import, in lpy, another obj object.

thanks so much
Francesca

Dear Francesca,
I am not sure I understand well your question. Can you explain why do you need to import .obj files in L-py ?
Best,

Ch.

| Francesca
December 12 |

  • | - |

Good afternoon,
i succeded in exporting my model in .obj format. I am wandering if there a way to import, in lpy, another obj object.

thanks so much
Francesca


Visit Topic or reply to this email to respond.

To unsubscribe from these emails, click here.

Christophe Godin

Inria team MOSAIC (Mosaic – Mathematical Modeling of Developmental Biology)
UMR RDP (Reproduction et Développement des Plantes),
Univ Lyon, ENS de Lyon, UCB Lyon 1, CNRS, INRA, Inria
Ecole Normale Supérieure de Lyon
46 allée d’Italie
69364 Lyon Cedex 07, France

tel: +33 4 72 72 88 26
assist: + 33 4 72 72 80 37
email : christophe.godin@inria.fr

RDP: Laboratoire Reproduction et DÉveloppement des Plantes - Vive les plantes !