Forum

Author Topic: How to split model imported into Metashape  (Read 3787 times)

BenW22

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
How to split model imported into Metashape
« on: March 02, 2024, 02:40:53 AM »
Hi All,

I have imported a 2.5d mesh into Metashape. The mesh was in autocad dxf format of 3d face triangles and of a ground surface about 3km x 3km. It is a big file and because of this I need to split the mesh into tiles of about 500m x 500m to make the data more manageable to our clients.

The data imports correctly into Metashape.  And is the only object in the Metashape file. But I cant do any thing with it. I found a script from Alexey that is suppose to split a mesh into tiles but it would not work for me. I know nothing about scripts but when i run it nothing happens. That script is attached.

I have tried creating a Point Cloud from the mesh (at 0.05m interval) but it does not work. The point cloud object is created but it only contains one point. 

Would anyone know how i can split my dxf mesh into tiles of a nominated size or nominated number of tiles. Or even better - how can I split my mesh into tiles but also create a scheme of the tiles generated. Just like happens when exporting a kml of an ortho.

Any help appreciated

Ben

BenW22

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
Re: How to split model imported into Metashape
« Reply #1 on: March 02, 2024, 03:20:19 AM »
Hi All,

I have just found that the mesh splitting script works!!!! Thanks Alexey!! I didn't realize the script creates a custom menu at the top of the screen on the menu bar. You can run the functions of the script from there.
 
I also found that the script created a shape file containing the boarder of each tile!! And when exporting the shapes to dxf, if i tick a box to also export shape labels and attributes, I then get each tile name centred in the tile when I open the dxf !

This is exactly what I needed.

As you can tell by all the exclamation (!) marks - i'm very happy. 

Thanks again Alexey!



Regards
Ben

BenW22

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
Re: How to split model imported into Metashape
« Reply #2 on: March 02, 2024, 04:03:03 AM »
HI All (and Alexey),

Now that I have created all my mesh tiles. I was looking to export them all in one go, using this script i found. When I run it i get a message -  name 'chunk' is not defined.

I renamed my chunk to chunk but get the same message.  Sorry I know nothing about scripts

for model in chunk.models:
   chunk.model = model
   path = output_folder + "\\" + str(model.key) + "_model.abc"
   chunk.exportModel(path, format = Metashape.ModelFormatABC)