User Tools

Site Tools


tutorials:pointcloud-io

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorials:pointcloud-io [2024/11/05 11:53] gaetantutorials:pointcloud-io [2024/12/06 12:09] (current) – [As array] gaetan
Line 22: Line 22:
 <code java> <code java>
 importNodeFromFile( "/path/to/file/leaf1.xyz", "mimeType/astext"); importNodeFromFile( "/path/to/file/leaf1.xyz", "mimeType/astext");
 +
 </code> </code>
  
 The file at the given path will be loaded with the filter associated with the given mimetype from GroIMP. The node created is automatically added to the scene under the root node of the project graph. The file at the given path will be loaded with the filter associated with the given mimetype from GroIMP. The node created is automatically added to the scene under the root node of the project graph.
 +Additionally the node can only be loaded, meaning it is not added to the graph but provided as a variable.
 +<code java>
 +Node x = loadNodeFromFile( "/path/to/file/leaf1.xyz", "mimeType/astext");
 +</code>
 +
 +Both ways loading and importing can also work with input streams instead of file paths. 
  
 The MimeTypes used for Point cloud import in GroIMP are :  The MimeTypes used for Point cloud import in GroIMP are : 
Line 40: Line 47:
 {{:groimp-platform:import_pcarray.png?350|}} {{:groimp-platform:graph2d_pcarray.png?200|}} {{:groimp-platform:import_pcarray.png?350|}} {{:groimp-platform:graph2d_pcarray.png?200|}}
  
-The two current available format are xyz and ply. Even if PLY enables to include "edges", and "faces", they are ignored when the file is imported. Only "vertexes" are included.+The two current available format are xyz and ply. Even if PLY enables to include "edges", and "faces", they are ignored when the file is imported. Only "vertices" are included.
 The file could also have been imported with the RGG method (using a mimetype that contains //array//): The file could also have been imported with the RGG method (using a mimetype that contains //array//):
  
Line 52: Line 59:
  
 <code java> <code java>
-import de.grogra.pointcloud.groimp.PointCloud; 
 [pc:PointCloud ::> println(pc.getCloud()); ] [pc:PointCloud ::> println(pc.getCloud()); ]
 [pc:PointCloud ::> println(pc.getCloud().pointsToFloat()); ] [pc:PointCloud ::> println(pc.getCloud().pointsToFloat()); ]
Line 78: Line 84:
 The given example import a XYZ file, which only contains Points. So the graph created is of the structure: The given example import a XYZ file, which only contains Points. So the graph created is of the structure:
  
-{{:groimp-platform:graph2d_pcgraph_point.png?400|}}+{{:tutorials:graph2d_pcgraph_point.png?400|}}
  
  
-If you import a PLY file that include both Vertexes and Faces (and/or Lines), GroIMP will create two (or three) point cloud nodes, one per type of object to import from the PLY file.+If you import a PLY file that include both vertices and Faces (and/or Lines), GroIMP will create two (or three) point cloud nodes, one per type of object to import from the PLY file.
 Each of these point cloud nodes are added under a //CollectionCloud// node: Each of these point cloud nodes are added under a //CollectionCloud// node:
  
-{{:groimp-platform:graph2d_pcgraph_meshes.png?400|}}+{{:tutorials:graph2d_pcgraph_meshes.png?400|}}
  
-This very simple example of a PLY file with 3 vertexes and one face show that the face is imported as a LeafMeshImpl (which extends MeshNode - the default mesh node of GroIMP). The LeafMesh is linked to the points that defines it by //Refinement Edges//.+This very simple example of a PLY file with 3 vertices and one face show that the face is imported as a LeafMeshImpl (which extends MeshNode - the default mesh node of GroIMP). The LeafMesh is linked to the points that defines it by //Refinement Edges//.
  
 Similarly to the point cloud as array, the cloud nodes can be accessed with RGG commands: Similarly to the point cloud as array, the cloud nodes can be accessed with RGG commands:
  
 <code java> <code java>
-import de.grogra.pointcloud.groimp.PointCloud; 
 [pc:PointCloud ::> println(pc.getCloud()); ] // print the CloudGraph node for each point cloud (2 here) [pc:PointCloud ::> println(pc.getCloud()); ] // print the CloudGraph node for each point cloud (2 here)
 [pc:PointCloud ::> println(pc.getCloud().pointsToFloat()); ] // print the float array representation of all nodes (in this example it print two float array that contains the same values [pc:PointCloud ::> println(pc.getCloud().pointsToFloat()); ] // print the float array representation of all nodes (in this example it print two float array that contains the same values
Line 121: Line 126:
  
 There are three possible export commands:  There are three possible export commands: 
-  * Export all in one: All the point clouds in the scene are exported into one file. The user needs to select one file in the GUI prompt. +  * Export all in one: All the point clouds in the scene are exported into one file. The user needs to select one file in the GUI prompt. This method export the **Global coordinates of the Points**
-  * One per file: Each point cloud is exported to a separate file. For each point cloud a new prompt from the GUI will is required. +  * One per file: Each point cloud is exported to a separate file. For each point cloud a new prompt from the GUI will is required. This method export the **Local coordinates of the Points**
-  * Selected: Export the selected point clouds (can be several). Each point cloud prompt a GUI file selection.+  * Selected: Export the selected point clouds (can be several). Each point cloud prompt a GUI file selection. This method export the **Local coordinates of the Points**.
  
tutorials/pointcloud-io.1730803990.txt.gz · Last modified: 2024/11/05 11:53 by gaetan