TomRaynor Posted November 7, 2014 Share Posted November 7, 2014 Is there any way to split a polygon down the middle using vex and something like an attribwrangle in the same way that an edgedivide SOP works? Thanks. edgeDivideInVex.hip Quote Link to comment Share on other sites More sharing options...
iamyog Posted November 10, 2014 Share Posted November 10, 2014 (edited) Could be a lead but according to jlait: "it wouldn't be fun or easy" https://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&p=138661#138661 Edited November 10, 2014 by iamyog Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted November 10, 2014 Share Posted November 10, 2014 (edited) i thought about this recently, as well. i am probably boring you, but basically cutting a polygon in two is nothing different than redrawing two polygons and deleting the old one. in a four-sided polygon this would mean to create two new points inbetween existing points, and drawing vertices while creating prims. i don't know how to access specific point positions in vex, but at least some functions in my example might be useful. // CALCULATE AVERAGE POSITIONS vector avpos_0 = ((point_0 + point_1) /2); vector avpos_1 = ((point_2 + point_3) /2); // CREATE INBETWEEN POINTS int pt_4 = addpoint(geoself(), set(avpos_0)); int pt_5 = addpoint(geoself(), set(avpos_1)); // CREATE FIRST PRIMITIVE int prim1 = addprim(geoself(), "poly"); addvertex(geoself(), prim1, point_0); addvertex(geoself(), prim1, pt_4); addvertex(geoself(), prim1, pt_5); addvertex(geoself(), prim1, point_3); // CREATE SECOND PRIMITIVE int prim2 = addprim(geoself(), "poly"); addvertex(geoself(), prim2, pt_4); addvertex(geoself(), prim2, point_1); addvertex(geoself(), prim2, point_2); addvertex(geoself(), prim2, pt_5); // DELETE ORIGINAL PRIM removeprim(int geoself(), prim0, int andpoints); Edited November 11, 2014 by konstantin magnus Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted November 11, 2014 Share Posted November 11, 2014 half-edges might be useful in a more complex situation: http://www.sidefx.com/docs/houdini13.0/vex/halfedges Quote Link to comment Share on other sites More sharing options...
edward Posted November 12, 2014 Share Posted November 12, 2014 Yes, it gets more complicated quickly. For example, splitting a polygon that has a shared edge with one (or more) other polygons. Then you also have to consider the case where you want attributes interpolated along the edges into the new points. Quote Link to comment Share on other sites More sharing options...
magneto Posted November 12, 2014 Share Posted November 12, 2014 Does this mean we won't see this feature in VEX? It does seem a lot of work to do it by hand each time. Houdini can already do this in the HDK, right? Quote Link to comment Share on other sites More sharing options...
edward Posted November 13, 2014 Share Posted November 13, 2014 Yes, it can of course be done in the HDK but I don't think that was the original question. 1 Quote Link to comment Share on other sites More sharing options...
magneto Posted November 13, 2014 Share Posted November 13, 2014 Yes, it can of course be done in the HDK but I don't think that was the original question. Thanks Edward. I mentioned that because if it's in the hdk, you guys can expose this function to VEX saving us the trouble of doing it manually. 1 Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted September 15, 2015 Share Posted September 15, 2015 this (russian) tutorial explains how to cut edges in vex: 1 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.