Free Support Forum - aspose.com

Load multiple STL files into a single scene

Hello mate,

I am trying to load multiple STL files into a single scene then export the merged scene to a PDF with models from all STL files. I tried some quick and dirty code as following but seems not working, the exported PDF file is blank (no 3D content when open) if I add more than one ChildNode under new scene’s RootNode, otherwise if I only add one ChildNode then I can see model of the first STL file in generated PDF, could you please let me know which part of my code went wrong and how to fix it? Thanks advanced.

        var scene1 = new Scene("foot.stl");
        var scene2 = new Scene("body.stl");
        var scene3 = new Scene("head.stl");
        var mainScene = new Scene();
        mainScene.RootNode.AddChildNode(scene1.RootNode);
        //mainScene.RootNode.AddChildNode(scene2.RootNode); //if I uncomment this line then pdf will be blank
        //mainScene.RootNode.AddChildNode(scene3.RootNode);
        var opt1 = new PdfSaveOptions();
        mainScene.Save("main.pdf", opt1);

Best regards,
Richard

@richardyu.au

Could you kindly share the used source .stl files with us in .zip format? We will test the scenario in our environment and address it accordingly.