Skip to content

Conversation

@AurelienBesnier
Copy link
Contributor

Adding a new PlantGL_Mesh method to make individual meshes as a k3d.Mesh objects.
A k3d.Plot object, like the ones produced by the PlantGL function, cannot be added together.

@AurelienBesnier AurelienBesnier added the enhancement New feature or request label Oct 15, 2025
@baugetfa
Copy link
Contributor

Just for information it is possible that windows-latest does not pass because of this issue openalea/lpy#56 in lpy

@AurelienBesnier
Copy link
Contributor Author

Just for information it is possible that windows-latest does not pass because of this issue openalea/lpy#56 in lpy

Yes that is probably it. Seems that it is a utf-8 encoding issue.
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 182: invalid continuation byte
Might be worth getting rid of all the accents in metadata

@baugetfa
Copy link
Contributor

Yes but what is not straightforward is that the file where the error happens has not be changed for 4 or 5 years. And in September 16th the CI was ok. The only thinks that changed since is plantgl.

#plot.colorbar_object_id = randint(0, 1000)
return plot

def PlantGL_Mesh(pglobject, plot=None, group_by_color=True, property=None, side='front'):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not completly understand.
This is already done by the PlantGL function, isn't it?
Why do you need another function?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main difference is that PlantGL return a plot while you return a mesh.
Perhaps, you can extend the to_mesh function...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem with the PlantGL function is that it returns a k3d.plot and you can't add two k3d.plot items together.
It's not a problem if you simply want to plot a single scene but in my case, I want to make animate a time series with ipywidgets.
So what I do is compute all the meshes of that series, convert them as k3d.Mesh with this function and add them all to a k3d.plot, make them invisible and have a slider select a time step to display

@pradal
Copy link
Collaborator

pradal commented Oct 17, 2025

IMHO, this is the role of tomesh function.

So rather than having several PlantGL_*, we can extend the tomesh function and document it.
Agree?

@baugetfa
Copy link
Contributor

baugetfa commented Oct 22, 2025

Strange the error is a failed test, but on local windows tests pass. Ok a old windows 10


def tomesh(geometry, d=None, side='front'):
"""Return a mesh from a geometry object"""
def tomesh(object, d=None, side='front'):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be carefull: object is a reserved keyword in Python.

Either keep geometry but document it.
Or use obj, if you want

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh ! yeah you're right my bad

@pradal pradal merged commit 208ac72 into master Dec 3, 2025
5 checks passed
@AurelienBesnier AurelienBesnier deleted the plantgl_mesh branch December 3, 2025 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants