# Marble fractal lines and foliation

Hi,

I was wondering if anyone could help point me in the right direction for generating fractal lines and foliation in Marble as line work. Essentially the impurities in marble creates its pattern, and I would like to generate this in Grasshopper rather than tracing an existing. I’ve started with Fields and then with land contours but it doesnt get that “blocky” feel to it.

See inspiration pics

Fractals is not the way to do that. Controlled recursion [kinda a “special” kind of swarms, so to speak] is. That said speed is the paramount issue … most examples that I’ve seen are slower than any Harley Davidson. I have some “similar” defs (I bet that Tom J has as well [swarms]) but they are carried over 100% via C# code. Notify if you want one for playing around.

But if I was you … I would do it the good old way: trace a real thing and forget computers.

1 Like

Forgot to mention one of the dominent theories on fluid dynamics:

Google: C# Navier-Stokes, Navier-Stokes fluid simulation etc etc

See this classic as well:

fluid-dynamics-GDC03.pdf (1.0 MB)

Did you look at procedural texture ?
There are some example, it could be simple to extract lines with color variation.
http://www.upvector.com/?section=Tutorials&subsection=Intro%20to%20Procedural%20Textures
http://lodev.org/cgtutor/randomnoise.html
A simple solution, you will need

marble turbulence noise.gh (15.3 KB)

5 Likes

Just playing
{pt.x, pt.y,(1+sin((pt.x+att*noise/2)a)cos((pt.yattnoise/2)*a))/2}

7 Likes

Thank you guys for the responses,

I ended up just line tracing it on Illustrator and importing the lines into Rhino… sorta cheating, but I don’t really have the time to delve into the complex maths and scripting

There is no complex in the script I published. Just sliders in order to duplicate classical marble texture.
Nevertheless it was an interesting question

Hi Laurent, huge fan of your work you have posted on GH forums. Is there a way to apply this technique to a sphere instead of a rectangle? Only interested in constructing a mesh for rendering, not extracting contours.

Yes it is possible to apply this technique to sphere.

Bust instead of applying contour I apply Mesh Iso Splitting, so you need to put a value (double not point) at each vertex of the mesh then iso-splitting then colorize.

7 Likes

Here an example with no cut on the sphere.
I use a icosaedron sphere of my own. You have to specify the maximum number of vertices. Here less than half a million. I put many choices. All the equations are in C# to go faster.
Sphere is radius 1, so as noise is scale dependant. I advise you to use 1 unit objects, but it is not mandatory. You can lower the number of vertices to go faster.
Hope it helps.

marble turbulence noise on sphere no cut.gh (24.6 KB)

5 Likes

Thanks so much! You have been extremely helpful.

7 Likes

That is a great effect, Laurent

Hi Laurent,
I was just wondering if you knew a way in which the pattern can become more sparse the further it gets from an attractor curve? I tried to play with the script you supplied, but I just cant seem to work it out.

Thanks

We the graphics guys do this usually with a technique called Domain Warping which is similar to Laurent’s answer just warp your noise function in a noise function instead of using trig: `double myNoiseValue = noise( myPosition + noise( myPosition ) );` noise here should probably be instead a fractional Brownian motion/fractal sum but a simple noise will do and is faster.

2 Likes

Hello Laurent,
I was wondering, how did you flatten the texture in grasshoper?

Hello
I use a square plane mesh, then screen copy. It is also possible to generate the the bitmap withing Grasshopper.

And if you want tileable use a torus for XYZ then use UV coordinate to have to texture on a plane. There are some explanation on the forum.