STL parts overlapping in scene

Hi,
I have develop a software for 3d printing industry, where user can upload CAD models like STL, OBJ etc.
But sometimes when user upload parts in bunch, all CAD parts gets overlapped on each other in scene and it looks weird.
Please refer below image:

While uploading current part i remove previous part accessing with “mesh.name”.
I don’t know what’s the problem is? Can anyone suggest any solution?

Thanks

In most cases, 3D models are centered at the origin. If you now load multiple models into your scene, it’s obvious that all models are placed at the same spot and hence overlapping. A 3D engine can not solve this issue for you.

It seems this is already a fine solution…

Hi,
I think there is some misunderstanding while explaining my question,
My problem is not related to position of parts but parts getting overlapped.
Actually when i upload 2nd part the 1st part of scene should be removed from scene.however in my case this not happen, the 2nd, 3rd, … parts get overlapped on 1st one, even if i used “mesh.name” to remove previous part.

For multiple upload:
i use ajax call ,on first request(file index) ,
In success data i call render with STL loader ,
while in second request same functionality worked.

Refer below image

How do you remove this 3d object? Via Scene.remove()?

I give name of that mesh,
mesh.name =" stlModel";
and before uploading next part
i remove first one by
var object=scene.getObjectByName(“stlModel” ) ;
scene.remove(object) ;

And that operation does not work?

i am not sure whether this operation is working correctly or not.
In some cases only it shows wrong result.

It will only be possible to help you if you can reproduce the issue with a live example. Anything else will be just guesswork.

i have attached live demo
In this i have uploaded 4 files at a time and if you pause video at 00:32 sec, you can observe that two separate files are overlap on each other.

Sry, but I can’t provide any useful feedback based on your video. I mean it shows the issue but it’s not helpful for finding the problem.

Try to reproduce the issue in an isolated test case. Often users find the bug by themselves while preparing the live demo.

Okay
Thanks

If you don’t want to show two models in the same space, try showing only one.