text: Jump to content
  
  # How could I expand border edges..?
  
  ## Recommended Posts
  
  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.
  
  #### Share this post
  
  ##### Share on other sites
  
  After extruding try:
  
  Fuse: Snap -> Distance -> Greatest Point Number
  
  Fuse: Consolidate
  
  expand.hiplc
  
  #### Share this post
  
  ##### Share on other sites
  
  Group the edge then Peak SOP and transform by normals?
  
  #### Share this post
  
  ##### Share on other sites
  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 by acey195
  
  #### Share this post
  
  ##### Share on other sites
  8 hours ago, konstantin magnus said:
  
  After extruding try:
  
  Fuse: Snap -> Distance -> Greatest Point Number
  
  Fuse: Consolidate
  
  I don't want to use PolyExtrude because it adds points to my geo.
  
  #### Share this post
  
  ##### Share on other sites
  
  So, is there any practical solution?
  
  Edited by Masoud
  
  #### Share this post
  
  ##### Share on other sites
  
  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
  
  #### Share this post
  
  ##### Share on other sites
  
  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');
  }```
  
  expand_3.hiplc
  
  • 1
  
  #### Share this post
  
  ##### Share on other sites
  
  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)
  
  ## 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
  
  ×
  • Donations
  
  • Leaderboard
metadata: {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}