Geometry count is increasing on changing the Drei/TransformControls

I found a bug in Drei Transform Controls. whenever I detach and reattach the transform controls, the scene geometry count is increasing. Maybe that’s the cause of getting the slower fps after using it for some time. I’ve opened the issue on Github.

Here it is Increase in number of geometry count when working with TransformControls component · Issue #1130 · pmndrs/drei · GitHub

here is the code sandbox Transform controls Geometry count - CodeSandbox

i used react perf and manually tested to monitor the count. Still i’m getting the same issue

i think you should use drei/pivot controls anyway. controls in threejs are kind of on the dirty side, they mutate, rip stuff out of their scene, inject objects, etc. this is hard to catch and causes leaks and issues. pivotcontrols has most of the functionality but is based on a cleaner approach.

Im sorry i didn’t mentioned exactly whether it was a three TransformContols or Drei/TransformControls…Actually the problem occured was with the Drei/TransformControls…

it’s just a light abstraction, it’s still everyday transformcontrols. like i said, you can use this: