Jump to content

How to create a point at the center of every primitive on a Grid SOP?


Recommended Posts

hi all ,

here are some 'ways' .

polyextrude , subdivide, curvesect and average-attribute 'techniques' could be new in this thread

, since i havent opened any uploaded file .

subdivide and average-attribute results seems to give a different but more 'natural' look when primitives are irregular .

pointAtZenter.hipnc

--

oh , and the "Lets Exchange Together ." is my favorite song here . =)

as i have done before , i wd again strongly suggest to SESI to spend some of their precious time and energy in this topic .

i do know nothing , but have a feeling that that this will change .. ..

.cheers

Edited by zarti
  • Like 1
Link to comment
Share on other sites

Awesome info guys.

@zarti, what did you do for this since you said you have done this before? Just curious.

If this small but enthusiastic community helps, this would be done in a way no one has ever seen before.

It's a double edge sword for Sidefx. Yeah it might take some of their time, but also take some weight off their shoulders by not having to add that feature a specific digital asset is filling.

Also what's better than getting tools from your own very users who has the best interest for the software.

There are some very smart and experienced users here. It would be a shame to have all this potential isolated from the base talent IMO.

Link to comment
Share on other sites

  • 3 years later...

Update:

A new awesome method is to use an Attribute Wrangle set to "Run Over: Primitives" with the following code:

 

addpoint(0, @P);
removeprim(0, @primnum, 1);

 

 

First line adds a point to the center of every primitive. (I believe it uses the point average for the center).

The second line is optional and removes the original primitives.

 

Original thread:

https://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=35541

Edited by DASD
  • Like 5
Link to comment
Share on other sites

  • 1 year later...
On 9/15/2015 at 3:34 PM, DASD said:

That's by far the best+fastest way, thanks!

If you want to keep the normals (this method is super handy for placing stuff later I think):
 


int pt = addpoint(0, @P);
removeprim(0, @primnum, 1);

setpointattrib(0, "N", pt, @N);

 

 

On 9/15/2015 at 3:34 PM, DASD said:

 

Update:

A new awesome method is to use an Attribute Wrangle set to "Run Over: Primitives" with the following code:

 

 

First line adds a point to the center of every primitive. (I believe it uses the point average for the center).

The second line is optional and removes the original primitives.

 

Original thread:

https://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=35541

 

Link to comment
Share on other sites

It's the simplest method but not the fastest.

If you want to perform this operation the fastest, you need to pre-generate your points using Point Generate SOP (nprims()) and then move each point to the center of each primitive using the second input as the reference.

That way you avoid the geometry creation and deletion operations, both of which are very expensive. Creating points using Point Generate SOP is extremely fast, since it creates all points at the origin.

Link to comment
Share on other sites

On 8/18/2017 at 5:12 PM, pusat said:

It's the simplest method but not the fastest.

If you want to perform this operation the fastest, you need to pre-generate your points using Point Generate SOP (nprims()) and then move each point to the center of each primitive using the second input as the reference.

That way you avoid the geometry creation and deletion operations, both of which are very expensive. Creating points using Point Generate SOP is extremely fast, since it creates all points at the origin.

Thanks for the insight!

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...