Jump to content
CinnamonMetal

merge points with mesh ?

Recommended Posts

Posted (edited)

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 this post


Link to post
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 ?

A link to a good website explaining that is here : https://www.google.fr/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwiSvYmaurLaAhULtRQKHaicC8sQFggnMAA&url=http%3A%2F%2Fwww.tokeru.com%2Fcgwiki%2Findex.php%3Ftitle%3DPoints_and_Verts_and_Prims&usg=AOvVaw0LQDpJQmyF6eeMZGdARTRR

 

Share this post


Link to post
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 :unsure: Then the geometry whether run over primitives or points should be showing more points in the geo spreadsheet ?

Share this post


Link to post
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;

newvert = addvertex(0, @primnum, @pointlist)

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

 

Share this post


Link to post
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;

newvert = addvertex(0, @primnum, @pointlist)

OR

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

int newvert;
for(int i=0;i<@PointList;i++){
newvert = addvertex(0,@primnum,@PointList);
}

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 this post


Link to post
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 this post


Link to post
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 ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×