Welcome to Fractal Forums

Fractal Software => feature request => Topic started by: Mrz00m on January 03, 2017, 09:11:03 PM




Title: Generate point cloud of mesh?
Post by: Mrz00m on January 03, 2017, 09:11:03 PM


Voxel stack is awesome, unfortunately it requires a specially written MC algorythm that can detect the true border in every cube, that handles a lot of memory and that discards pure B/W cubes, and i don't think it would make optimal mesh and so forth...

If is blur all the voxel stack images, the limits of BW would be grey, and then i could send all the grey dots as vector3's to a point cloud array.

Meshlab can handle point clouds pretty well, and there are different import formats probably for poisson disk cloud samples which meshlab can turn into mesh nicely...

Advantage is that a point cloud takes 1000dth of the memory compared to the PNG images as a file format, and mesh samples which meshlab uses, (for example poisson mesh samping) are arrays of vertices perhaps that can be perhaps loaded straight into meshlab and that make very good results.

Perhaps what that means, is to export vertex sample maps and/or point clouds from Mandelbulb3D, very low on memory, all you would have to do is change the voxel stack algorythm a tiny bit so that it charts a vertex every time a pixel changes from Black to white. If verteices arrays type point clouds were exported from the program it would be possible to infer their 3D normals perhaps and there is probably a vertex+normal samples format that can be imported to Meshlab.

I don't know if it's a briliant idea but it's one to keep tabs on, meshlab is crashing on my AMD desktop pc i have to run it on the i7 laptop to say more about it.

I figure that sample/vertex files can be saved as stl/obj without the triangle array and perhaps meshlab can import that, and point cloud formats i don't know.

I can write a program that makes samples of the voxel stack based on the border and that generates some nice mesh from it it's probably super easy. Doing to vertex arrays with normals is trivial, it's just the border pixels, and they can be saved to a tiny format with huge data. Then it would be possible to apply linear simplifaction to every level to perhaps devide the number of vertices by 100 while keeping the same actual spacial information. either way, it would be relatively very easy to code and it could mean direct obj export from M3D and there could be octree search of the vertices for every layer which would mean faster than current speed too. ill see if i can figure a workaround. :tease:

(http://ars.els-cdn.com/content/image/1-s2.0-S0097849314001228-gr1.jpg)

currently searching for tomography to point cloud programs... :) found a squirrel.


Title: Re: Generate point cloud of mesh?
Post by: Mrz00m on January 04, 2017, 09:13:46 AM
here is an example of a point cloud file in ply format which can include the normals, PLY file example for a point cloud. I ran it in meshlab and it makes pretty awesome mesh.

Below is the contents of points.ply.

ply
format ascii 1.0
element vertex 36
property float x
property float y
property float z
property float nx
property float ny
property float nz
property float intensity
property uchar diffuse_red
property uchar diffuse_green
property uchar diffuse_blue
end_header
13.32 12.84 3.06 -0.352745 -0.230493 0.906887 1 255 243 245
13.44 12.84 3.06 0.135449 -0.0514792 0.989446 1 255 244 242
13.56 12.84 3.024 0.26937 -0.00564067 0.96302 0.988235 252 232 218
13.68 12.84 3 0.023836 0.341656 0.939523 0.980392 250 222 199
13.8 12.84 3 0.17265 0.491562 0.853557 0.980392 250 222 196
13.92 12.84 2.94 0.271418 0.421348 0.865331 0.960784 245 205 181
13.32 12.96 3.048 -0.113205 -0.0506456 0.99228 0.996078 254 240 240
13.44 12.96 3.036 0.316732 0.242606 0.916964 0.992157 253 232 220
13.56 12.96 2.976 0.305802 0.351274 0.884925 0.972549 248 217 195
13.68 12.96 2.94 0.123776 0.286629 0.950012 0.960784 245 207 182
13.8 12.96 2.928 0.166562 0.236305 0.957297 0.956863 244 199 175
13.92 12.96 2.916 0.300154 0.375882 0.87671 0.952941 243 173 147
13.32 13.08 3.06 0.256866 0.12211 0.958702 1 255 236 225
13.44 13.08 2.976 0.445059 0.33052 0.832274 0.972549 248 217 195
13.56 13.08 2.94 0.108126 0.123257 0.986467 0.960784 245 197 168
13.68 13.08 2.94 0.154002 0.120018 0.980754 0.960784 245 185 157
13.8 13.08 2.916 0.347761 0.334486 0.875889 0.952941 243 169 149
13.92 13.08 2.796 0.601865 0.623676 0.498785 0.913725 233 144 121
13.32 13.2 3.024 0.468064 0.297601 0.832075 0.988235 252 228 206
13.44 13.2 2.928 0.257091 0.200496 0.94536 0.956863 244 207 178
13.56 13.2 2.952 0.005533 -0.0206843 0.999771 0.964706 246 190 155
13.68 13.2 2.892 0.407234 0.363634 0.837813 0.945098 241 161 133
13.8 13.2 2.856 0.559132 0.580269 0.592165 0.933333 238 144 115
13.92 13.2 2.556 0.724107 0.541258 0.427443 0.835294 213 119 99
13.32 13.32 2.964 0.398726 0.298406 0.867163 0.968627 247 215 189
13.44 13.32 2.916 -0.0611859 -0.0315522 0.997628 0.952941 243 198 169
13.56 13.32 2.976 0.225468 0.0427099 0.973314 0.972549 248 181 148
13.68 13.32 2.784 0.653282 0.527581 0.543029 0.909804 232 144 116
13.8 13.32 2.664 0.648986 0.607185 0.458414 0.870588 222 124 101
13.92 13.32 2.484 0.71337 0.436706 0.54808 0.811765 207 105 86
13.32 13.44 2.94 0.11495 -0.00345421 0.993365 0.960784 245 197 166
13.44 13.44 2.94 -0.124913 -0.113648 0.985637 0.960784 245 191 161
13.56 13.44 2.952 0.517879 0.102231 0.849323 0.964706 246 170 139
13.68 13.44 2.64 0.825371 0.336651 0.453242 0.862745 220 128 104
13.8 13.44 2.472 0.631464 0.52381 0.571731 0.807843 206 110 92
13.92 13.44 2.412 0.592844 0.469536 0.654272 0.788235 201 89 72


Title: Re: Generate point cloud of mesh?
Post by: blob on January 04, 2017, 10:39:03 AM
If I am not mistaken Thargor said he'd add point cloud export as the last new feature he'd implement in MB3D. Not sure whether this is still on the cards though.


Title: Re: Generate point cloud of mesh?
Post by: thargor6 on January 04, 2017, 12:05:35 PM
and it could mean direct obj export from M3D
Just as a side note: there is direct obj-export from M3D for a rather long time.

If I am not mistaken Thargor said he'd add point cloud export as the last new feature he'd implement in MB3D. Not sure whether this is still on the cards though.
I'm not sure, too :D But, I probably could just release the state I created one year ago.

Cheers!


Title: Re: Generate point cloud of mesh?
Post by: DarkBeam on January 04, 2017, 12:57:18 PM
Squirrels like point clouds :over:


Title: Re: Generate point cloud of mesh?
Post by: blob on January 04, 2017, 02:36:55 PM
I'm not sure, too :D But, I probably could just release the state I created one year ago.

That'd be cool.  :D


Title: Re: Generate point cloud of mesh?
Post by: Mrz00m on January 04, 2017, 03:12:32 PM
I've got a basic code working. If you send me your own M3i files of a volume to turn into a point cloud i'll send back some different precision files back to construct mesh from. I don't know anything about post processing fractal clouds so if someone can say what steps to get a vertex only no normals cloud into denoized and stuff that would be awesome.


Title: Re: Generate point cloud of mesh?
Post by: thargor6 on January 04, 2017, 04:33:35 PM
As another side-note: the cloud-export in MB3D does not operate on Voxel-stacks, it just traces the object (therefore the name "BulbTracer" of the module). When I remember right, the problem was never to create the cloud, but to generate something you can render from it afterwards.


Title: Re: Generate point cloud of mesh?
Post by: Mrz00m on January 05, 2017, 06:18:17 AM
Oh awesome, yes i found the new mesh trace and obj options window, it's become so deep a program that it's easy to miss a giant option... I thought BT racer was actually a space game in there when i clicked on it, it's actualy OBJ.options, confusing.

So, indeed the obj can be 512-512 and 840x840 and very hifi meshes. So probably not much use in me writing a pt cloud then.

On another front, Meshlab has updated to version 2016 since 2 weeks, it's on www.meshlab.net and it is better for pt cloud. I can't optimally get normals for the samples so i haven't gone very far to learn pt cloud stuff. The best option is to send out your best test point clouds files and suggest to the users that it's worth checking out further if they can find a use for fractal pt clouds.

One option that is missing from the OBJ export which is a nag, is that there is no rendering of the cubic limits of the isosurface, so it's not possible to generate closed surfaces? That's an awesome option because some programs have options to delete hidden mesh, and it makes it easier to print and for the program to process.

Always interested to know what technical challenges you surmounted and what programming routes you walked and technically what algorythms exist in the program options, it's good to know what is being processed!

on the new meshlab 2016 there is a completely new poisson mesh making filter, except that my clouds dont have normals(would be easy to do some) and meshlab can't make good normals from raw vertex cloud so i can't check out mesh generation properly.


Title: Re: Generate point cloud of mesh?
Post by: thargor6 on January 05, 2017, 10:58:26 AM
Very interesting, I would not have thought that it is possible to miss that feature as it was the major feature in the latest release, there is even a screenshot in the downloads-section: :-)

http://www.fractalforums.com/index.php?action=downloads;sa=view;down=64

Cheers!


Title: Re: Generate point cloud of mesh?
Post by: Mrz00m on January 05, 2017, 01:07:01 PM
I was on version 189 previously, just had a couple of hours on 191 and i didn't know it had gone forwards leaps and bounds recently.

I wrote the pt cloud code one morning without having found that button for .obj, and i the render quality is very high so i may as well complete it and see if i can add some extra thing that don't exist in m3d, for example, march through borders of the voxel stack using oversampling of 2/4 to make straight walls there with not so many pts, here's a pic of my current development. it's feels kind of like coming out of a sewer sending out research about pt clouds because meshlab colors them in kaki so here's a period red version instead.  im a bit over enthusiastic about this first foray into coding for a while so ill send in some images:

i.e. marching through x and y for high precision:


Title: Re: Generate point cloud of mesh?
Post by: thargor6 on January 05, 2017, 01:47:35 PM
Good luck!
A disadvantage of this approach might be the lack of having colored point clouds in the end.
But, depends on what do you want to achieve with them. It had turned out, for me they where not of much use at all, because the meshes where more versatile.

Cheers!


Title: Re: Generate point cloud of mesh?
Post by: Mrz00m on January 05, 2017, 10:50:38 PM
Is there a color option on for the .obj export? I coded an X3D file format color mesh parsing routine previously because its on 3dhubs and that.

this is from a win64 program that can input a folder of png's and can output a pt cloud.ply file. it also does the normals and the poisson and ball pivoting codes work very nicely, i just have to add the text field to input the PNG folder address and the save filename. here's a mini mesh that responds nicely to the poisson mesh. An advantage of point clouds is that you can concat many of them together taken from different lidar cameras into giant 40mn constructs which is fun. Perhaps this is currently the most precise mesh option for m3D because it does some pretty hifi results for small test renders so for a 700x700 it will be awesome.



Title: Re: Generate point cloud of mesh?
Post by: thargor6 on January 06, 2017, 12:24:06 AM
Is there a color option on for the .obj export?
Was planned, but never finished. Did not do anything for about a year now, and it is unlikely to continue, but one never knows :-)


Title: Re: Generate point cloud of mesh?
Post by: Mrz00m on January 06, 2017, 01:01:34 AM
https://youtu.be/J876XakP0Ns


Title: Re: Generate point cloud of mesh?
Post by: Mrz00m on January 06, 2017, 10:00:59 AM
I'd learnt a lot of the formulas a couple of years ago and i rechecked recently the renders and the program is on fire at hypersonic speeds... I  attempted an m3d obj file at 800x800 and the program not responded for 30 minutes at 99 percent done using 1gb memory. What is the limit on the obj voxels? using png and writing a streamreader file every image i can get about 1500x1500 voxel files at the moment, they take 1hr to render and then meshlab can mesh them in 5 minutes. i ll give the code eventually into the m3d project, i may try to sell a couple of copies first, ill have a batch render version and some noise cancelling options.


Title: Re: Generate point cloud of mesh?
Post by: thargor6 on January 06, 2017, 11:07:01 AM
What is the limit on the obj voxels?
MB3D beeing a 32 bit application. The final merging process (as the mesh is generated using multiple threads in separate parts) is probably the step which took so long for you.

In this case the Voxel-stack approach might be a good alternative, using JWildfire for meshing rather then Fiji is recommended because it is much faster:
http://www.fractalforums.com/tutorials/re-voxel-image-stack-and-then-what/msg81459/#msg81459

Maybe your program does some extra tricks, good luck with it!


Title: Re: Generate point cloud of mesh?
Post by: Mrz00m on January 10, 2017, 08:33:23 AM
Oh right cool that's awesome i may have another go at 800x voxel size. I kindof had fun programming this because it was kindof easyish, i've just optimized it by 9 times by running it on 3 cores for XYZ with 3 memory slots which seems to make it 9 times faster, getting 5 million points in about 20 minutes, and 20 million 75 minutes for 1000x1000x1000 voxel sizes. Only thing left is to figure out how to use arrays larger than the integer limit of 2.147 Billion to do giant mesh of 40bn pt source, and perhaps add in batch processing. Here i checked out if there is a difference to mark vertices as the white border , the black border, or the left/up/far border, so i did a comparison and hte fleft/up/far border perhaps is less precise than black/white border, clockwise from left is: white outline, left-far-up outline, black outline.


Title: Re: Generate point cloud of mesh?
Post by: Mrz00m on January 10, 2017, 03:58:15 PM
Sorry, due to errors this has become a research avenue only for the moment, will say when i have a decent version, hopefully soon... i need a bit more time on me lil program.


Title: Re: Generate point cloud of mesh?
Post by: KRAFTWERK on January 10, 2017, 07:29:06 PM
Best high definition mesh result that i have is after a few moments of the video:

Is this made from MB3D voxels?  :o


Title: Re: Generate point cloud of mesh?
Post by: Mrz00m on January 12, 2017, 07:53:45 AM
Yes indeed you can convert any M3D preset into mesh at any resolution, even 100mn point cloud array if you have a powerful enough PC. this mesh was processed in 20 minutes with 2gb of ram:
https://www.youtube.com/watch?v=KLihD2G7dyQ&feature=youtu.be

if you have 192GB of ram, i can overload them with a 4000x4000x4000 voxel (a meter size mesh with 2.5 mm quantized vertices).

I have a program that i am zapped out from programming now, i will make it available using a batch processing option and a guide for precise mesh making, that can run on as many cores as you want to.

I am going to add special effects onto to it, so that you can apply new spacial effects to the voxels as they are processed: if you have a very fascinating very dense fractal and wish to get a printable result from it, the program will have optoins to keep only an empty cube from the fractal, like a cardboard box where the sides are thin and made from the fractal... if meshlab has a command line i can get meshlab to save the mesh to highest resolution as part of a batchfile so all that is necessary is to put in high res M3D image stacks and run a mesh converstion program and it will perform screened poisson disk conversion to 4000/ (2^12) same sample size mesh and then reduce the vertices using quadratic from meshlab.


Title: Re: Generate point cloud of mesh?
Post by: lycium on January 12, 2017, 09:25:10 AM
It's indeed from M3D mesh, i kindof realize that i've just programmed the best mesh rendering program for fractals ever

I'm not sure which is worse, that you might be right, or that you can't see the horrendous aliasing artifacts in the mesh.

In any case, you're tempting me to write some super basic Marching Cubes / Tetrahedra code  :tongue1:


Title: Re: Generate point cloud of mesh?
Post by: Mrz00m on January 12, 2017, 12:50:12 PM
It's not an antialias, it's a lady cheese sandwitch. These fractals are hallucinogenic it's difficult to convince them to agree with Freudian theory of gender. i will see if i can get some boobs some place in m3d and will send some spacial clouds, sorry.


Title: Re: Generate point cloud of mesh?
Post by: KRAFTWERK on January 12, 2017, 07:38:22 PM
...the program will have optoins to keep only an empty cube from the fractal, like a cardboard box where the sides are thin and made from the fractal... if meshlab has a command line i can get meshlab to save the mesh to highest resolution as part of a batchfile so all that is necessary is to put in high res M3D image stacks and run a mesh converstion program and it will perform screened poisson disk conversion to 4000/ (2^12) same sample size mesh and then reduce the vertices using quadratic from meshlab.

I like these features very much. Looking forward to see the progress...
The first examples looked great but I was dissapointed of the artefacts you can see in this image, it looks similar to the ones I get using the Fiji>meshlab workflow, the voxel slices shining through. I was amazed that your earlier examples showed so little of it.

...you're tempting me to write some super basic Marching Cubes / Tetrahedra code  :tongue1:

Just do it Lyc!  O0



Title: Re: Generate point cloud of mesh?
Post by: Mrz00m on January 14, 2017, 05:12:31 PM
That's very nicely framed MandelWerk, The aliasing is from 1000voxel precision aliasing from the image stack, in theory you can get that up to about 2/4000 prior to having unrealistic ram demands. When I have many 750 gygabyte meshes on the PC I find it's difficult to program. The program is ready to send out now, I think it's faster and higher res than Fiji, and it doesnt ever crash. it's based on a different precept. Only thing left to do is to add 8billion voxel arrays on it to have the most amount of processing. If i had all month to spend on it, i can make a graphics card based parrallel processing one which can probably process a stack 70 times as fast, we'll see. I'll have to think of a more advanced board name then.


Title: Re: Generate point cloud of mesh?
Post by: Sockratease on August 17, 2017, 10:33:36 AM
Just posting to point out that the new release of MB3D has point cloud export!

Fun times   O0