merge points with mesh ?

Recommended Posts

How can you make points created in a wrangler part of the mesh, since a merge sop can't be used ?

Edited by CinnamonMetal

Share on other sites

Hi, the way geometry is created is Houdini is simple : there are points (created in Wrangle using addpoint function), then there are primitives (polygons or polylines, you have to declare which type a primitive is in the addprim function), and then those two entities are linked trough vertices : so you need to add vertices to existing primitives and declare to which point those vertices are referening. By the way, using addprim and refering directly to two points allows you to create the vertex automatically.

So if you want to "connect" new points to existing primitives (an existing mesh), you have to use addvertex, who takes the existing prim number as input, and a points you want to connect to that primitive.

I don't know of this is what you want ?

Share on other sites

I understand what is being explained in the link; although the example is creating primitives from scratch

`int AddSphere = addvertex(geoself(),0,@PointList);`

PointList attribute is the attribute creating the points; if the above is correct, which I'm not sure  Then the geometry whether run over primitives or points should be showing more points in the geo spreadsheet ?

Share on other sites

Your @pointlist should be a valid point number. It can be retrieved from a list, of course, in a loop.

In your example, be careful, you are adding your vertex to the primitive 0, so if you iterate over each primitive (Primitive Wrangle) you will have one primitive (polygon ? What will be the geo ?) having a lot of vertices...

if you want to add a new vertex on all your primitive, then use a Primitive Wrangle and type :

int newvert;

in this case, the attribute point list is considered to be a primitive attribute containting an integer refering to an existing point.

Share on other sites
3 hours ago, StepbyStepVFX said:

In your example, be careful, you are adding your vertex to the primitive 0, so if you iterate over each primitive (Primitive Wrangle) you will have one primitive (polygon ? What will be the geo ?) having a lot of vertices...

Sorry, I didn't understand ?

There is a problem; whether the code I use is this;

```int newvert;

OR

this in the same wrangle as other code or a new wrangler

```int newvert;
for(int i=0;i<@PointList;i++){
}```

Instead of the points being added to the existing mesh; rather where the points are which I want to add to the existing mesh are deleted causing a mess of the mesh ?

Share on other sites

Sorry, I don’t understand your question. I don’t know what you want to achieve, so I just wanted to stress that in the expression you wrote intially (addvertex(geoself(),0,@pointlist), you were probably adding your point @pointlist into the same primitive, which may not be what you want (this makes sense for a long polyline, but if you work on geometry that only has polygons, it means you are adding points to only one polygon.

But I don’t know if you were in a Primitive Wrangle, PointWrangle or Detail Wrangle, I don’t know if within this xxxxxx - Wrangle you iterate over a list of point (I was infering that based on the name of your attribute @pointlist, but I maybe wrong). So it is hard to tell you what is messing your setup :-)

Share on other sites

I want to add the point to the existing primitive to which the point lies to the top.

In other words, imagine you have a triangle, as we both know a triangle has three points; and it made up of three sides or three edges.

The edge I'm most concerned with getting the point added to the primitive is the edge to which the point sits on, considering the shape is irregular, as; not a straight line