Problem Constructing Mesh Triangles

I am trying to construct a mesh and am having trouble with the mesh triangle component. I have made 7 points using 3 integers and am trying to make 6 faces but the 4th and 6th triangle are returning an invalid sequence with four numbers not three like the others. This seems like it should be a simple fix I just can’t figure out what I’m doing wrong.

component.href=“https://global.discourse-cdn.com/mcneel/uploads/default/original/3X/0/8/0840694a2b91d92b528586acb027c0500275aa25.gh”>ORIGAMI_1ST_MESH_TRIANGLES.gh (43.0 KB)

Hi @cmoriarty

This should work:
ORIGAMI_1ST_MESH_TRIANGLESV2.gh (19.3 KB)

You misunderstood the role of the Triangle component.
A mesh is basically defined by vertices and face vertices, meaning indices of vertices defining faces. All the vertices of a mesh are usually structured in a flat list. The face vertex indices are thus needed to know which vertices form which face. Three vertices form triangular faces and four quad faces.
In your case, you construct the mesh faces from points. The points are thus your vertices. The Triangle component full-fills the role of the face vertices. It informs about the order and number of face-forming vertices. Since you only construct single mesh faces, you don’t need to input anything into its inputs.
Your solitary mesh faces can later be joined and welded into a more complex mesh!

Thank you! I thought I was probably misunderstanding something.

I am seeing the same odd behavior in GH’s Mesh Triangle component, and the solution above doesn’t apply:

The list of faces shown on the right is exactly what I want (to generate a strip of triangles), except that items 6, 7 and 8 (and only those items) have four values for some reason. Here I’m generating a list of 100 faces, but I can set the length to 5 or 10 or 1,000 and the result appears to always be the same: faces 6, 7 and 8 come out wrong.

The three input sequences look fine (they’re each just a list of 101 integers).

I feel like this must be a bug, but if not, it would be good to know what’s going on here, as it’s pretty confusing behavior!

please @bobtato attach your GH definition

This is the GH file for the above image:

mesh_triangle.gh (7.5 KB)

There’s probably something wrong with the formulas that you generate the vertex indices from.
Where did you get them from?

1 Like

Oh! Now that you mention it, yes, the “invalid” faces are invalid – they have degenerate vertices (the same vertex appears twice).

I am filled with embarrassment.

To answer your question, these sequences are to generate a strip of triangles from two alternating parallel series of points; the third formula should actually be 3 + 2*([index]\2) - [index]%2:

strip