Exporting a merged scan


  • Hi everyone,

    Sorry if this is a basic question, but I'm having trouble getting the ExportMerge task to work correctly. After performing a successful merge and adding it to the project, the exported STL file seems to be corrupted or unreadable.

    Here’s the task sequence I’m using:

    json
    Copier
    Modifier
    {
      "Task": {
        "Index": 1,
        "Type": "Merge",
        "Input": {
          "selection": { "mode": "visible" },
          "remesh": {
            "method": "FlowTriangles",
            "quality": "Low"
          },
          "simplify": { "triangleCount": 30000 }
        }
      }
    }
    json
    Copier
    Modifier
    {
      "Task": {
        "Index": 2,
        "Type": "AddMergeToProject"
      }
    }
    json
    Copier
    Modifier
    {
      "Task": {
        "Index": 3,
        "Type": "ExportMerge",
        "Input": {
          "format": "stl",
          "texture": false
        }
      }
    }
    The merge appears successful when I inspect it in the project, but the resulting STL shows it's a 6Mb file but won’t open in any software. Any ideas on what might be going wrong or how to fix the export?

    Thanks in advance!



  • Hi,

    It's resolved the Scanner sends zip and was trying to store it as an stl file.


  • Hi Mehdi,
    I'm glad you got it resolved.
    There is another non-obvious thing going on with Merging, and also the documentation on the schema (out of date, thank you for finding it).

    First the non-obvious thing is that in our official front end, we put the user on rails and force them to remesh, and then simplify and convert, in that order.  However in the API, you could do simplify and convert without remeshing. The difference here, is that remeshing will try to create a single mesh out of all the scan data, thereby removing redundant pieces, and filling in the blanks where it makes sense. Simplifying will take any data, and try to convert it and simplify it, but it will struggle to merge all that data together, so performing a simply and convert on a raw scan may result in intersecting geometry and holes.

    Secondly, the schema's examples are a bit out of date, which is where I think you got your call from.

    Heres a step by step copied from the frontend Websocket call.

    1) Merge and prepare for remeshing. This merges a distinct selection of scans (in this case group 20), removes some overlapping points, and prepares the data for the next step. 

    { 
        "Task": { 
            "Index":23,
            "Type":"Merge",
            "Input":{
                "selection":{
                    "mode":"selected",
                    "groups":[20]
                }
            }
        }
    }

     

    2) Remeshing the raw data into a single mesh with holes removed

    {
        "Task":{
            "Index":24,
            "Type":"Merge",
            "Input":{
                "remesh":{
                    "quality":"Medium"
                }
            }
        }
    }

     

    3) Simplify and Converting the remesh. This will reduce the number of faces, and apply a flow to the polygons that contours the geometry. 

    {
        "Task":{
            "Index":26,"Type":
            "Merge","Input":{
                "simplify":{
                    "method":"FlowQuads",
                    "faceCount":20000
                }
            }
        }
    }

    4) Apply Texturing if the original data contains some texture data. 

    {
        "Task":{
            "Index":75,
            "Input":{
                "texturize":true
            },
            "State":"Started",
            "Type":"Merge"
        }
    }

    5) Getting the data back. There are multiple ways to continue from here. Option a) add the merged result back into the project as you did,. Option b) stream the merge result as a series of buffers, the way the front end software does for viewing, or Option c) Export the merge data as a file as in your last step. Here is the file export option for completeness

    {
        "Task":{
            "Index":28,"Type":
            "ExportMerge","Input":{
                "format":"ply",
                "texture":true
            }
        }
    }

     

    Hopefully this helps you and some other people who are exploring the API.


Please login to reply this topic!