Skip to content

Properties passed to a mesh modified in place #12

@AleMorales

Description

@AleMorales

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:

  1. Create some tests to recreate this issue here and in PlantGeomTurtle
  2. Make the necessary changes to make sure those tests pass successfully.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinglongFixing this issue will take a significant amount of time

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions