Thu 24 Apr 2014 02:01:08 PM UTC, comment #1:
This is the intended behavior.
I admit it is badly documented: the formex.py module states: these are the only functions changing the Formex: setProp, append.
But when the setProp was moved to Geometry, no mention of that special behavior was added to the documentation. We should do that.
The reason for the special behavior is that Geometry is often constructed without properties: it would be a waste to always add it by default. The setProp method then allows you to add properties to an existing Geometry.
Originally, setProp did not return anything. This was changed to return self, so that it could be used in a chain of operations, just like most other methods.
I think that this behavior is what is most practical for most users. If you want to set properties on a geometry and keep the original, you can use
This will create a deep copy of the Geometry, leaving the original untouched.
If what you want is shallow copies of a Geometry (i.e. same
coords/elems arrays, but different prop arrays), I think the best way is to handle this with a single Geometry, and keep a set of prop arrays external, then set the one you need, when you need it, with setProp.
Alternatively, you could create shallow copies with
|