RFE Bezier resampled non-uniformly w/ Resample by Polygon Edge

   742   9   0
User Avatar
Member
289 posts
Joined: June 2013
Offline
When a Bezier is passed to a Resample SOP with "Maximum Segment Length" and "Resample by Polygon Edge" ON, it produces unexpected quite non-uniform segments.

Problematic resampled areas


Current vs Expected


Cheers
prb
Edited by probiner - May 26, 2022 13:51:55

Attachments:
RFE_Bezier_Resample_by_Polygon_Edge.hip (168.5 KB)

User Avatar
Member
26 posts
Joined: Feb. 2017
Offline
Maybe because of re-projecting points from polygonal approximation where you enabled preserve corners.

Resampling the curve based on Maximum Segment Length will rebuild the entire line into equal length segments except the last segment.
But:
Resample by Polygon Edge = Each edge of the polygon will be resampled independently.
And:
However, for NURBS or Bezier curves the resample SOP will use a polygonal approximation to calculate the length of the curve using the LOD parameter - though the final sample points will still lie on the original curve.
Edited by tachbek - May 31, 2022 16:07:31

Attachments:
Screenshot from 2022-05-31 22-56-34.png (7.6 KB)

User Avatar
Member
289 posts
Joined: June 2013
Offline
tachbek
Maybe because of re-projecting points from polygonal approximation where you enabled preserve corners.

Resampling the curve based on Maximum Segment Length will rebuild the entire line into equal length segments except the last segment.
But:
Resample by Polygon Edge = Each edge of the polygon will be resampled independently.
And:
However, for NURBS or Bezier curves the resample SOP will use a polygonal approximation to calculate the length of the curve using the LOD parameter - though the final sample points will still lie on the original curve.

I'm not following what you're adressing, the request filed is to exactly have the points sampled based on a target segment length fashion BUT respect the control points and got do across them and place a sampled point ON them.

Right now the resampling by edge and a segment length seems to be done using unit uvs and not unitlen uvs. I've done my own VEX implementation with primuvconvert() and can get the expected behavior, the issue being primuvconvert() is a VERY costly function so I thought it's probably better to request having the SOP working as expected.

Cheers
Edited by probiner - June 1, 2022 06:32:36
User Avatar
Member
26 posts
Joined: Feb. 2017
Offline
SOP working as expected. And this his limitation due performance reason. And this curve primitive approximation developers puts for reason (and reason you already discover by yourself too)
It's a rare case, where interpolated curves like bezier need to have untouched points (I guess), and without this, node works fine (with even point distribution).
But I agree, developers can create some checkbox for this option, but performance and ...practicability this are another questions.
Maybe someone need this. Depending on the purpose, you can use primuvconvert() solution, or just move some point into right position, or insert needed points

Update.
Yes, primuvconvert() is slower, even if precompute uv in one wrangle and sample in another (point) wrangle.
And this produce mach better result.
But primuvconvert() uv output is not ideal and need more refinement
Edited by tachbek - June 3, 2022 12:28:38

Attachments:
RFE_Bezier_Resample_by_Polygon_Edge_edited.hip (192.0 KB)

User Avatar
Member
1851 posts
Joined: Sept. 2015
Offline
Turn off resample by polygon edge
User Avatar
Member
26 posts
Joined: Feb. 2017
Offline
BabaJ
Turn off resample by polygon edge
All topic about turning this ON.
Why you advice this?
Or I misunderstand something?
Edited by tachbek - June 3, 2022 12:47:45
User Avatar
Member
1851 posts
Joined: Sept. 2015
Offline
tachbek
BabaJ
Turn off resample by polygon edge
All topic about turning this ON.
Why you advice this?
Or I misunderstand something?

Because in your original post you're saying the problem is non-unifrm segments.
Turning off resample by polygon edge solves this.
User Avatar
Member
26 posts
Joined: Feb. 2017
Offline
BabaJ
Because in your original post you're saying the problem is non-unifrm segments.
Turning off resample by polygon edge solves this.
This is not my post
And "RFE Bezier resampled non-uniformly w/ Resample by Polygon Edge", about achieve uniform point distribution when 'Resample by Polygon Edge' turn ON.
You misunderstand this post
Edited by tachbek - June 4, 2022 03:59:39
User Avatar
Member
384 posts
Joined: July 2005
Offline
Or you resample each segment independently with "Maximum Segment Length" but without "Resample by Polygon Edge". Each segment represents one bezier curve.

Attachments:
RFE_Bezier_Resample_by_Polygon_Edge_mod.hipnc (183.5 KB)

User Avatar
Member
187 posts
Joined: Nov. 2013
Offline
BabaJ
Because in your original post you're saying the problem is non-unifrm segments.
Turning off resample by polygon edge solves this.
@BabJ I think the desire is to also have a point at the original knot locations (breakpoints in houdini speak), which is what you get with Resample by Polygon Edge. Turing it off does indeed create uniform segments, but there's no longer guaranteed to be points at the knot locations.
Edited by antc - June 4, 2022 11:16:21
  • Quick Links