When creating a mesh from a graph, the first node that assigns a particular property will create that property in the mesh. If we pass an array of values (for example an array of RGBA objects to the :colors property) the original array seems to be modified in-place. A solution is to copy the array when feeding the turtle (a shallow copy suffices) though this is not ideal in the general sense as we may want properties to be modified in-place in some cases. At the moment this should not affect the rendering or the ray tracer.
The problem seems to occur when we feed a second node that extends that property. I suspect the issue may be in the add_property!() function. Steps to fix the problem:
- Create some tests to recreate this issue here and in PlantGeomTurtle
- Make the necessary changes to make sure those tests pass successfully.
When creating a mesh from a graph, the first node that assigns a particular property will create that property in the mesh. If we pass an array of values (for example an array of RGBA objects to the :colors property) the original array seems to be modified in-place. A solution is to copy the array when feeding the turtle (a shallow copy suffices) though this is not ideal in the general sense as we may want properties to be modified in-place in some cases. At the moment this should not affect the rendering or the ray tracer.
The problem seems to occur when we feed a second node that extends that property. I suspect the issue may be in the
add_property!()function. Steps to fix the problem: