Sphere ply file




















The header is a series of carriage-return terminated lines of text that describe the remainder of the file. The header includes a description of each element type, including the element's name e.

Following the header is one list of elements for each element type, presented in the order described in the header. The comments in brackets are NOT part of the file, they are annotations to this example. Comments in files are ordinary keyword-identified lines that begin with the word "comment". This example demonstrates the basic components of the header.

The characters "ply " must be the first four characters of the file, since they serve as the file's magic number. Following the start of the header is the keyword "format" and a specification of either ASCII or binary format, followed by a version number. Next is the description of each of the elements in the polygon file, and within each element description is the specification of the properties.

Then generic element description has this form:. The properties listed after an "element" line define both the data type of the property and also the order in which the property appears for each element. There are two kinds of data types a property may have: scalar and list. Here is a list of the scalar data types a property may have:. These byte counts are important and must not vary across implementations in order for these files to be portable. There is a special form of property definitions that uses the list data type:.

Each integer in this variable-length list is an index to a vertex. In the example above, the first face 4 0 1 2 3 Is composed of the triangles 0,1,2 and 0,2,3 and not 0,1,2 and 1,2,3. This file specifies a red, green and blue value for each vertex.

This means that the number of faces in the object is 7. This object also contains a list of edges. Each edge contains two pointers to the vertices that delineate the edge. Each edge also has a color. The five edges defined above were specified so as to highlight the two triangles in the file.

The first four edges are white, and they surround the two triangles. The final edge is black, and it is the edge that separates the triangles. The examples above showed the use of three elements: vertices, faces and edges. Skip to content. Star 0. Branches Tags. Could not load branches. Could not load tags. Latest commit. Git stats 4 commits. Failed to load latest commit information. A point cloud is a collection of points in 3-dimensional coordinate space represented by x, y, and z axes.

These points may just form a geometric shape or more complex structures such as a 3-dimensional representation of the real world. These libraries not only allow simple geometric transformations of the cloud but also provide sophisticated functionalities such as the reconstruction of a 3D scene from various images.

However, this article discusses a simple geometric approach to achieve the reverse of 3D reconstruction, i. We will also see how to project the point cloud onto other non-planar geometries such as a sphere. Hence, our objective is the following. The sample implementation included in this article was run in python3. The following additional libraries for python must be available.

We will try to achieve the perspective projection of a point cloud i. The line L in 3-dimensional space can be represented as follows. With the given optical center and the set of points in the cloud, we can compute the direction cosines for the lines passing through each of the points. We can substitute the equations of the line in the equation of the plane P since we are solving for the point of intersection between the two. Solving for t, we can deduce the above equation as follows.

Finally, we can obtain the projection by substituting the value of t into the equations of the line L. The above computation should be performed for each point in the Point Cloud to obtain the complete projection on the given plane.

The resulting planar Point Cloud can be seen as follows.



0コメント

  • 1000 / 1000