Upload PointCloud and OBJ files together

point-cloud
upload

(Jonnyqb) #1

Hi all.
I have a .ASC pointcloud file (each line is just X Y Z R G B as shown on a SF help page) and an OBJ file that I want to combine into the same model on sketchfab. I've tried uploading both files adding a sketchfab.zbrush file to the selected file uploads as well as putting all files in a zip file. the result is that the OBJ file shows up but i don't see the point cloud.
The intent is that the point cloud is the "shell" and the OBJ is the "skeleton" of the shell. I need to keep the OBJ as it's drawing solid lines and I can't replace with an equivalent point cloud.
I have a version of the pointcloud structure as OBJ but the file size is gigantic because of triangles and faces and lots of vertexes.

Any help is much appreciated!
Thanks


Point cloud + mesh
#2

The sketchfab.zbrush trick only works with OBJ files. Sounds like you'll need to combine the files in some other software before uploading. Maybe Blender?


(Jonnyqb) #3

Bummer. Thanks for the help.
I haven't had success with dealing with pointclouds in Blender.
i followed a few different tutorials but they never worked for me and i couldn't figure out why.
I'll see what I can do.
Thanks


Ply Vertex Colors and textures
(Mrchlblng) #4

@jonnyqb if you feel like (bash) scripting something, it could be doable rather easily I think.
We support vertex with color in obj (i.e. the syntax v x y z r g b is hanlded) as well as relative indexing in obj.
So it simply boils down to pushing the points and declaring the "point" primitive:

function aggregate {
    local triangles="$1"
    local points="$2"
    local output="$3"

    cat "${triangles}" > "${output}"  # first insert the initial obj scene

    while read point;  # iterate over the ASC file
    do
        echo "v ${point}" >> "${output}"  # declare an obj vertex with color
        echo "p -1" >> "${output}"  # declare a point primitive for last vertex
    done < "${points}"
}

aggregate scene.obj cloud.asc result.obj  # call example

I've not tested this as I lack samples but it should basically work.


(Jonnyqb) #5

thanks @mrchlblng !
we use blender as our intermediate step to look at our obj files before we move final "good ones" to SketchFab. perhaps i will just use your bash model but put it in as an additional function in our .asc generator code to write an obj using the "vertex with color" then go directly to SketchFab.
in the past i thought I tried creating an obj as vertex with color but it didn't work. i didn't declare the "point" primitive though, and maybe that's why it failed.
thanks for the advice. this gives me some good things to test out.

question: does SketchFab support OBJ files with a sequence of vertex locations all "covered" by the same material in a mtl file? for example:
usemtl mat1
v 1 2 3
v 3 4 5
v 4 5 6

usemtl mat2
v 7 8 9
...

since my files are pretty large, if i can avoid having RGB for each vertex, i can reduce file size a bit.
Thanks


#6

You should be able to do something like:

usemtl zero
v 0 0 0
p -1
usemtl one
v 1 1 1
p -1
usemtl two
v 2 2 2
p -1
usemtl three
v 3 3 3
p -1