JuliaGeometry / OldMeshes.jl

A collection of tools for working with Meshes
Other
20 stars 12 forks source link

Rebuild of Meshes #32

Closed SimonDanisch closed 9 years ago

SimonDanisch commented 9 years ago

Hi, I actually rebuild meshes for myself, as I needed to incorporate quite dramatic changes. Now the question is, how to feed this back. I definitely don't want two different mesh packages. I made a parametric mesh type with more attributes, like normals, texture coordinates+texture, vertex colors, etc. Also, I added some algorithms like creating the unit mesh, bounding boxes, calculating normals and some triangulation code. I rewrote the marching tedrahedra code a bit, to support parametric types and it actually become a bit faster.

Best, Simon

twadleigh commented 9 years ago

Is your work in a branch that can be reviewed?

Also, is the code against which you are comparing marching tetrahedra performance at least as up to date as dd8142c5343ac0efdba79032f533963efd49ca37? @simonster reported about a 6x speed increase with that commit.

sjkelly commented 9 years ago

Yes, please link to your package/fork/branch. I have been think about this a lot recently.

SimonDanisch commented 9 years ago

No, I haven't used this commit. Sounds like an exciting speed up!... It looks like an easy adaption, so I'll see how that works out with my code ;)

I didn't really do this linearly, instead I kind of gathered the bits and pieces. But, I'm in the middle of putting it into a package, I'll post the link when I've uploaded it.

SimonDanisch commented 9 years ago

Interesting, my solution is still 1.5 times faster than the newest approach. But introducing NTuples sounds like a good optimization which I haven't used yet. Maybe we can get it even faster =)

SimonDanisch commented 9 years ago

Update: I actually have been using @simonster version, but I removed the NTuples, so I didn't recognize it. The performance jitters quite a bit but its something like this: N=200³ my version: 1.26 meshes: 1.458748696 N=400³ my version: 11 - 13 s meshes: 14 - 18 s

Test code:

using Meshes
N1 = 10
N2 = 400
const volume1  = Float32[sin(x/15f0)+sin(y/15f0)+sin(z/15f0) for x=1:N1, y=1:N1, z=1:N1]
const volume2  = Float32[sin(x/15f0)+sin(y/15f0)+sin(z/15f0) for x=1:N2, y=1:N2, z=1:N2]

@time isosurface(volume1, 0.5f0, 0.001f0)
@time isosurface(volume2, 0.5f0, 0.001f0)
SimonDanisch commented 9 years ago

Sorry, I haven't moved forward as fast as I thought, so I uploaded the prototype in its own package for now: https://github.com/SimonDanisch/Meshes2.jl I'm still waiting for FixedSizeArrays to finish, so that I can put the algorithms in meshes on a solid basis. This means that Meshes2 is not in a working state, as it's written to use FixedSizeArrays at some point.

sjkelly commented 9 years ago

This is great! I've been following your work on FixedSizeArrays. If you have any low-hanging fruit I could help with, please let me know.

SimonDanisch commented 9 years ago

Thanks a lot! The lowest hanging fruit coming to mind are convenience constructors, like creating a vec2 from a vec3 and things like that. All these little things making it enjoyable to use the vectors. Besides that, I've started to include a list of missing items in the readme. If you find anything interesting there, but don't know where to start, just write me or open an issue!

sjkelly commented 9 years ago

Okay great! I will look into that this weekend.

I have added Meshes2.jl as a remote and pushed it as a branch here: https://github.com/JuliaGeometry/Meshes.jl/tree/sjk/meshes2-merge

My plan is to reorganize so the code can be rebased nicely and we can start working on a 0.4+ branch. We have a good amount of improvements over the last tag. I would like to add my slicing stuff, and put some more documentation in the readme. Lets hope by next week we can tag a 0.1.0 release and make a 0.1.x branch. We can then target 0.2.x as Julia 0.4+ and base it off Meshes2. Does this sound reasonable?

sjkelly commented 9 years ago

I started with some basic rebasing stuff here: https://github.com/JuliaGeometry/Meshes.jl/pull/36/files

sjkelly commented 9 years ago

10 months later, I think it is safe to close this. Everyone seems happy enough :)