Masoud Posted February 22, 2019 Share Posted February 22, 2019 How could I expand border edges, without adding more points to my geometry? As you can see in image bellow, I tried “PolyExtrude SOP” but it adds more points to my geometry. Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted February 22, 2019 Share Posted February 22, 2019 After extruding try: Fuse: Snap -> Distance -> Greatest Point Number Fuse: Consolidate expand.hiplc Quote Link to comment Share on other sites More sharing options...
kleer001 Posted February 23, 2019 Share Posted February 23, 2019 Group the edge then Peak SOP and transform by normals? Quote Link to comment Share on other sites More sharing options...
acey195 Posted February 23, 2019 Share Posted February 23, 2019 (edited) 29 minutes ago, kleer001 said: Group the edge then Peak SOP and transform by normals? that would work for the straight bits, but for the corners you would have to increase the magnitude by which you move them to maintain the angles. from the top of my head.. I think it was dividing the offset by either the cosine of the angle, or the cosine of half the angle. So an offset at the corner, at 45 degrees would be 1/cos(45deg) which is 1/0.70710678118 = 1.41421356237 if my memory serves me right. Which makes sense, as that is the square root of 2, and pythagoras and stuff Edited February 23, 2019 by acey195 Quote Link to comment Share on other sites More sharing options...
Masoud Posted February 23, 2019 Author Share Posted February 23, 2019 8 hours ago, konstantin magnus said: After extruding try: Fuse: Snap -> Distance -> Greatest Point Number Fuse: Consolidate expand.hiplc I don't want to use PolyExtrude because it adds points to my geo. Quote Link to comment Share on other sites More sharing options...
Masoud Posted February 23, 2019 Author Share Posted February 23, 2019 (edited) So, is there any practical solution? Edited February 23, 2019 by Masoud Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted February 23, 2019 Share Posted February 23, 2019 You could snap the outer points to polyexpand with nearpoint VOP. In this way, no additional points are created, not even temporarily. expand_2.hiplc Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted February 23, 2019 Share Posted February 23, 2019 You could also loop over the outer points with a detail wrangle: int pts_grp[] = expandpointgroup(0, 'outer'); int total = len(pts_grp); for(int i = 0; i < total; i++){ int pt_prev = pts_grp[ (i - 1) % total ]; int pt_curr = pts_grp[ i ]; int pt_next = pts_grp[ (i + 1) % total ]; vector next = normalize( point(0, 'P', pt_next) - point(0, 'P', pt_curr) ); vector prev = normalize( point(0, 'P', pt_curr) - point(0, 'P', pt_prev) ); vector avg = normalize(next + prev); vector up = {0, 1, 0}; vector in = cross(avg, up); float dist = dot(next, avg); vector dir = in / dist; vector offset = dir * -chf('extrude'); setpointattrib(0, 'P', pt_curr, offset, 'add'); } Forked from: https://forums.odforce.net/topic/41356-polyextrude-in-vex/ expand_3.hiplc 1 Quote Link to comment Share on other sites More sharing options...
acey195 Posted February 23, 2019 Share Posted February 23, 2019 Yeah Konstatin's version is basically a worked out version of my ramblings. Forgot to note that the dot product of 2 vectors is equal to the cosine of the angle between those vectors, making the code kind of convenient @konstantin magnus Just realised you got this technique from the genius himself too (in the other thread) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.