Query grasshopper

How can I achieve this entirely in c# only! Using no grasshopper components or just using slider as inputs!

drop.gh (24.8 KB)

That’s rather elementary. When time permits I’ll do the no pasta version (unless some other good Samaritan … blah, blah).

BTW: I guess that you want this Method as the final cut: M.UnifyNormals();

BTW: Your C# needs some rethinking: see the mini gorge sides AND the naked edges (who did this? not you I assume).

BTW: Parallel is NOT what most novices believe.

I am new to c# and trying to learn, thank you for replying, can you please upload the script as well! Yes the script is by one of my senior

Well … found a couple of minutes for that one … but then something @#@#@ (as usual) happened in the practice and you must wait for the final delivery.

PS: Droplets disappear from display (as they should) after they hit the “water”. Say like this WIP thing:

Update - almost ready: ParallelFor is thread unsafe. I was ready to implement a proper // approach - as an option - i.e. with lockers and the likes … but then I said to myself: why the bazooka VS the mosquito? > using an ancient I5 (on purpose) and for 6+K vertices VS 30++ droplets … it takes ~20 milliseconds > why bother?

Get the thing as well (what about some Laplacian smoothing? > next update):

Mesh_DefomrViaDrops_V1.gh (129.2 KB)

1 Like

This old thread is related:

but you still should look forward Peter’s code. I’ve always found a lot to learn by looking into his scripts.

You mean the Ducati (*) promo stuff?

(*) obviously a Panigale - but a V2 or a V4 ? That’s the 1M $ puzzle.

Thank you so muchhh, for some reason i am not able to get mesh when the drops hit the ground, it disappears…i wonder what is happening there…

L (for Loops) controls the pts (drops) pos. Spot the effect of L value:

PS: The Set-Up C# assigns to each pt (drop) a rnd velocity Vector (vMin to vMax: the amplitude, that is). So set your values (with L == 1) with the drops well above the “water” and then use the L slider.

PS: Obviously drops (as Mesh Spheres) are NOT displayed after hitting the “water”.

PS: The above snaps are from a C# “update” that implements a proper thread safe parallel option (hope dies last). At present time … you don’t need this.

Just for the record this is the // Method:

PS: What do you mean by the Mesh that disappears? What Mesh? You mean the “water” ? Have you changed something ??? (and I mean anything AT ALL). The only possibility for this happening is an invalid Mesh (should I investigate this? [ i.e. the m value in the distortion Vector Z value - per Vertex] ).

Anyway: try this (fixed a VERY stupid performance “bug” , as well):

Mesh_DefomrViaDrops_V1_MOD.gh (122.6 KB)

1 Like

I think there is something wrong with my version of rhino.

As I said the only reason for a no Mesh result is an invalid Mesh.

Here it works 100% OK. Maybe it’s a matter of Karma … meaning that water is not the thing for you (try Tequila).

Wonder what others have to say on that matter: for instance Baris is a man who likes that kind of rather freaky stuff.

It’s not working also on my machine.
Iv’e just opened your .gh, increased “loops” and it returns an invalid mesh…
Latest rhino 7.
Does this require particular document unit tolerance?

I work with R5 (why bother with other builds?) and the combo is 100% OK.

Meaning that something has changed in R7 related with Meshes. Assuming that the M.Vertices works (how could this be faulty in R7?).

  1. Maybe this? (1st C#):
  2. Or that? (2nd C#):

Most of the time it is degenerate faces, so something like mesh.Faces.CullDegenerateFaces() is enough.

So with healing it works, here a component from Nautilus plugin (I must change it as sometime rhino says the mesh is valid but it has degenerate faces !!)

Something is VERY wrong with R7 (the AddVertices Method ???): I can’t imagine any reason for degenerate Faces since the C# the only thing that it does is to create a new collection of vertices (with modified Z).

Degenerate faces are faces that contain such a combination of indices, that their final shape collapsed in a line or point.

Really? and how this heppened in R7 while in R5 everything is OK? .

To prove the point this C# does 2 FV Trees (Meshes prior (1st C#) / after(2nd C#)) and tests (SequenceEqual) the corresponding idx Lists per path. They are 100% identical … so the degenerate situation is a R7 problem.

I have no idea, your mesh when baked is valid in Rhino. It has no degenerate faces. Everything seems good. Mystery.

NO … it’s just a R7 issue simple as that (obviously the AddVertices Method does bananas).

I’m in the phone, can’t test.
Maybe is the Boolean to specify double precision coordinates, instead of float.
Must be set to true again even if already true.

Edit: yep, adding a:
M.Vertices.UseDoublePrecisionVertices = true;
just before the .AddVertices , solves the problem.

Well … I have at least 100 K2 Tensile Membrane C#'s that do exactly that (i.e. get the Particle positions as input to the .AddVertices Method) and there’s absolutely no problem at all.

@laurent_delrieu Can you please give some insights here?? it would be really helpful!