[julia-users] Re: Documentation generators for Julia?

2016-05-12 Thread kleinsplash
Hi,

Any chance there is a consensus on which document generation platform will 
be the standard? So that if I start writing and comments then later 
compiling will allow document generation: 

http://www.stack.nl/~dimitri/doxygen/
http://www.sphinx-doc.org/en/stable/contents.html
https://www.statistik.lmu.de/~leisch/Sweave/
https://github.com/mpastell/Weave.jl

I am trying to find a simple across protocal language, working with ROS 
there tends to be python, c, c++, julia and lua possibly R. So is there 
something that works regardless? 

-Thx


On Monday, 6 May 2013 15:57:04 UTC+2, Amuthan A. Ramabathiran wrote:
>
> Hello,
>
> I'm looking for documentation generators that can extract documentation 
> from a Julia code (similar to Doxygen). I tried using sphinx, but have not 
> been able to do the comment extraction part (its pretty cool otherwise). 
> Any pointers on this?
>
> (I tried jocco too, but haven't been so successful with it.)
>
> Thanks,
> Amuthan.
>


[julia-users] Re: Changing the version of Julia when needed

2016-05-10 Thread kleinsplash

I just removed that ppa and went back to juliareleases

On Tuesday, 10 May 2016 13:42:19 UTC+2, kleinsplash wrote:
>
> I am stuck between a bit of a rock and a hard place. 
>
> I would like to use PCL: https://github.com/JuliaPCL/PCL.jl but this does 
> not install on 0.4
>
> But I may be able to use the FunctionDataUtils package in its place. 
> Juno/Atom doesnt seem to play nice with 0.5 either so best is to just 
> revert at the moment. 
>
> I updated (upgraded) by adding nightly builds ppa. 
>
> On Tuesday, 10 May 2016 13:16:01 UTC+2, Tony Kelman wrote:
>>
>> How did you install 0.5? If you're new to thr language things will be 
>> more stable on 0.4, but you can install both in parallel.
>
>

[julia-users] Re: Changing the version of Julia when needed

2016-05-10 Thread kleinsplash
I am stuck between a bit of a rock and a hard place. 

I would like to use PCL: https://github.com/JuliaPCL/PCL.jl but this does 
not install on 0.4

But I may be able to use the FunctionDataUtils package in its place. 
Juno/Atom doesnt seem to play nice with 0.5 either so best is to just 
revert at the moment. 

I updated (upgraded) by adding nightly builds ppa. 

On Tuesday, 10 May 2016 13:16:01 UTC+2, Tony Kelman wrote:
>
> How did you install 0.5? If you're new to thr language things will be more 
> stable on 0.4, but you can install both in parallel.



[julia-users] Changing the version of Julia when needed

2016-05-10 Thread kleinsplash
Hi,

How do I point to the version of Julia I would like to use? 

For example: I would like to use this package: FunctionalDataUtils 
 but its only available on 
0.4. How do I revert without having to uninstall 0.5 or use Compat.jl which 
looks rough for a newbie. 

Thx 


[julia-users] Re: Reproducible research for Julia

2016-05-05 Thread kleinsplash
@James: Guess that earns me a necro badge - in my defence I have just come 
across R and RStudio and the idea of updating images on the fly looked 
good. But then if its taken days to produce... Sports...um.. either 
quidditch or ladies night at the local bar. 
I am writing a rather large document using lyx and latex and was thinking 
of jython with a hint of markdown, maybe I will further procrastinate by 
looking at Weave. 

@tshort - Judo looks good too.. 

Thanks for the update :)

On Thursday, 9 May 2013 16:35:39 UTC+2, Stephen Eglen wrote:
>
> Hi,
>
> Coming from R, I've got used to the great Sweave/knitr system for 
> combining latex and R code in the same document, using noweb markup.  Is 
> there anything similar yet for Julia?  Or is there something similar using 
> markdown to embed Julia code into documentation?
>
> Thanks, Stephen
>


[julia-users] Re: Reproducible research for Julia

2016-05-05 Thread kleinsplash

Is there an update on these thoughts? Because that link doesnt work 
anymore.. 
On Thursday, 9 May 2013 16:35:39 UTC+2, Stephen Eglen wrote:
>
> Hi,
>
> Coming from R, I've got used to the great Sweave/knitr system for 
> combining latex and R code in the same document, using noweb markup.  Is 
> there anything similar yet for Julia?  Or is there something similar using 
> markdown to embed Julia code into documentation?
>
> Thanks, Stephen
>


[julia-users] Re: Help with MXNet AssertionError: get_batch_size(opts.eval_data) == batch_size

2016-04-15 Thread kleinsplash
still having this issue - any ideas?

On Monday, 11 April 2016 15:58:03 UTC+2, kleinsplash wrote:
>
> $ julia G3DB_cnn.jl 
> (128,128,1,800)
> (128,128,1,200)
> INFO: Start training on [GPU0]
> INFO: Initializing parameters...
> INFO: Creating KVStore...
> INFO: Start training...
> INFO: == Epoch 001 ==
> INFO: ## Training summary
> INFO:   accuracy = 0.5638
> INFO:   time = 1.9078 seconds
> ERROR: LoadError: AssertionError: get_batch_size(opts.eval_data) == 
> batch_size
>  in fit at /home/ashley/.julia/v0.4/MXNet/src/model.jl:482
>  in include at ./boot.jl:261
>  in include_from_node1 at ./loading.jl:304
>  in process_options at ./client.jl:280
>  in _start at ./client.jl:378
>
>
> Could someone help me understand the above? I dont have many data so my 
> batch_size is 0. Trying to get to the predicted values.. 
>
> Thx
>


[julia-users] Help with MXNet AssertionError: get_batch_size(opts.eval_data) == batch_size

2016-04-11 Thread kleinsplash
$ julia G3DB_cnn.jl 
(128,128,1,800)
(128,128,1,200)
INFO: Start training on [GPU0]
INFO: Initializing parameters...
INFO: Creating KVStore...
INFO: Start training...
INFO: == Epoch 001 ==
INFO: ## Training summary
INFO:   accuracy = 0.5638
INFO:   time = 1.9078 seconds
ERROR: LoadError: AssertionError: get_batch_size(opts.eval_data) == 
batch_size
 in fit at /home/ashley/.julia/v0.4/MXNet/src/model.jl:482
 in include at ./boot.jl:261
 in include_from_node1 at ./loading.jl:304
 in process_options at ./client.jl:280
 in _start at ./client.jl:378


Could someone help me understand the above? I dont have many data so my 
batch_size is 0. Trying to get to the predicted values.. 

Thx


[julia-users] Simple confusion matrix MXNet

2016-04-11 Thread kleinsplash
Hi,

I have managed to build a simple classifier. I would like to make a 
confusion matrix - simple enough. How do I access the predicted labels?

Thx


[julia-users] Re: MXNet setting workspace, Convolutional layers, kernels etc

2016-04-08 Thread kleinsplash
Getting `ERROR: LoadError: UndefVarError: @mxcall not defined` which is 
odd.. 

On Friday, 8 April 2016 10:18:03 UTC+2, kleinsplash wrote:
>
> Hi,
>
> I reduced the workspace to 1024 and batch_size to 1 - I get the memory 
> error same as before. I went back to using the whole batch and its running 
> again. 
>
> Thx for the other stuff will look into that now.. 
>
>
>
> On Friday, 8 April 2016 09:53:18 UTC+2, Valentin Churavy wrote:
>>
>> Also take a look at https://github.com/dmlc/MXNet.jl/pull/73 where I 
>> implemented debug_str in Julia so that you can test your network on its 
>> space requirements.
>>
>> On Friday, 8 April 2016 15:54:06 UTC+9, Valentin Churavy wrote:
>>>
>>> What happens if you set the batch_size to 1? Also take a look at 
>>> https://github.com/dmlc/mxnet/tree/master/example/memcost
>>>
>>> Also workspace is per convolution and you should keep it small.  
>>>
>>> On Thursday, 7 April 2016 19:13:36 UTC+9, kleinsplash wrote:
>>>>
>>>> Hi,
>>>>
>>>> I have a memory error using Quadro K5000M which has 4GB global memory. 
>>>> I was wondering if there is some guide as to how to set my workspace and 
>>>> Convolutional layers.
>>>>
>>>> My current settings: 
>>>>
>>>> training_data =  128x128x1x800
>>>> batch_size = 128x128x1x8
>>>> workspace = 2048 (I think this can go up to 4096 because of the 
>>>> .deviceQuery)
>>>>
>>>> This is my net (still to be designed so just basic ):
>>>>
>>>> # first conv
>>>> conv1 = @mx.chain mx.Convolution(data=data, kernel=(5,5), num_filter=20
>>>> , workspace=workspace)  =>
>>>>   mx.Activation(act_type=:relu) =>
>>>>   mx.Pooling(pool_type=:max, kernel=(2,2), stride=(2,2
>>>> ))
>>>> # second conv
>>>> conv2 = @mx.chain mx.Convolution(data=conv1, kernel=(5,5), num_filter=
>>>> 50, workspace=workspace) =>
>>>>   mx.Activation(act_type=:relu) =>
>>>>   mx.Pooling(pool_type=:max, kernel=(2,2), stride=(2,2
>>>> ))
>>>>   # first fully-connected
>>>> fc1   = @mx.chain mx.Flatten(data=conv2) =>
>>>>   mx.FullyConnected(num_hidden=500) =>
>>>>   mx.Activation(act_type=:relu)
>>>> # second fully-connected
>>>> fc2   = mx.FullyConnected(data=fc1, num_hidden=10) 
>>>> # third fully-connected
>>>> fc3   = mx.FullyConnected(data=fc2, num_hidden=2) 
>>>> # softmax loss
>>>> net = mx.SoftmaxOutput(data=fc3, name=:softmax)
>>>>
>>>> So far if I reduce my image to 28x28 it all works - but I need to up 
>>>> the resolution to pick out features. Anyone have any ideas on thumb 
>>>> sucking 
>>>> initial values for at least getting past memory issues to the design of 
>>>> the 
>>>> net? 
>>>>
>>>>
>>>> Thx
>>>>
>>>>

[julia-users] Re: How solve this issue when I run Pkg.add("xx") is broken?

2016-04-07 Thread kleinsplash

That is when its a new package I get the source and check it out to Julia's 
directory.. and then update etc.. 

On Thursday, 7 April 2016 12:15:13 UTC+2, kleinsplash wrote:
>
>
> I havent found a way to do this through Julia - I go into the 
> ~/.julia/vX.X/Package/ file and use git rebase or stash and checkout etc.. 
>
> On Tuesday, 29 March 2016 14:34:40 UTC+2, Qi Wei wrote:
>>
>> How solve this issue when I run Pkg.add("xx") is broken? Like Conda, I 
>> use the command"conda clean --lock", these unfinished files are clean. 
>> I want to know that how to use to clean cache files using Julia?
>>
>

[julia-users] Re: How solve this issue when I run Pkg.add("xx") is broken?

2016-04-07 Thread kleinsplash

I havent found a way to do this through Julia - I go into the 
~/.julia/vX.X/Package/ file and use git rebase or stash and checkout etc.. 

On Tuesday, 29 March 2016 14:34:40 UTC+2, Qi Wei wrote:
>
> How solve this issue when I run Pkg.add("xx") is broken? Like Conda, I use 
> the command"conda clean --lock", these unfinished files are clean. I 
> want to know that how to use to clean cache files using Julia?
>


[julia-users] MXNet setting workspace, Convolutional layers, kernels etc

2016-04-07 Thread kleinsplash
Hi,

I have a memory error using Quadro K5000M which has 4GB global memory. I 
was wondering if there is some guide as to how to set my workspace and 
Convolutional layers.

My current settings: 

training_data =  128x128x1x800
batch_size = 128x128x1x8
workspace = 2048 (I think this can go up to 4096 because of the 
.deviceQuery)

This is my net (still to be designed so just basic ):

# first conv
conv1 = @mx.chain mx.Convolution(data=data, kernel=(5,5), num_filter=20, 
workspace=workspace)  =>
  mx.Activation(act_type=:relu) =>
  mx.Pooling(pool_type=:max, kernel=(2,2), stride=(2,2))
# second conv
conv2 = @mx.chain mx.Convolution(data=conv1, kernel=(5,5), num_filter=50, 
workspace=workspace) =>
  mx.Activation(act_type=:relu) =>
  mx.Pooling(pool_type=:max, kernel=(2,2), stride=(2,2))
  # first fully-connected
fc1   = @mx.chain mx.Flatten(data=conv2) =>
  mx.FullyConnected(num_hidden=500) =>
  mx.Activation(act_type=:relu)
# second fully-connected
fc2   = mx.FullyConnected(data=fc1, num_hidden=10) 
# third fully-connected
fc3   = mx.FullyConnected(data=fc2, num_hidden=2) 
# softmax loss
net = mx.SoftmaxOutput(data=fc3, name=:softmax)

So far if I reduce my image to 28x28 it all works - but I need to up the 
resolution to pick out features. Anyone have any ideas on thumb sucking 
initial values for at least getting past memory issues to the design of the 
net? 


Thx



[julia-users] Using PyPlot to work with obj files, noob question on arrays

2016-03-08 Thread kleinsplash
Hi,

I want to just load a mesh and plot it along with a bunch of other data on 
one plot. Just simple plotting. I have a way that's working but it's just 
wrong: 


mesh = load(obj)

#mesh = HomogenousMesh(normals: 420xGeometryTypes.Normal{3,Float32}, 
vertices: 420xFixedSizeArrays.Point{3,Float32}, faces: 
840xGeometryTypes.Face{3,UInt32,-1}, )
#typeof(mesh) = 
GeometryTypes.HomogenousMesh{FixedSizeArrays.Point{3,Float32},GeometryTypes.Face{3,UInt32,-1},GeometryTypes.Normal{3,Float32},Void,Void,Void,Void}

# inefficient way of finding the number
x=0
for v in mesh.vertices
x+=1
end 
# set up array with verticies 
vert = Array{Float32}(x,3)
# map to new array 
for i = 1:x
vert[i,:] = [mesh.vertices[i][1], mesh.vertices[i][2], mesh.vertices[i][
3]]
end 
#plot with PyPlot
plot_wireframe(vert[:,1], vert[:,2], vert[:,3])

length(mesh.verticies) doesn't work, and I haven't figured out how to 
instantiate an empty Array without having the dimensions. 


Any help would be much appreciated. 

Thx


[julia-users] Re: citing Julia

2016-02-04 Thread kleinsplash
How about citing a specific package? 

On Wednesday, 17 July 2013 03:13:24 UTC+2, georgiana wrote:
>
> Is there a suggested way to cite Julia if used for a publication?
>  
> Georgiana
>


[julia-users] Re: Resources for GLAbstraction and the PerspectiveCamera method

2016-01-13 Thread kleinsplash
Thank you so very much :) 

On Tuesday, 12 January 2016 18:18:48 UTC+2, Simon Danisch wrote:
>
> In the case of GLAbstraction, with it's missing Documentation, it's best 
> to just open an issue there!
>
> I did that for you:  https://github.com/JuliaGL/GLAbstraction.jl/issues/33
>
>
> Am Dienstag, 12. Januar 2016 14:06:45 UTC+1 schrieb kleinsplash:
>>
>> Hi,
>>
>> Is there an API or somewhere I can find info on the args of 
>> PerspectiveCamera? Specifically for theta, translation, zoom, FOV and clip 
>> distances. I know my understanding is not up to scratch because translation 
>> and eyeposition seem similar, along with eyeposition and translation, zoom 
>> and FOV etc.. Basically I am just confusing myself with what needs to go 
>> where and ending up with a blank image render. 
>>
>> https://github.com/JuliaGL/GLAbstraction.jl/blob/master/src/GLCamera.jl
>>
>> Thx
>>
>  
>


[julia-users] Help with using GPU backend and Mocha

2016-01-13 Thread kleinsplash
Hi, 

Pkg.test("Mocha") works for CPU.


But now I want to use my GPU backend; I set ENV["MOCHA_USE_CUDA"] = "true"

I find the device no issues 
* CUDA enabled [DEV=0] (MOCHA_USE_CUDA environment variable detected)

But I get the error: 

ERROR: LoadError: ccall: could not find function cublasCreate_v2 in library 
from here: Mocha/src/cuda/cublas.jl:50


EDIT: after a couple days of Pkg.update() I now have the error: 
ERROR: LoadError: ccall: could not find function cudnnCreate in library

Should I be linking libraries at runtime? how do I do that using Julia? I 
have put this on the issues list at Mocha (
https://github.com/pluskid/Mocha.jl/issues/172https://github.com/pluskid/Mocha.jl/issues/172
 
) - but I am wondering if 
it's just my noob status rather than an issue. 


Thx


[julia-users] Resources for GLAbstraction and the PerspectiveCamera method

2016-01-12 Thread kleinsplash
Hi,

Is there an API or somewhere I can find info on the args of 
PerspectiveCamera? Specifically for theta, translation, zoom, FOV and clip 
distances. I know my understanding is not up to scratch because translation 
and eyeposition seem similar, along with eyeposition and translation, zoom 
and FOV etc.. Basically I am just confusing myself with what needs to go 
where and ending up with a blank image render. 

https://github.com/JuliaGL/GLAbstraction.jl/blob/master/src/GLCamera.jl

Thx


[julia-users] Re: Help needed with understanding types and arguments re: methods(Complex)

2015-12-23 Thread kleinsplash
Thanks guys! that makes a lot more sense.. 

On Tuesday, 22 December 2015 14:49:19 UTC+2, kleinsplash wrote:
>
> Hi,
>
>
> I am working through a tutorial and have come across this line: 
>
>
> call{T<:Real}(::Type{Complex{T<:Real}}, re::T<:Real, im::T<:Real) at 
> complex.jl:4
>
> when running: 
>
>
> methods(Complex)
>
> I think it says:
>
>
> when calling Complex() you can provide two inputs either a value T which must 
> be a subtype of type abstract type Real OR ?? 
>
>
> So an example would be:
>
>
> Complex(10) or Complex(5,1)
>
>
> Is this correct?
>
>
> -Thank you
>
>

[julia-users] Help needed with understanding types and arguments re: methods(Complex)

2015-12-22 Thread kleinsplash


Hi,


I am working through a tutorial and have come across this line: 


call{T<:Real}(::Type{Complex{T<:Real}}, re::T<:Real, im::T<:Real) at 
complex.jl:4

when running: 


methods(Complex)

I think it says:


when calling Complex() you can provide two inputs either a value T which must 
be a subtype of type abstract type Real OR ?? 


So an example would be:


Complex(10) or Complex(5,1)


Is this correct?


-Thank you



[julia-users] Re: Help needed with understanding types and arguments re: methods(Complex)

2015-12-22 Thread kleinsplash
Thanks. Though its more this ::Type{Complex{T<:Real}} that is confusing 
me.. what does it mean? Is ::Type{} casting a Complex number? So do you 
then have to say something like Complex(self, realpart, imagpart)?


On Tuesday, 22 December 2015 16:27:36 UTC+2, Jeffrey Sarnoff wrote:
>
> Think of Complex as complex number factory.  As with any factory, this one 
> takes in some raw material, one or two numbers that are some subtype of 
> Real, and produces its product -- a Complex number.
> And this makes sense mathematically; Real numbers are 'real number part' 
> of Complex numbers, so we expect Complex(5) to be the Complex number with a 
> real number part of 5 and an imaginary number part of 0:
>
> julia> Complex(5)
> 5 + 0im
>
> Using two Real numbers, one for real part of the Complex number and the 
> other for imaginary part also makes sense because once we isolate the real 
> and imaginary parts, this happens:
>
> julia> a = Complex(5,4); a, typeof(a)
> 5 + 4im, Complex{Int64}   # or Complex{Int32}, depending on your system
> julia> firstnumber,secondnumber = a.re, a.im
> (5,4)
> julia> typeof(firstnumber), typeof(secondnumber)
> Int64, Int64 
>
> and Integers are a subtype of Real
> Try the same steps using 5.0 and 4.0
>
>
>
>
>
> On Tuesday, December 22, 2015 at 7:49:19 AM UTC-5, kleinsplash wrote:
>>
>> Hi,
>>
>>
>> I am working through a tutorial and have come across this line: 
>>
>>
>> call{T<:Real}(::Type{Complex{T<:Real}}, re::T<:Real, im::T<:Real) at 
>> complex.jl:4
>>
>> when running: 
>>
>>
>> methods(Complex)
>>
>> I think it says:
>>
>>
>> when calling Complex() you can provide two inputs either a value T which 
>> must be a subtype of type abstract type Real OR ?? 
>>
>>
>> So an example would be:
>>
>>
>> Complex(10) or Complex(5,1)
>>
>>
>> Is this correct?
>>
>>
>> -Thank you
>>
>>

[julia-users] Noob question on array = 502-elementArray{FixedSizeArrays.Point{3,Float32},1}

2015-12-18 Thread kleinsplash
This is a 1D array, each of the 502 elements is 
a FixedSizeArrays.Point{3,Float32} with 3 values. How do I access the 
values? 



Re: [julia-users] Noob question on array = 502-elementArray{FixedSizeArrays.Point{3,Float32},1}

2015-12-18 Thread kleinsplash
Awesome! the reinterpret did it.. very much appreciated. 

On Friday, 18 December 2015 13:42:15 UTC+2, Tim Holy wrote:
>
> Try x[17][2]. Also, if you're not familiar with it, the `reinterpret` 
> function 
> can sometimes be your friend---you can use it to convert between a 
> Vector{Point{3}} and a matrix of size 3-by-502 without copying the memory 
> (though it allocates a bit for the "wrapper"). 
>
> Best, 
> --Tim 
>
> On Friday, December 18, 2015 01:17:57 AM kleinsplash wrote: 
> > This is a 1D array, each of the 502 elements is 
> > a FixedSizeArrays.Point{3,Float32} with 3 values. How do I access the 
> > values? 
>
>

[julia-users] Using sub2ind()

2015-11-27 Thread kleinsplash
Hi - any thoughts are welcome: 

In matlab I do this:

bins = sub2ind(size(Iview),I(1,:),I(2,:));
Iview(bins) = dists;

imagesc(Iview)

where
size(Iview) = 300x300
size(bins) = 1x1000
size(dists)  = 1x1000

It looks like it should be similar in Julia, but its not working: 

bins = sub2ind(size(Iview), I[1,:], I[2,:])
Iview[bins] = dists
spy(Iview)

I get this error:

ERROR: LoadError: MethodError: `sub2ind` has no method matching 
sub2ind(::Tuple{Int64,Int64}, ::Array{Int64,2}, ::Array{Int64,2}) 

I tried looping through - but then not sure what my dims should be?










[julia-users] Re: Using sub2ind()

2015-11-27 Thread kleinsplash
I solved my issue with this:

`bins = sub2ind(size(Iview), vec(I[1,:]), vec(I[2,:]))`

Only took half the day to figure that out - must be a Friday. 



On Friday, 27 November 2015 12:41:32 UTC+2, kleinsplash wrote:
>
> Hi - any thoughts are welcome: 
>
> In matlab I do this:
>
> bins = sub2ind(size(Iview),I(1,:),I(2,:));
> Iview(bins) = dists;
>
> imagesc(Iview)
>
> where
> size(Iview) = 300x300
> size(bins) = 1x1000
> size(dists)  = 1x1000
>
> It looks like it should be similar in Julia, but its not working: 
>
> bins = sub2ind(size(Iview), I[1,:], I[2,:])
> Iview[bins] = dists
> spy(Iview)
>
> I get this error:
>
> ERROR: LoadError: MethodError: `sub2ind` has no method matching 
> sub2ind(::Tuple{Int64,Int64}, ::Array{Int64,2}, ::Array{Int64,2}) 
>
> I tried looping through - but then not sure what my dims should be?
>
>
>
>
>
>
>
>
>

[julia-users] Re: Ray tracing for complex geometry

2015-11-24 Thread kleinsplash
I think thats useful, especially if you are doing object detection and 
avoidance on a mobile platform. I wont be able to use it right this minute, 
but pretty sure the guys at MoveIt! could. 

On Tuesday, 24 November 2015 16:27:05 UTC+2, Andre Bieler wrote:
>
> @Simon
> GLVisualize looks great! I ll try using it as soon as there
> is an opportunity. (and then bother you with questions.. ;) )
>
> @kleinsplash
> Not sure if those meshing libraries are the right place to put my stuff.
>
> I didnt even know about all these packages until I posted my answer
> here. I will get rid of my custom mesh loading prcedures and start
> using whats already available.
>
> On a somewhat related note. I do have an Octree implementation
> in Julia which I use for meshing/partitioning of 3D domains, maybe
> that could be interesting for someone?
> It generates an octree around triangulated surface meshes.
> E.g. here
> https://github.com/abieler/dsmc/blob/master/doc/cow_mesh2.png
>
> If there is interest I d be happy to share/clean up my code.
>
>
>

[julia-users] Re: Using Meshes.ji

2015-11-24 Thread kleinsplash
That cat is awesome. And so is the script thank you. The only thing is my 
screen comes up really small and I cant zoom in. This is as far as it goes: 



That is a wine glass. I want it bigger so I can fill it with virtual wine 
:) 

Thank you! I doubt I would have gotten to those mapping options right. 

Side Note: I am getting a warning from glscreen() saying: WARNING: 
Base.Uint8 is deprecated, use UInt8 instead.


On Tuesday, 24 November 2015 14:10:09 UTC+2, Simon Danisch wrote:
>
> This is the best GLVisualize can do for you right meow:
>
>
> <https://lh3.googleusercontent.com/-F3zwOjXImQc/VlRP0Xt6P2I/LMs/5hcFMkQdGiU/s1600/Selection_023.png>
>
>
> You get this with:
>
>
>
> using GLVisualize, FileIO, Colors, GeometryTypes, GLAbstraction
> window, renderloop = glscreen()
> obj = load("cat.obj")
> obj_vizz = visualize(obj, color=RGBA{Float32}(0,0,0,0.1))
> point3d_vizz = visualize(vertices(obj), scale=Vec3f0(0.01))
> axis = visualize(boundingbox(point3d_vizz).value, :grid)
> view(obj_vizz)
> view(point3d_vizz)
> view(axis)
> renderloop()
>
> A lot of improvements are on its way (like better camera, more consistent 
> API and better axis), but this is still not out yet.
>
> I'm not sure what would be possible with a combination of MeshIO and e.g. 
> PyPlot, but I guess it could be better axis/labels + print quality, while 
> being slower ;)
> You quite likely need to do something like:
>
> points = vertices(obj) #GeometryTypes exports vertices(...)
> x,y,z = [p[1] for p in points], map(p->p[2], points), map(last, points) # 
> three different ways of getting the x,y,z coordinates
>
> and then go from there with the PyPlot/matplotlib docs.
>
>
> Am Montag, 9. November 2015 15:55:57 UTC+1 schrieb kleinsplash:
>
>
> Am Montag, 9. November 2015 15:55:57 UTC+1 schrieb kleinsplash:
>>
>> 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
>>
>>
>>

Re: [julia-users] Re: Ray tracing for complex geometry

2015-11-24 Thread kleinsplash

Hi, 

@Simon Danish. So posted issue as suggested:  new issue 
. Have tried the 
screenshot(window, path="screenshot.png") and get ArgumentError: function 
screenshot does not accept keyword arguments. Where window = 
visualize(obj). Obviously I need to go back and look at the documentation. 

@Andre Bieler this is awesome! thank you - just what I was looking for - 
you should add it to something, anything. Not sure if that be Meshes.jl, 
MeshIO.jl or Meshing.jl. 

As a side note: I was directed toward using Barycentric_coordinate_system 
 something 
like accurate-point-in-triangle-test.html 
  
But will be looking at yours first. 
@Steve Kelly thanks - needed that pep talk. And it was easy we probably 
wouldn't be doing it. 


On Tuesday, 24 November 2015 06:11:15 UTC+2, Andre Bieler wrote:
>
> I dont know if this is still needed. But I think I did a similar thing a 
> while ago.
>
> One difference being I used .ply files instead of .obj files.
> From what I understand it should be straight forward to transform .obj to 
> .ply
> with something like paraview or meshlab.
> (It has to be ascii .ply for my example to work)
>
> Attached is an example script that computes the intersection point of a 
> line of sight
> and a collection of triangles (your surface mesh I assume)
> it returns the index of the triangle which is intersected and the 
> coordinates of the
> point of intersection.
>
> If multiple triangles are intersected it returns the index and coordinates 
> of the closest
> triangle.
>
> if no intersection is found it returns -1 as index and [0,0,0] as the 
> intersection point
> (this is to have the function return type stable)
>
> I attached a zip archive containing the necessary julia file and an example
> .ply file of a triangulated cow :)
>
> All you have to define is the starting point of the line of sight "pStart"
> and the direction towards it is pointing "r".
> "r" has to be a unit vector
>
>
> Any comments are welcome.
>
> Cheers
> Andre
>
>
>

[julia-users] Re: ERROR: LoadError: UndefVarError: mesh not defined. using MeshIO

2015-11-24 Thread kleinsplash
Thanks. Will keep those in mind. 

On Monday, 23 November 2015 20:19:15 UTC+2, Simon Danisch wrote:
>
> Well, it's load, not mesh... 
> I admit, the Readme is not very helpfull. 
> By the way, the REPL with typeof(), xdump(), println(), methodswith() and 
> auto completion are your friend when it comes to figuring out how a type 
> works. 
>
> Am Montag, 23. November 2015 15:38:44 UTC+1 schrieb kleinsplash: 
> > My aim is to load an object file and access its faces, vertices and 
> normals. 
> > 
> > My current code: 
> > 
> > 
> > 
> > using FileIO 
> > using GLVisualize 
> > using MeshIO 
> > 
> > obj_file = "path_to_obj/file.obj" 
> > mesh(obj_file) 
> > I am getting the error: 
> > 
> > ERROR: LoadError: UndefVarError: mesh not defined 
> >  in include at ./boot.jl:261 
> >  in include_from_node1 at ./loading.jl:304 
> >  in process_options at ./client.jl:280 
> >  in _start at ./client.jl:378 
> > 
> > Am I calling the mesh fxn incorrectly? 
>
>

Re: [julia-users] Using Meshes.ji

2015-11-24 Thread kleinsplash
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
>>>>
>>>>
>>>>

[julia-users] Re: Ray tracing for complex geometry

2015-11-23 Thread kleinsplash
Thank you. 

Apologies, I struggle trying to explain myself at the best of times. 

I have a number of virtual objects (*.obj) I want to get ~1000 depth images 
from x angles. I used the pinpoint camera approximation only to find that 
the obj files had so view vertices that getting reasonable depth 
information was not feasible. So I can do two things - figure out how to 
make my mesh more dense (surface fitting or re-sampling) or do ray tracing 
so that I can obtain points wherever my rays intersect with the faces of my 
virtual object. 

I will then be using these depth images as input for a convolutional neural 
net. 

 

On Monday, 23 November 2015 11:20:28 UTC+2, Simon Danisch wrote:
>
> I'm still confused about what you want.
> Google says:
> "In computer graphics, ray tracing is a technique for generating an Image 
> by tracing the path of light through pixels in an image plane and 
> simulating the effects of its encounters with virtual objects." which is 
> pretty much what I understand under ray tracing.
> So what is your goal? Usually ray tracing is used when you want a 
> realistically lit render(plot) of a 3d scene, or if you have some 
> implicitely defined geometry ( like steve kelly pointed out).
> Usually you have a mesh in an obj file, which you would only ray trace 
> when you need photo realism (since it's way slower then any other 
> displaying method).
> I'm really unsure, why you want to get out a 3d matrix in the end. Do you 
> want to compute a lightfield?! Or do you want to have an interpolated voxel 
> representation of that mesh in a dense volume? This is probably not what 
> you really want and also not what a ray tracer produces.
> The last thing I can imagine is, that you actually have only 
> vertices(points) in your obj file without any faces, which then wouldn't 
> really show up in a plot, so that you started assuming it's not dense 
> enough. I wouldn't call pointclouds a complex geometry though, since its 
> one of the most simplest.
> If that's the case, you should just visualize them as particles.
> Here is how you would do that in GLVisualize:
> Using FileIO, GLVisualize
> obj = load("pathtoobj.obj")
> points = vertices(obj)
> w,r = glscreen()
> view(visualize(points))
> r()
>
> If you have problems with that example, please file an issue on github 
> under GLVisualize.jl.
>
>
> Best,
> Simon
>
>

Re: [julia-users] Ray tracing for complex geometry

2015-11-23 Thread kleinsplash
Thanks a stack. The geometry is defined in a mesh file .obj. Consisting of 
vertices and faces. The objects are complex, so any primitive ray-tracing 
is most likely not going to work. My challenge is that my obj files are 
just not dense enough. If they were I could use the vertices no problem. So 
I either increase the density of the mesh, or ray-trace. 

My outline:

load obj file
set camera angle(random range something like 0-2/pi) 
set focal length(random range)
ray-trace(~1000 points - much greater than the number of vertices I have)
plot the view of the object(just for visual confirmation)
hold 3D matrix of view (x,y,z) or (x,y,ind) 


On Friday, 20 November 2015 18:45:55 UTC+2, Steve Kelly wrote:
>
> How is your geometry defined? If it is an implicit function, ShaderToy.jl 
> (built on GLVisualize) has a raymarching example. 
> https://github.com/SimonDanisch/ShaderToy.jl/blob/master/examples/rayprimitive.frag
>  
>
> The method can be generalized to generating distance fields, but I haven't 
> gotten to it yet. I'd also recommend taking a look at the link in the 
> comments. Inigo has some great stuff on ray tracing techniques for the GPU.
>
> I've been working on a solid modeler that makes describing primitives as 
> functions much easier. 
> https://github.com/FactoryOS/Descartes.jl/tree/master/examples The 
> eventual goal is to get all the geometric realization code on the GPU (SDFs 
> and Dual Contours). 
> On Nov 20, 2015 11:15 AM, "Tom Breloff" <t...@breloff.com > 
> wrote:
>
>> Could you describe a little more about your use-case?  I'm not sure that 
>> ray-tracing is necessarily what you want if you're displaying point 
>> clouds.  I would check out GLVisualize.jl as a first step.
>>
>> On Fri, Nov 20, 2015 at 10:18 AM, kleinsplash <kleinhan...@gmail.com 
>> > wrote:
>>
>>> I was wondering if someone could help me out with a decision/offer an 
>>> opinion:
>>>
>>> I need a ray tracer that deals with complex geometry (a fast ray tracer 
>>> that can create 1000's of point clouds in minimal time) 
>>> Python has methods: http://pyopengl.sourceforge.net/ that I could get 
>>> to grips with. But I want to stick with Julia. 
>>>
>>> I have found these resources: 
>>> https://github.com/JuliaGL/ModernGL.jl - not sure if this has a ray 
>>> tracing option
>>> http://www.cs.columbia.edu/~keenan/Projects/QuaternionJulia/ - looks 
>>> crazy complicated
>>>
>>> https://github.com/JuliaLang/julia/blob/master/test/perf/kernel/raytracer.jl
>>>  
>>> - looks like only handles simple geometry
>>>
>>> Could someone point me in the right direction?
>>>
>>>  
>>>
>>
>>

Re: [julia-users] Using Meshes.ji

2015-11-23 Thread kleinsplash
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"  > 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
>>
>>
>>

Re: [julia-users] Using Meshes.ji

2015-11-23 Thread kleinsplash
Thanks guys :)

On Tuesday, 10 November 2015 13:20:44 UTC+2, Rohit Thankachan wrote:
>
> I've made a few changes to the file Steve pointed you to. It can be found 
> at https://gist.github.com/rohitvarkey/5be4542faff17014afc7.
>
> If you use Escher to run that file, you can load .obj files by just typing 
> in the filename (provided you ran the Escher server from the directory the 
> file exists) or the absolute path to the file in the input field. A very 
> primitive mesh viewer in Julia I guess. :)
>
> Regards,
> Rohit  
>
> On Monday, 9 November 2015 22:15:01 UTC+5:30, 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"  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
>>>
>>>
>>>

[julia-users] Re: Ray tracing for complex geometry

2015-11-23 Thread kleinsplash
Nope. I have obj files. Your hypothesis is correct. I have attached one of 
them. Your script works just fine (is there an easy way to save this 
image?). 

As a side note: I do collect point clouds using V-REP, and I can generate 
pointclouds (pcd) using pcl - but I want to work with the obj mesh files 
because the clouds are too sparse. 

I probably could have explained myself better, point taken. I will aim to 
try harder next time, I feel horrid when I am asking basic questions and on 
top of that writing an essay. 

The only other person I know who uses the term interwebz is Richard on Fast 
and Loud - I am an avid supporter. 

On Monday, 23 November 2015 13:41:40 UTC+2, Simon Danisch wrote:
>
> I'm not sure what you mean by virtual objects. Obj is in the context of 3D 
> objects is usually the wavefront 
> <https://en.wikipedia.org/wiki/Wavefront_.obj_file> format.
> If you have an object database with *.obj's in it, the probability is very 
> high, that you don't have pointclouds whatsoever.
> You can try this, to confirm my hypothesis:
>
> using GLVisualize, FileIO
> obj = load("file.obj")
> w,r = glscreen()
> view(visualize(obj))
> r()
>
> Or just download any obj viewer from the interwebzz and look at that 
> thing. 
> If you have nice smooth surfaces, you're getting it all wrong with the 
> pointclouds and ray tracing.
> I could give you some hacky way of extracting depth images with 
> GLVisualize, if that's what you're after.
> In that case, just try the example above and if that works, open an issue 
> at GLVisualize that you want depth images. Then we can take it from there.
>
>
> If by any chance you DO have pointclouds stored in an obj file, things are 
> more complicated since you then need to approximate the surface of that 
> cloud.
> Still, raytracing wouldn't be your friend ;) If you have infinitely small 
> points, there is no magic that lets a ray hit these points any better then 
> some other visualization algorithm.
> Even if it's really dense, you still have infinitely small points. You can 
> treat the points as particles, to give them some "body" that you can 
> see, but then it's not really a surface anymore.
>
> Just google for pointcloud surface approximation and see where that gets 
> you.
>
> I'm guessing here, that you have some sensor that outputs depth images and 
> you want to recognize objects in these depth images.
> To train your depth image classifier, you need depth images from a lot of 
> perspectives from a lot of random 3D objects, which is why you searched for 
> a 3D object database, which got you to the obj files of random 3D objects.
>
> It'd have been a lot easier, if you just stated this in your problem 
> description, probably even with links to the obj database.
>
> Best,
> Simon
>
> Am Freitag, 20. November 2015 16:18:46 UTC+1 schrieb kleinsplash:
>>
>> I was wondering if someone could help me out with a decision/offer an 
>> opinion:
>>
>> I need a ray tracer that deals with complex geometry (a fast ray tracer 
>> that can create 1000's of point clouds in minimal time) 
>> Python has methods: http://pyopengl.sourceforge.net/ that I could get to 
>> grips with. But I want to stick with Julia. 
>>
>> I have found these resources: 
>> https://github.com/JuliaGL/ModernGL.jl - not sure if this has a ray 
>> tracing option
>> http://www.cs.columbia.edu/~keenan/Projects/QuaternionJulia/ - looks 
>> crazy complicated
>>
>> https://github.com/JuliaLang/julia/blob/master/test/perf/kernel/raytracer.jl 
>> - looks like only handles simple geometry
>>
>> Could someone point me in the right direction?
>>
>>  
>>
>

42_wineglass_final-29-Oct-2015-10-38-19.obj
Description: Binary data


Re: [julia-users] Ray tracing for complex geometry

2015-11-23 Thread kleinsplash
Not sure if you get other comments, please forgive me if this generates two 
mails in your inbox. Please see my answer to Steve Kelly below. 

On Friday, 20 November 2015 18:15:35 UTC+2, Tom Breloff wrote:
>
> Could you describe a little more about your use-case?  I'm not sure that 
> ray-tracing is necessarily what you want if you're displaying point 
> clouds.  I would check out GLVisualize.jl as a first step.
>
> On Fri, Nov 20, 2015 at 10:18 AM, kleinsplash <kleinhan...@gmail.com 
> > wrote:
>
>> I was wondering if someone could help me out with a decision/offer an 
>> opinion:
>>
>> I need a ray tracer that deals with complex geometry (a fast ray tracer 
>> that can create 1000's of point clouds in minimal time) 
>> Python has methods: http://pyopengl.sourceforge.net/ that I could get to 
>> grips with. But I want to stick with Julia. 
>>
>> I have found these resources: 
>> https://github.com/JuliaGL/ModernGL.jl - not sure if this has a ray 
>> tracing option
>> http://www.cs.columbia.edu/~keenan/Projects/QuaternionJulia/ - looks 
>> crazy complicated
>>
>> https://github.com/JuliaLang/julia/blob/master/test/perf/kernel/raytracer.jl 
>> - looks like only handles simple geometry
>>
>> Could someone point me in the right direction?
>>
>>  
>>
>
>

[julia-users] Re: PyPlot behavior change in 0.4? (plt[:show] required?)

2015-11-23 Thread kleinsplash
Yup. Not sure why but using Sublime/VIM I can only see PyPlot and Gadfly 
using plt[:show](); display(gcf()) does not work for me. 

On Thursday, 19 November 2015 17:52:24 UTC+2, NotSoRecentConvert wrote:
>
> Has PyPlot's default behavior changed in 0.4? When I plot nothing shows up 
> with 0.3 code but there are also no errors. I'm able to save it and 
> everything looks fine but I can't see or interact with the plots when my 
> code is finished. Somebody mentioned plt[:show]() to make all the plots 
> visible but I haven't seen this until today.
>
> Is this a new default behavior or do I have to change a default setting 
> somewhere?
>


[julia-users] Re: PyPlot behavior change in 0.4? (plt[:show] required?)

2015-11-23 Thread kleinsplash
With Sublime I am using cnt+b and vim :!julia %. Both work just fine. I 
don't have a question, happy to use show as stated. 

On Monday, 23 November 2015 16:29:41 UTC+2, Steven G. Johnson wrote:
>
> On Monday, November 23, 2015 at 8:43:36 AM UTC-5, kleinsplash wrote:
>>
>> Yup. Not sure why but using Sublime/VIM I can only see PyPlot and Gadfly 
>> using plt[:show](); display(gcf()) does not work for me.
>>
>
> What do you mean by "using Sublime/VIM"?  Are you editing a Julia script 
> foo.jl and then running it with "julia foo.jl"?   Just like in Python, if 
> you run Julia in non-interactive mode then Matplotlib is also run in 
> non-interactive mode, and you need plt[:show]() when you want the plot to 
> appear.
>
> If you are using some plugin for Sublime or VIM that allows you to execute 
> code in a running Julia session, but which is not using IJulia, then maybe 
> it is forgetting to turn on interactive mode (see 
> https://github.com/JuliaLang/IJulia.jl/blob/ca35a6397d5e430f94c087f727a499b8e6ecf906/src/kernel.jl#L28-L29
> )
>


[julia-users] ERROR: LoadError: UndefVarError: mesh not defined. using MeshIO

2015-11-23 Thread kleinsplash
My aim is to load an object file and access its faces, vertices and 
normals. 

My current code:

using FileIO
using GLVisualize
using MeshIO

obj_file = "path_to_obj/file.obj"
mesh(obj_file)

I am getting the error: 

ERROR: LoadError: UndefVarError: mesh not defined
 in include at ./boot.jl:261
 in include_from_node1 at ./loading.jl:304
 in process_options at ./client.jl:280
 in _start at ./client.jl:378

Am I calling the mesh fxn incorrectly? 


Re: [julia-users] Using Meshes.ji

2015-11-23 Thread kleinsplash
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
>>>
>>>
>>>

[julia-users] Re: ERROR: LoadError: UndefVarError: mesh not defined. using MeshIO

2015-11-23 Thread kleinsplash
Nope.

On Monday, 23 November 2015 17:16:29 UTC+2, Simon Danisch wrote:
>
> This is solved in your other thread, is it?
>
> Am Montag, 23. November 2015 15:38:44 UTC+1 schrieb kleinsplash:
>>
>> My aim is to load an object file and access its faces, vertices and 
>> normals. 
>>
>> My current code:
>>
>> using FileIO
>> using GLVisualize
>> using MeshIO
>>
>> obj_file = "path_to_obj/file.obj"
>> mesh(obj_file)
>>
>> I am getting the error: 
>>
>> ERROR: LoadError: UndefVarError: mesh not defined
>>  in include at ./boot.jl:261
>>  in include_from_node1 at ./loading.jl:304
>>  in process_options at ./client.jl:280
>>  in _start at ./client.jl:378
>>
>> Am I calling the mesh fxn incorrectly? 
>>
>

Re: [julia-users] Using Gadfly with sublime-ijulia or vim

2015-11-23 Thread kleinsplash
I wasn't using interactive mode with IJulia. Putting 
plt[:show]()
at the end did the trick. 

On Friday, 20 November 2015 15:35:13 UTC+2, kleinsplash wrote:
>
> Thanks.. I still dont get a pop up though - it just says Plot(...) 
> [Finished in 7.4s]. Do you think I installed my ijulia-sublime incorrectly? 
>
> On Thursday, 19 November 2015 16:58:20 UTC+2, Tom Breloff wrote:
>>
>> Wrap your spy call: "display(spy(...))"
>>
>> On Thursday, November 19, 2015, Ashley Kleinhans <kleinhan...@gmail.com> 
>> wrote:
>>
>>> I was wondering if someone could help me with a very basic question (as 
>>> a newbie on so many levels). I finally managed to get spy() working under 
>>> Gadfly, thanks to the good people at stack exchange. But I have to type 
>>> each line into terminal for it to pop up with a plot and even then I had to 
>>> be using Escher. 
>>>
>>> I think I am misunderstanding how to plot using an editor, I like vim 
>>> and sublime, everything builds - but nothing shows. Am I looking at the 
>>> wrong editors? this is an example output:
>>>
>>> using Gadfly
>>> M = sprand(300, 300, 0.1)  # generate a sparse matrix with density 0.1 
>>> of non-zeros
>>> M = full(M)
>>> spy(M)
>>>
>>> How do I make fancy plots using an editor? 
>>>
>>

[julia-users] Ray tracing for complex geometry

2015-11-20 Thread kleinsplash
I was wondering if someone could help me out with a decision/offer an 
opinion:

I need a ray tracer that deals with complex geometry (a fast ray tracer 
that can create 1000's of point clouds in minimal time) 
Python has methods: http://pyopengl.sourceforge.net/ that I could get to 
grips with. But I want to stick with Julia. 

I have found these resources: 
https://github.com/JuliaGL/ModernGL.jl - not sure if this has a ray tracing 
option
http://www.cs.columbia.edu/~keenan/Projects/QuaternionJulia/ - looks crazy 
complicated
https://github.com/JuliaLang/julia/blob/master/test/perf/kernel/raytracer.jl 
- looks like only handles simple geometry

Could someone point me in the right direction?