I think the easiest way would be to recreate the geometry. This is what dynamic entities do, and they handle copying over the previous state. For example, if you run this Sandcastle which has a rectangle with a dynamic extrusion, and print out a message in the RectangleGeometryUpdater:
You’ll see it continually recreating the geometry.
If you run this sandcastle you can see me recreating the primitive (manually) every 40ms and that seems to work fine, even with a 759-point polygon.
Please glance at the code at the end of that sandcastle. Is there any worthwhile optimization I can do, like avoiding re-creating all three objects inside makePolyPrimitive() each time?
From a first glance, it looks like one thing you could easily cache is the material, where you create it once and just pass it to the new primitive you create.
I’d need to dig a bit more here to recommend any more optimization. For example, it might be worth investigating how much work happens when you construct a geometry instance, if it’s worth trying to keep that alive and only replacing its geometry property, or if it’s more of just a simple interface.