Construct Mesh from Rectangle Vertices

I always forget how to do this!
I have 4 rectangles and I want to create quad mesh faces from them.
I can do one strip at a time but how do I create all the strips?


ConstructMesh.gh (8.0 KB)

I should have been clearer…
This is what I’m trying to achieve…

Loft?
ConstructMesh_loft.gh (12.1 KB)

Mesh the loft?

I want those specific quads so I can convert it to a SubD afterwards.

I think that you can code. If I’m correct get the attached and modify it accordingly (most notably the Polyline Array).

Mesh-alongCurve_EntryLevel_V1.gh (18.1 KB)

I’m not sure if there’s a native component that does this, but here’s a simple Python function for meshing point grids, that I implement on pretty much every project I work on:


240905_MeshPointGrid_00.gh (6.4 KB)

1 Like

Er… not really. I once used to be able to use VB and have cobbled together some stuff in GH script editor but I am self taught! Thanks for the example though, I like the extra control this gives and am sure it will come in handy for situations where this is needed.

This is great, thanks. You should make it a component, it’s really useful and this is slightly beyond what is capable with native components (I think)

1 Like

One question… Why is U count 5?

It’s to close the resulting grid around back where it starts (i.e. each rectangle is represented by five vertices, where the first and last overlap). Also, we should probably add mesh.Vertices.CombineIdentical(True,True) after making the grid, as the current code will leave a naked edge loop at the seam.

1 Like

It converts to a SubD OK, but I will try and add that line of code as it sounds like good practice

Like this? I get an error saying “name ‘mesh’ is not defined”…

1 Like

Ah sorry, I meant within the function. If you call it on that line use Mesh (upper case M). And don’t reassign it to a variable. The method edits the mesh in place. On my phone :slight_smile:

Thanks, that works!

1 Like

Hello,

Here are some thoughts on doing it with vanilla Gh (you could also identify the points and have an even cleaner Construct mesh, by specifying them as the corners in MeshQuad, but I’ve run out of lunchtime, sorry)

ConstructMesh.gh (24.6 KB)

Credit:
I picked up this workflow on the old Gh Forum "4 points surface" to Mesh - Grasshopper

1 Like

Brilliant, thanks!
Challenge completed!
I always forget about the Relative Item component.
The data manipulation from the End Points through the Merge components is hard to visualise but I can follow it.

I’m out of time, but in case you’re interested in a ready-to-use compiled component, froGH already has a Polylines Mesh Loft component:

1 Like

So, half of that script was actually redundant it turns out - the Merge I guess has two key moments:

  1. Because the curves are in the same direction, we need to flip one so that we can go sequentially around the perimeter of our mesh face (instead of making an hourglass shape), see what happens when you swap the start and end points on the crossed EndPoints component
  2. We don’t want it to put together the two trees - we are trying to make new trees (Tree 0 has Items at index 0, Tree 1 has Items at Index 1 etc.)

Then, let’s draw out what we’re trying to do so we can visualise it better - see how the direction has to be reversed for the top polyline segment - and we can formally define if we start with item i - we need to access the following elements:

Once we’ve drawn it out, we can get really wacky with our relative items - see below how to address it if the points are in a tree structure or if they’re in a flat list - this won’t be as fast as scripting or a compiled component, but it helps us visualise the logic at least:

ConstructMesh.gh (36.1 KB)

1 Like

Thank you! I need to study this when I’m back next week but this is really helpful, educational stuff, thank you again!

1 Like

Someone is upsizing his board handle…

1 Like