federicogiorgi / corto

corto (Correlation Tool): an R package to generate correlation-based DPI networks
20 stars 7 forks source link

PLY files with QUAD faces are not read correctly #5

Closed Rabbid76 closed 2 years ago

Rabbid76 commented 2 years ago

The PLY file below cannot be read and causes memory corruption. It seems that reading PLY files with QUAD faces is not implemented yet. See MeshLoader::loadPly:

ply.request_properties_from_element("face", { "vertex_indices" }, index, 3);

Example:

ply
format ascii 1.0
comment Created by Blender 3.0.0 - www.blender.org
element vertex 38
property float x
property float y
property float z
property float nx
property float ny
property float nz
property float s
property float t
element face 10
property list uchar uint vertex_indices
end_header
0.000000 1000.000000 371.754700 0.531974 0.000000 0.846761 0.750000 0.500000
-1000.000000 1000.000000 1000.000000 0.531974 0.000000 0.846761 0.875000 0.500000
-1000.000000 -506.694794 1000.000000 0.531974 0.000000 0.846761 0.875000 0.750000
0.000000 -1000.000000 371.754700 0.531974 0.000000 0.846761 0.750000 0.750000
0.000000 -1000.000000 -1000.000000 -0.442404 -0.896816 0.000000 0.375000 0.875000
0.000000 -1000.000000 371.754700 -0.442404 -0.896816 0.000000 0.625000 0.875000
-1000.000000 -506.694794 1000.000000 -0.442404 -0.896816 0.000000 0.625000 1.000000
-1000.000000 -506.694794 -403.351471 -0.442404 -0.896816 0.000000 0.375000 1.000000
-1000.000000 -506.694794 -403.351471 -1.000000 -0.000000 0.000000 0.375000 0.000000
-1000.000000 -506.694794 1000.000000 -1.000000 -0.000000 0.000000 0.625000 0.000000
-1000.000000 1000.000000 1000.000000 -1.000000 -0.000000 0.000000 0.625000 0.250000
-1000.000000 1000.000000 -403.351471 -1.000000 -0.000000 0.000000 0.375000 0.250000
0.000000 1000.000000 -1000.000000 0.000000 0.000000 -1.000000 0.250000 0.500000
1000.000000 1000.000000 -1000.000000 0.000000 0.000000 -1.000000 0.375000 0.500000
1000.000000 -506.694794 -1000.000000 0.000000 0.000000 -1.000000 0.375000 0.750000
0.000000 -1000.000000 -1000.000000 0.000000 0.000000 -1.000000 0.250000 0.750000
1000.000000 1000.000000 -1000.000000 1.000000 -0.000000 0.000000 0.375000 0.500000
1000.000000 1000.000000 1000.000000 1.000000 -0.000000 0.000000 0.625000 0.500000
1000.000000 -506.694794 1000.000000 1.000000 -0.000000 0.000000 0.625000 0.750000
1000.000000 -506.694794 -1000.000000 1.000000 -0.000000 0.000000 0.375000 0.750000
0.000000 1000.000000 -1000.000000 0.000000 1.000000 0.000000 0.375000 0.375000
0.000000 1000.000000 371.754700 0.000000 1.000000 0.000000 0.625000 0.375000
1000.000000 1000.000000 1000.000000 0.000000 1.000000 0.000000 0.625000 0.500000
1000.000000 1000.000000 -1000.000000 0.000000 1.000000 0.000000 0.375000 0.500000
-1000.000000 1000.000000 -403.351471 0.000000 1.000000 0.000000 0.375000 0.250000
-1000.000000 1000.000000 1000.000000 0.000000 1.000000 0.000000 0.625000 0.250000
-1000.000000 1000.000000 -403.351471 -0.512378 0.000000 -0.858760 0.125000 0.500000
0.000000 1000.000000 -1000.000000 -0.512378 0.000000 -0.858760 0.250000 0.500000
0.000000 -1000.000000 -1000.000000 -0.512378 0.000000 -0.858760 0.250000 0.750000
-1000.000000 -506.694794 -403.351471 -0.512378 0.000000 -0.858760 0.125000 0.750000
1000.000000 -506.694794 -1000.000000 0.442404 -0.896816 0.000000 0.375000 0.750000
1000.000000 -506.694794 1000.000000 0.442404 -0.896816 0.000000 0.625000 0.750000
0.000000 -1000.000000 371.754700 0.442404 -0.896816 0.000000 0.625000 0.875000
0.000000 -1000.000000 -1000.000000 0.442404 -0.896816 0.000000 0.375000 0.875000
1000.000000 1000.000000 1000.000000 -0.531974 0.000000 0.846761 0.625000 0.500000
0.000000 1000.000000 371.754700 -0.531974 0.000000 0.846761 0.750000 0.500000
0.000000 -1000.000000 371.754700 -0.531974 0.000000 0.846761 0.750000 0.750000
1000.000000 -506.694794 1000.000000 -0.531974 0.000000 0.846761 0.625000 0.750000
4 0 1 2 3
4 4 5 6 7
4 8 9 10 11
4 12 13 14 15
4 16 17 18 19
4 20 21 22 23
4 24 25 21 20
4 26 27 28 29
4 30 31 32 33
4 34 35 36 37
federicogiorgi commented 2 years ago

Hi there,

can you please give me some more information on the task you are trying to accomplish? E.g. which function are you testing, and a dummy dataset?

Federico

On Fri, 21 Jan 2022 at 14:47, Rabbid76 @.***> wrote:

The PLY file below cannot be read and causes memory corruption. It seems that reading PLY files with QUAD faces is not implemented yet. See MeshLoader::loadPly:

ply.request_properties_from_element("face", { "vertex_indices" }, index, 3);

Example:

Blender v3.0.0 OBJ File: 'Model.blend'

www.blender.org

mtllib Model.mtl o Cube v 1000.000000 1000.000000 1000.000000 v 1000.000000 1000.000000 -1000.000000 v 1000.000000 -506.694794 1000.000000 v 1000.000000 -506.694794 -1000.000000 v -1000.000000 1000.000000 1000.000000 v -1000.000000 1000.000000 -403.351471 v -1000.000000 -506.694794 1000.000000 v -1000.000000 -506.694794 -403.351471 v 0.000000 1000.000000 -1000.000000 v 0.000000 -1000.000000 371.754700 v 0.000000 -1000.000000 -1000.000000 v 0.000000 1000.000000 371.754700 vt 0.750000 0.500000 vt 0.875000 0.500000 vt 0.875000 0.750000 vt 0.750000 0.750000 vt 0.375000 0.875000 vt 0.625000 0.875000 vt 0.625000 1.000000 vt 0.375000 1.000000 vt 0.375000 0.000000 vt 0.625000 0.000000 vt 0.625000 0.250000 vt 0.375000 0.250000 vt 0.250000 0.500000 vt 0.375000 0.500000 vt 0.375000 0.750000 vt 0.250000 0.750000 vt 0.625000 0.500000 vt 0.625000 0.750000 vt 0.375000 0.375000 vt 0.625000 0.375000 vt 0.125000 0.500000 vt 0.125000 0.750000 vn 0.5320 0.0000 0.8468 vn -0.4424 -0.8968 0.0000 vn -1.0000 0.0000 0.0000 vn -0.0000 0.0000 -1.0000 vn 1.0000 0.0000 0.0000 vn 0.0000 1.0000 0.0000 vn -0.5124 0.0000 -0.8588 vn 0.4424 -0.8968 0.0000 vn -0.5320 0.0000 0.8468 usemtl Material s off f 12/1/1 5/2/1 7/3/1 10/4/1 f 11/5/2 10/6/2 7/7/2 8/8/2 f 8/9/3 7/10/3 5/11/3 6/12/3 f 9/13/4 2/14/4 4/15/4 11/16/4 f 2/14/5 1/17/5 3/18/5 4/15/5 f 9/19/6 12/20/6 1/17/6 2/14/6 f 6/12/6 5/11/6 12/20/6 9/19/6 f 6/21/7 9/13/7 11/16/7 8/22/7 f 4/15/8 3/18/8 10/6/8 11/5/8 f 1/17/9 12/1/9 10/4/9 3/18/9

— Reply to this email directly, view it on GitHub https://github.com/federicogiorgi/corto/issues/5, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKWILDRO7Z6UF7PPGX2SATUXFPWPANCNFSM5MPSDRYQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

Rabbid76 commented 2 years ago

Transfered to https://github.com/cnr-isti-vclab/corto/issues/32