I know this is a *really *simple question - so forgive me for asking.. I am not a programmer but I do want to make Julia the language I use - and move away from the others that shall not be named.. I would really like an explicit syntax answer to this:
obj_file = "pathto.obj" obj = load(obj_file) display(obj.vertices) which gives me: 502-element Array{FixedSizeArrays.Point{3,Float32},1}: Point(0.00117,-0.02631,0.03907) Point(-0.00896,-0.02466,0.03908) ⋮ Point(-0.01634,-0.0178,-0.05919) Point(-0.01751,-0.01913,-0.06169) How do I access this info? So I can then do a scatter3D plot. I have tried: obj.vertices[1,:][1,1] which gets me this far FixedSizeArrays.Point{3,Float32}((0.00117f0,-0.02631f0,0.03907f0)) and this obj.vertices[1,:][1,1][1] which gets the first value 0.00117f0 But it really doesn't seem that elegant.. which typically means I am doing something wrong. I want to put all vertices in a matrix and not look like its a hack. On Monday, 23 November 2015 16:53:24 UTC+2, kleinsplash wrote: > > Thanks to group managed to plot using GLVisualize: > > using GLVisualize > using FileIO > w,r = glscreen() > view(visualize(obj)) > r() > > from Simon's answer here: > https://groups.google.com/d/msg/julia-users/W8D6kAJhREI/N89EOObzCAAJ > <https://groups.google.com/d/msg/julia-users/W8D6kAJhREI/N89EOObzCAAJ> > > On Monday, 23 November 2015 13:53:50 UTC+2, kleinsplash wrote: >> >> Looks like accessing has changed a bit - so to get to the faces I did >> >> obj = load("path.obj") >> faces = obj.faces >> >> So far I haven't had much luck in either plotting this or accessing the >> faces and the verticies. As soon as I figure it out I will get back. This >> is linked to my other question, for some reason I wasn't automatically >> subscribed to this one. >> >> >> On Monday, 9 November 2015 18:45:01 UTC+2, Steve Kelly wrote: >>> >>> The faces can be accessed with faces(load("foo.obj")) or mesh.faces. >>> >>> Probably the easiest way to display the mesh at this point is with >>> ThreeJS.jl: >>> https://github.com/rohitvarkey/ThreeJS.jl/blob/master/examples/mesh.jl. >>> This approach should work in IJulia and Blink. >>> >>> GLVisualize has some good demos and a much more responsive backend, but >>> it needs some work to run in OpenGL < 3.3 and the working commits aren't on >>> Metadata yet. Meshes is kind of a weird state right now, and most of the >>> functionality can be had with GeometryTypes, Meshing, and MeshIO. We have >>> been working the past few months to finish the coupling between data >>> structures for geometry and visualization. It would be great to hear your >>> application, and see if we could achieve something in the short term that >>> would work for you. Personally I use Meshlab when I do solid modelling in >>> Julia which slows down my iteration time, and it would be nice to have a >>> mesh viewer in the workflow. >>> >>> Best, >>> Steve >>> On Nov 9, 2015 9:55 AM, "Ashley Kleinhans" <kleinhan...@gmail.com> >>> wrote: >>> >>>> Hi, >>>> >>>> I am new at this - but have decided that Julia is my language of >>>> choice. So I begin silly question stage: >>>> >>>> Could someone talk me through how to access and display an .obj file? >>>> >>>> I have gotten so far: >>>> >>>> using Meshes >>>> using PyPlot >>>> using FileIO >>>> using MeshIO >>>> >>>> obj = load(filename) >>>> vts = obj.vertices >>>> >>>> >>>> Which gives me: >>>> >>>> 502-element Array{FixedSizeArrays.Point{3,Float32},1}: >>>> >>>> >>>> >>>> One example point being: >>>> >>>> Point(0.00117,-0.02631,0.03907) >>>> >>>> >>>> >>>> >>>> >>>> >>>> How do I access the verticies to use them with plot? >>>> >>>> -A >>>> >>>> >>>>