Jump to content

merge points with mesh ?


Recommended Posts

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

 

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

Link to comment
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.

 

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

Link to comment
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 :-)

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...