Surface from planes (using planes z-axis as face normal at that point) ||| Planes still on XY-Plane and need to be moved on z-axis acrding to angle

Hi I have abunch of planes that are currently laying flat on the xy-plane

the planes have different rotations as you can see here


-> I am aware that some of the planes are to steep for this to work properly but I already have a solution for this :slight_smile:

so what i basicly want to do is this :



-> the red are planes at current position (simpified)
and i want to find out how far i have to move them on the z axis for them to create a surface where the planes are the tangent line on that point of the curve

:slight_smile:

if anybody has an idea I would greatly appriciate the help :smiley:

thanks

Hi Chris!

See this concept/algorithm.
(I’m not a mathematician or such… take everything i say/post as an option from a hobbyist)

What you have are derivative values, to rebuild you need to do the integral of those values.

I interpolated point locations and vectors (with catmull interpolation).
With mass addition > partial result, every point is moved in Y for the sum of all previous point/vector.
Number of samples is highly relevant.

Less words, see attached gif.


integral.gh (19.5 KB)
Point spacing is even, maybe with an uneven spacing it give wrong results (or wronger).
I don’t know if this is correct, this is very likely do be doable by pure math very better. (sorry for my english)

You didn’t attach you data, so i created this to try the concept.

You have many vertical planes (near flat/horizontal planes!)… an analogue 3d version of this algorithm won’t work.

1 Like

Hi Riccardo :slight_smile:

that looks very interesting. I just took a real quick peak at it because I don’t have much time now.

I will take a more indepth look at it first thing tomorrow morning! :smiley: but looks very promising. Going to let you know how i do!

thanks so much in the meantime

chris

Hi
I’m back. sorry to get back to you so late :confused:

this looks really good.

it does exactly what i need for the simple version with just some vectors in 2d

do you have a suggestion on how to go about it in 3d when the planes are scattered about and not in some kind of grid?
I am new to GH and not sure if there is a simple adaption from what you showed to the 3d surface :frowning:

:sweat_smile:

chris

I was thinking about it … somehow.
A first “translation” that came in my mind would require a 4-dimensional space environment … (as said, i’m not a math pro… “simple” situation > stupid solutions).

The first step would be to interpolate through your samples, “subsampling”, making a more dense (increased number of samples) but equally spaced grid.
I would do 2 surface with “patch surface”, one for XZ curvatures/tangentvectorangle and another for YZ… smoothing the Z values.
But I’m not sure if “splitting” the curvatures into 2 “derivative graphs” would broke the total smoothness.
(hence why an ideal solution “would be” a 4-D derivative graph")

I don’t know.
Maybe i’m completely off road, googling the right keywords might lead us to proper solution… but i don’t know what to search for.
I’m just writing what I have in mind… madness atm.

Hi again :slight_smile:

just so you know what I am doing:

I am trying to recreate this (of course in a simpler version and not as acurat)

page 4/5 is the steps I am going through right now.

progress of mine so far:

1 Like

Yes, I remember your previous posts.

What you have are samples of a possible “normal map”
1st result googling “reconstruct from normal map”:

Beware:
Your calculations are done (probably) using distance as your “lens” is flat, like a fresnel lens.
After you have your first shape, you will likely need to re-iterate through it doing again your math but with new distances (some parts of the lens are nearer the object and further from projection panel and vice-versa), and so the ray angles will change a bit (becoming more precise).
Or, you know, find a direct math calculation.


surface_integral_V0.5.gh (51.4 KB)

This solution can somehow “interpolate” through uneven located 3d-vectors.
It’s heavy and very likely imprecise and wrong, probably wasted time.
You need a math expert to do what you need.

Anyway, in my solution i make 3 patch surface through 3 different sets of points.
Each set is made by moving in Z the sample point by the component of its vector (X, Y, Z … hence 3 sets)
Then intersecting the surfaces with a grid of rays and reconstructing the vectors to have the even field.

(inside is a c# to extend surfaces and a c# to convert vector to normal color)

How to do the next step, from vector to 3d shape, is still a mystery to me.
(but, as said, the first step is already “fake”… so…)

2 Likes

just thought of a whole nother problem ^^ that I didn’t consider at all uptill now. although it is quite obvious :confused:

this project is slowly getting out of hand :rofl: so many mathematical things to concider. but who doesn’t like a challange :sunglasses::crazy_face:

I did already mentioned that.

I re-quote myself:
“Your calculations are done (probably) using distance as your “lens” is flat, like a fresnel lens.
After you have your first shape, you will likely need to re-iterate through it doing again your math but with new distances (some parts of the lens are nearer the object and further from projection panel and vice-versa), and so the ray angles will change a bit (becoming more precise)…”

I like challenges, indeed.
But I’m missing knowledge (as always), and the empiric methods I use not always get to a result.

(another thing, the Olympic logo in your sources have creases dividing the colors; those are like different lens shapes joined together… what are we doing here is just 1 lens. Your refraction lens will not have “creases”… or, it could have them, but with a very high sample resolution… which is madness!)

1 Like

ah now I understand what you ment. sorry I didn’t quite get that :rofl:

with

I didn’t mean you but me and not giving up on my goal ^^

yeah I know

One of my friends is a math student. I will try and see if he can make time for me. If he does and I get to a “solution” or rather a approximation that works close enough, I will post it here for anyone who is interested

WIP update

Interpolation between points was unreliable (patch would take unpredictable shapes)
Needing another method to “interpolate” between a set of 2D-random-placed values, I switched to using mesh-spray functions.

I try to describe now shortly the process:

  • I created a set of points (flat, Z=0) , each with its normal vector. In the script I used a semi-sphere as a source.
  • Done delaunay mesh from those points + some far point to get a large, extended mesh
  • Converted normal vectors to normal colors and colored the mesh with spray points
  • evaluated the mesh with a high-resolution grid of samples to get an even distributed matrix of color samples
  • converted color to vector back again

From now on the method is likely to be inaccurate/wrong/incomplete
(or maybe i’m just lacking enough resolution, the 2D version was fine ONLY with very high resolution)

  • we have a matrix of vector samples to use for moving the matrix of point
  • for each row, starting from first point (still), calculated final Z for each element as the sum of the “steep” (tangency) of all previous element
  • same for each column
  • for each point in the matrix, done the average (of Zs) from row and column results

7_1
surface_integral_V0.7.gh (51.4 KB)

Visual result:


Starting from top:

  • theoretical perfect result (just getting correct info from the semi-sphere)
  • semi-sphere used to get initial samples, vector + point (projected to Z0)
  • final result
  • interpolated mesh from high resolution sub-samples (from top it looks the same as the sphere - good!)
  • large low resolution mesh from original starting uneven samples (+ visible vectors)

I tried an very high resolution, but after some time i just killed rhino…
I don’t know how to go on further than this.

This is semi-heuristic , no (complex) math involved … result: meh.

1 Like

Hi
I wouldn’t call the result meh :slight_smile:
To be honest this is better than anything I even got too (by far :rofl:)

Maybe not the 100% correct way mathematically, but I think that you have had to study math to be able to complete solve this issue :stuck_out_tongue:

I will try this solution tomorrow (from front to back -> taking an image sampling it to define where light rays need to go and calculating vektors | then your script) and then render a caustic image from the generated geometry and see how it looks. Will post image here

thanks for your help
best regards
chris

hi
sorry it took me for ever to get back to you.
well better late than never :rofl:
I tried it with one of my results of planes and plane normals. As you expected the result are by far not as good as what you got with your sphere example. but there you had one continous motion of vektors and not a wild something like me now :slight_smile:
here is what it looks like when i try inputting my planes:


the vectors vary to much for it to be a smooth surface
hm what to do now? I don’t know either ^^

But again so thanksfull for your effort :smiley:

oh yeah. incase you are interested :rofl:
i also managed to achive this (with some help :smiley: )

i moved each plane on the zaxis to match up with its neighbor on a row by row basis. and then reoriented the the plane to still have the correct refraction of light.
also still not the results i was going for, but ^^ Don’t really want to give up

Hey all, I was just about to post about this. Did you manage to get any further with it?