3D PDF generated by jReality taking time to load

General discussion area.
Post Reply
Denzilgri
Posts: 2
Joined: Fri 18. Sep 2015, 13:10

3D PDF generated by jReality taking time to load

Post by Denzilgri » Fri 18. Sep 2015, 13:31

Hi,

I working on converting 'obj' file formats to 3d pdf. I've been able to convert obj files to 3d pdf but when I open the file, it just loads. Although I can see the embedded 3d components, it takes a long time to load(in minutes ranging on different computers).

This is the code that I am using:

Code: Select all

	//the absolute path of the obj files are passed as command line arguments.
        // TODO add your handling code here:
        String destFileName= dest; //destination file 
        
        Readers.registerReader("OBJ", ReaderOBJ.class);
        Readers.registerFileEndings("OBJ", "obj");
        
        SceneGraphComponent content = new SceneGraphComponent();
        SceneGraphComponent[] childContent = new SceneGraphComponent[top];
        
        try {
            for (int i = 0; i < childContent.length; i++) {
                childContent[i] = new SceneGraphComponent();
                childContent[i] = Readers.read(new File(src[i]));
                BufferedReader bufReader = new BufferedReader(new FileReader(src[i]));
                String line = bufReader.readLine();
                String[] words = line.split("\\s");
                childContent[i].setName(words[1]);
                bufReader.close();
            }
            
            content.setName("Surfaces");
            content.addChildren(childContent);
            RemoveDuplicateInfo.simplifySceneTree(content);
 
            // Embedding U3D into pdf file format
            // and creating 3d pdf
            WriterPDF pdfObject = new WriterPDF();
            pdfObject.setGridMode(WriterPDF.PDF3DGridMode.GRID_MODE_OFF);
            pdfObject.setLighting(WriterPDF.PDF3DLightingScene.WHITE);
            pdfObject.setRenderMode(WriterPDF.PDF3DRenderMode.SOLID);
            pdfObject.setShowInventory(true);
            pdfObject.setTool(WriterPDF.PDF3DTool.ROTATE);
            JrScene scene = new JrScene(content);
            OutputStream pdfOutput = new FileOutputStream(destFileName);
            pdfObject.writeScene(scene, pdfOutput);
            
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
Could someone please help me with this problem?

Denzilgri

tmokbel1965
Posts: 1
Joined: Fri 23. Oct 2015, 23:09
Contact:

Re: 3D PDF generated by jReality taking time to load

Post by tmokbel1965 » Fri 23. Oct 2015, 23:16

Hi, I think it may be due to the 3D PDF and nothing to do with jReality at all.

Post Reply