Grasshopper

algorithmic modeling for Rhino

hi guys, I am trying to rebuild surface cell's point to match with any given curve that is on the surface, basically this is the starting surface I have (with Grid line shown in green) =

then I introduce 2 curves that run across the surface =

and then with simple definition I rearrange my closest grid points to snap onto the new curves and let the rest of the points to adjust so that it has even distribution distance between points =

(notice that I don't want to have the UV to follow the curve direction. so I can get different numbers of point in-between those 2 curves). so far so good, but....

the problem comes when I try to rebuild the cell, each cell border will have this skewed look =

this problem can be solved by manually readjusting the numbers of UV grid and by sliding the grid along UV line, so I think it is time to use the galapagos, so I introduce 4 genomes pool to start with =

a) genome: numbers of Srf division in U direction (slider)

b) genome: numbers of Srf division in V direction (Slider)

c) genome: Graph Mapper to slide edges along U direction (custom GraphMapper)

d) genome: Graph Mapper to slide edges along V direction (custom GraphMapper)

I tried to then run the galapagos solver, I basically run 2 test.

the first one is by enabling all the genome except the number of UV Grid.Galapagos only allows edges to slides along the Surface, however the result is not as I expected, it is still a "skewed" grid =

and the 2nd test which enabling Galapagos to control the number of points in UV grid as well as letting the edges slide along the surface.the result is still not right =

maybe there is something wrong with the way I try to define the fitness value, just for comparison,this is the result I adjust it myself (manually dragging the sliders), it is not the best but at least the cell grid is more "tidy"=

If it is possible for you guys to give me a little insight, maybe you have a better logic to define the fitness value? I want to have 2 option for galapagos to solve =

1. rearrange the grid, however the grid should be almost square.

2. rearrange the grid, allows the grid to be either square or rectangle.

how to define this logic? because I think my current logic for fitness value does not work.

I was thinking of doing it with kangaroo but I want the grid to still follows the original surface. If I do mesh relaxation in kangaroo, the Grid would be detached from original surface and probably will have creases near the 2 curves.

thank you very much for reading this long post. I hope you can help me out :)

Views: 2078

Replies to This Discussion

Can you upload your geometries/def?

And then, can you tell what you want to do after with this grid output?

U-V surface structure is like pixels in a monitor; if your monitor is a rectangle the pixels will be too;

you can't "draw" well a tilted shape in an orthogonal grid, it will always be jagged...

But if you give more details of what will follow, maybe we'll found a workaround...

hi, this is the file, for simplicity sake, I have removed all the gibberish definition behind. the file contains 3 parameter=

1. Curve to Constrain (internalized) = nearest Points are allowed to move along this curve during optimization.

2. Surface to Constrain (internalized) = all Grid Points should be inside the surface UV, however I am not very sure if that is practical. still let's try to make all the grid stick on the surface or at least have some tolerance value to reach the desirable result

3. Grid point (internalized) = Grid points with structured data tree.

a little background story=

I was stumbled upon a case where I need to optimize a sheet of panel on a building facade so that the joint meet somewhere along the edge of the floor slab. there is a plug in called evolute to solve this problem but it is not free to use. and I am certain Native Galapagos can solve this pretty easily.

after several attempt I am pretty sure my fitness logic does not describe what I want to galapagos, so feel free to reconstruct a new one instead T^T

hope you get what I mean :))))

Attachments:

Er... hmm... what has Galapagos to do with this?  (but on the other hand I confess that I haven't got the gist of the issue 100%).

Since you are familiar with code I'll post soon something to "start" talking (in case that I've got it entirely wrongly - quite possible).

OK let's start talking:

1. What means "introduce" curve(s) on surface? (having no idea I added some naive way to define curve(s) by surf div pts).

2. Is this correct? (the way that I define the curve(s), that is)

3. And before adding some lines more to the C# (not much): your goal is simply to "influence/normalize(so to speak)" the surf div pts (due to the presence of curve(s)), right? If so the case doesn't need "fitness" since ... well there's nothing to "optimize".

4.If however you are asking "optimization" [ a la Evolute Tools Pro] of some patterns (polylines and/or breps) derived from surf div pts (influenced by curves) ... well... that's certainly a "fitness" case.

best, Peter 

Attachments:

@Peter fotiadis:

answering your question one by one=

1.maybe I shouldn't use the word "introduce" as it sounds very confusing. LOL okay. so what I mean, is a set of curve (can be any number of curves) that I project on the surface for trimming purpose, or a curve that represent floor slab or a wall.

2.yes you are right about the curves. the sphere you made represent a point in a grid where it intersects the curves. as you can see, the other part of the curve does not intersect with the nearest point grid. the sphere on your model is the only part where it intersect with the curve. so the goal is to reconstruct a new set of UV grid ( basically find the nearest Point grid and then snap it to the curve and even out the distance between the rest of the point ).

so the result will look like this =now when I try to panelize this new grid, it looks jagged because the distance between UV is just a result of interpolation data. =

notice that the new cell is jagged that is because the new Grid tries to maintain the surface original UV and not trying to rebuild the a new UV based on that curves. the only way to solve this is by having different interval for each UV.

and to answer question number 3) and 4) that is why I am thinking of using galapagos. I plug galapagos into it and it gives me bad result, because I believe I didn't give a correct logic for  galapagos to find the fitness value.

I attached you again the full definition I made, hope you don't mind with all the big mess in that file.

oh, one more thing. I am still a newbie in learning python. so I am not very familiar with coding. the reason I am learning python is because my background is architecture. not computer programming.

cheers :)

Attachments:

OK whilst Riccardo does the politically correct thing ... I'll do it my way (the Dark Side, he he) : give me some time (not much) to create the usual chaotic option orgy that ... makes your life heaven (i.e. hell) and address(?) the issue with the worst possible way (we live for a reputation, he he). I'll keep my "dot" derived curve policy as an option ... you'll see the reason soon

PS: I know that you are a newbie to P ... but do real men fear the Evil?

PS: Hope that you'll agree that Galapagos has nothing to do with this: BUT if the requirement was: blah blah blah ... then yes. 

more soon

hahaha. yes. any method is okay as long as it solves the problem.

in my eye, computer coding is like hieroglyph letters that comes straight from pharaoh tombs. my brain still cannot interpret that yet.

probably takes time but hopefully one day I can understand python enough to make my life easier.

thanks mate :)

I still haven't understood too what you want as final output... XP

Here 2 possible (maybe) solutions....

I have made jagged windows. I can't think of any other solutions except for..... triangular windows? You tell us.

The second solution is just a nurbs surface with extracted isocurves.

(The second one is simpler, but it's hidden because incomplete, very stupid and probably wrong for you :D )

lol attachment :P

Attachments:

hi Riccardo Majewski, I have looked at your definition. thank you for taking your time. I am surprised you did that pretty quickly. mmm. actually what I want is that the new grid to have the same UV direction as the original rectangular grid.

what you have done is trying to rebuild the surface so that the UV gradually matches those 2 curves. while what I want is still having the original rectangular grid with different interval between UV.

I have attached my full GH definition for you to have a look and understand what I want. the file is a huge mess but I hope you can understand what I mean.

I will post a case study in a minute, there is one project evolute tool team has done with the exact same issue that we have here.

cheers :)

Attachments:

You described my second solution, which is stupid, the first one should be more interesting... but still I missed the goal...

Btw I still can't understand :P

A different interval between UV?

This is bugging me... I'm really missing your point.

You want a new grid with the same direction as the original, but in the pictures in your original post the windows quads are all sheared!...

Do you want the centers points of the windows to respect the original grid alignment, but the windows can be sheared?

I feel again far from understanding your request XD

EDIT:

distance between floors, must be constant?

sorry for keep making you confused :(. the first solution u said by making the window triangular definetly solved the problem. but I still want to know if this thing is possible to do in rectangular grid.

just to keep it simple here is an example of what I want by using 1 curve and planar grid. so let say I have this original rectangular grid =

and then I have this curve, notice that the curve does not intersect with any grid point =

what I want is for GH to slide every UV (and possible add more UV to add more detail) so I can get this result =

so that is the result that I want. :) by having various UV interval to compensate the curve

hope you get what I mean :)))

the fact that I posted a jagged grid (on my first post) means I couldn't solve the problem that is why I am asking for help T^T

Cheers, Runnie

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service