Jump to content

Recommended Posts

http://www.patreon.com/posts/31506335

Carves out polygons using a point attribute with the ability to define the carve values per primitive using primitive attributes.

Pure VEX implementation, 10x faster than the default Carve SOP (compiled). It preserves all available attributes.

It supports both open and closed polygons.

 

Edited by pusat
  • Like 3

Share this post


Link to post
Share on other sites

Interesting, do you use intrinsic uvs or do you create your own uv for the carve position? (or is this a question i have to pay for). Is it 10x faster than the carve sop if you dont want per primitive controll?

  • Like 1

Share this post


Link to post
Share on other sites

how does it compare to Clip SOP technique?

Share this post


Link to post
Share on other sites
12 hours ago, ThomasPara said:

Interesting, do you use intrinsic uvs or do you create your own uv for the carve position? (or is this a question i have to pay for). Is it 10x faster than the carve sop if you dont want per primitive controll?

No I don't use any uvs but rather create new points at the carve min max values based on the input point attribute values. So if you have 2 neighbor points with attribute values 0 and 1, a min or max value of 0.5 will create a new point in the center etc.

No I compared it with a carve sop in a loop, all compiled. The idea is this tool will carve each primitive differently even if the carve values are the same.

4 hours ago, anim said:

how does it compare to Clip SOP technique?

Performance wise? This is something I have been meaning to compare.

Functionality wise, this tool can carve each primitive with different carve min max values if there are primitive attributes present to override the node parameters.

Here is a carve result from a single curve. AFAIK the clip method can not perform multi clip per primitive. This is using node parameter values.

tKnTebh.png

 

Edited by pusat
  • Thanks 1

Share this post


Link to post
Share on other sites

Yes, performance wise, I've been using Clip as it's pretty versatile and you can perform as many cuts as you want with a single Clip SOP too, it's just the matter of transforming the curves in Y for example, using the attribute which can be offset or modified per curve) then Clip once and transform back, attribs are interpolated automatically so the main question is whether there is more speedup to be gained using pure VEX, which seems like a bit more work on the other hand

Share this post


Link to post
Share on other sites
3 minutes ago, anim said:

Yes, performance wise, I've been using Clip as it's pretty versatile and you can perform as many cuts as you want with a single Clip SOP too, it's just the matter of transforming the curves in Y for example, using the attribute which can be offset or modified per curve) then Clip once and transform back, attribs are interpolated automatically so the main question is whether there is more speedup to be gained using pure VEX, which seems like a bit more work on the other hand

Any chance you can make a simple scene clipping a circular polyline like above, so I can test the same thing but with dense geometry? I am not sure how to set Clip so that all of the right sections are left out like in the above pic, using a single Clip operation.

It would be interesting to compare but yes it's quite a bit of work to do it in VEX, and all of the attribute interpolation have to be done afterwards using Attrib Interpolate and Attrib Copy for prims, etc.

Share this post


Link to post
Share on other sites

Thanks for posting that. It's a neat method. I did some comparisons, for plain simple geometry with no extra attributes and groups, Clip SOP is very fast. But once you add those, Clip SOP's performance severely degrades, which I assume is due to their attribute interpolation code.

In the end, both methods yield 1:1 results with the same number of points and prims but with different point and prim numbers. I checked one of the interpolated vertex attributes, and it was perfectly matching.

So the speed varies based on the geo but here is an example with a lot of extra float attributes for all classes and groups where Poly Carve SOP was more than 6x faster than the Clip method. I also compiled the Clip subnet to make it as fast as possible.

 

Edited by pusat

Share this post


Link to post
Share on other sites

thanks for testing, maybe it's time for sidefx to optimize Clip SOP and Poly Cut SOP as both more or less can be used in this way, but it's not nice to be paying speed penalty over more custom VEX solutions

  • Like 2

Share this post


Link to post
Share on other sites

multicarve.thumb.gif.c8109a901daf66009aa138b7faf848ec.gif

Did an experiment with subsampling the curve instead of adding extreme amounts of points to get precision. The downside is that you cant predefine the cuts with your own attribute.  

clip_by_noise.hiplc

  • Like 4

Share this post


Link to post
Share on other sites
44 minutes ago, ThomasPara said:

Did an experiment with subsampling the curve instead of adding extreme amounts of points to get precision

the extreme amounts of points were actually just to get some complexity not a requirement as otherwise it's super fast, it'd cut at any interopolated value even on very sparse curves/meshes

Share this post


Link to post
Share on other sites

Yes i understand, its not an attack on the solution(s). Its more the idea of cutting a segment several times without adding points. Since both metodes shown here (from my understanding) only can cut once between two points.

Share this post


Link to post
Share on other sites
9 hours ago, anim said:

thanks for testing, maybe it's time for sidefx to optimize Clip SOP and Poly Cut SOP as both more or less can be used in this way, but it's not nice to be paying speed penalty over more custom VEX solutions

Agreed, that's why I always wish they propagate the new changes all across the app. I have a feeling the Attrib Interpolate has the fastest and most recent code for attribute interpolation.

 

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
Sign in to follow this  

×