animatrix Posted February 1, 2018 Share Posted February 1, 2018 You can also PolyExtrude the curves before the Boolean and then blast the new points afterwards using a few Group nodes before and after the Boolean (Credits: Entagma) Quote Link to comment Share on other sites More sharing options...
martinkindl83 Posted February 2, 2018 Share Posted February 2, 2018 this is very good thread. i did test all approaches and im getting best results from satoru's setup (testing on 58k curves - cad drawings, where im making bridges for router). But that being said, i found scenario where even his method fails. And thats when curve goes through two cutting objects where curve points are outside. See sample image (as input i have curve with two poins) 1 Quote Link to comment Share on other sites More sharing options...
Noobini Posted February 2, 2018 Share Posted February 2, 2018 (edited) mine works...well ok i got 3 cutting objects but who's counting... Edited February 2, 2018 by Noobini Quote Link to comment Share on other sites More sharing options...
Noobini Posted February 2, 2018 Share Posted February 2, 2018 it comes back to selecting points inside an object....there's no point inside to be found coz they are ON the surface...and NO....that's not having a dig at other contributors to this thread...they're all good...I learnt plenty from them. Quote Link to comment Share on other sites More sharing options...
toadstorm Posted February 2, 2018 Share Posted February 2, 2018 (edited) Here's a compromise solution. I was having trouble getting this to work with Intersection Stitch, but that might just be my misunderstanding it. It was adding inline points but not in any order that I could use to actually split the path into individual prims. PolySplit seemed to work better for that. To fix the problem of points existing on the surface, I just uniqued each segmented prim's points and moved them very slightly towards their neighbor. Seems to work on both busy curved lines and the straight line through a torus example posted above. curve_bool_2.hip edit: forgot to fuse afterwards. this one re-attaches the segments afterwards. curve_bool_3.hip Edited February 2, 2018 by toadstorm 1 Quote Link to comment Share on other sites More sharing options...
Noobini Posted February 2, 2018 Share Posted February 2, 2018 shhhh...don't tell the architect guys you moved the points slightly....you never know they might demand their 5th decimal point accuracy back. Quote Link to comment Share on other sites More sharing options...
toadstorm Posted February 2, 2018 Share Posted February 2, 2018 2 minutes ago, Noobini said: shhhh...don't tell the architect guys you moved the points slightly....you never know they might demand their 5th decimal point accuracy back. they get moved back after testing! but really though, biasing things like raycasts and such is a pretty normal thing to do when dealing with imperfect things like polygon meshes; I'm not worried about those kinds of cheats. there's acceptable margins of error for any scene. Quote Link to comment Share on other sites More sharing options...
Noobini Posted February 2, 2018 Share Posted February 2, 2018 (edited) 3 minutes ago, toadstorm said: they get moved back after testing! but really though, biasing things like raycasts and such is a pretty normal thing to do when dealing with imperfect things like polygon meshes; I'm not worried about those kinds of cheats. there's acceptable margins of error for any scene. oh yeah...i'm blind, sorry about that... (your wrangle is still abit too advanced for me tho...it'll take awhile to sink in) Edited February 2, 2018 by Noobini Quote Link to comment Share on other sites More sharing options...
satoru Posted February 2, 2018 Share Posted February 2, 2018 (edited) 3 hours ago, martinkindl83 said: this is very good thread. i did test all approaches and im getting best results from satoru's setup (testing on 58k curves - cad drawings, where im making bridges for router). But that being said, i found scenario where even his method fails. And thats when curve goes through two cutting objects where curve points are outside. See sample image (as input i have curve with two poins) @martinkindl83 Thank you Martin for verifying this! It is a problem that arises when I use a newly added cut-point as an inner point. The problem was avoided by checking the inner line again. DissolveInside_sy_fixnestedline.hipnc @toadstorm I also like your way. Edited February 2, 2018 by satoru 1 Quote Link to comment Share on other sites More sharing options...
martinkindl83 Posted February 2, 2018 Share Posted February 2, 2018 8 minutes ago, satoru said: @martinkindl83 Thank you Martin for verifying this! It is a problem that arises when I use a newly added cut-point as an inner point. The problem was avoided by checking the inner line again. Good update. i had fix that was working for mine specific case, but your solution is way better. Funny how you can use Houdini for preparing CNC data Quote Link to comment Share on other sites More sharing options...
petz Posted February 2, 2018 Share Posted February 2, 2018 here's another one. it's a simple vex solution which works basically by counting the number of intersections along the curve and the fact that an uneven number means it`s inside an object ... hth. petz curve-boolean.hipnc 8 1 Quote Link to comment Share on other sites More sharing options...
martinkindl83 Posted February 4, 2018 Share Posted February 4, 2018 satoru's solutions works without any problems on my setup (some CAD curves and some voodoo in Houdini), Peter's VEX works for 90% of curves, but there are some occasions when its failing. anyway, i think that the main focus of this topic was fulfill in several ways. Quote Link to comment Share on other sites More sharing options...
ThomasPara Posted February 5, 2018 Share Posted February 5, 2018 Had to give this a go. This is a one wrangle solution, the issue i have come into is that it wont cut several curves. Putting it inside a for-each loop fixes this, but its not optimal. The code should work without it, but i cant manage to find where the problem lies. Features that it doesnt support atm is intersecting meshes, surfaces and meshes that covers the ends (want to solve the multicurve issue first). Heres the code: int primpts[] = primpoints(0,@primnum); vector newpos[] = {},intlist[] = {},uvlist[] = {}; int posinfo[] = {}, primlist[] = {}; int newprim = addprim(0,"polyline"); int toggle = 1; int removenext = 0; foreach(int i;primpts) { vector p01 = point(0,"P",primpts[i]); push(newpos,p01); push(posinfo,1); if(i != primpts[len(primpts)-1]){ vector p02 = point(0,"P",primpts[i+1]); vector ray = p02-p01; intersect_all(1,p01,ray,intlist,primlist,uvlist,chf("tol"),chf("mergetol")); foreach(vector j;intlist) { push(newpos,j); push(posinfo,0); } } } foreach(int index;vector k;newpos) { if(removenext == 0 || posinfo[index]==0){ int newpoint = addpoint(0,k); setpointattrib(0,"origprim",newpoint,@origprim,"set"); setpointattrib(0,"cut",newpoint,posinfo[index],"set"); addvertex(0,newprim,newpoint); } if(posinfo[index]==0){ if(removenext == 1){ removenext = 0; } else{ removenext = 1; newprim = addprim(0,"polyline"); } } } removeprim(0,@primnum,1); Boolean_Curve_01.hiplc Quote Link to comment Share on other sites More sharing options...
jordibares Posted April 10, 2020 Share Posted April 10, 2020 On 02/02/2018 at 9:55 PM, petz said: here's another one. it's a simple vex solution which works basically by counting the number of intersections along the curve and the fact that an uneven number means it`s inside an object ... hth. petz curve-boolean.hipnc I never stop learning every single time I see one of your example scenes... what a joy to see this elegant solution. Thank you. 2 Quote Link to comment Share on other sites More sharing options...
petz Posted April 11, 2020 Share Posted April 11, 2020 23 hours ago, jordibares said: I never stop learning every single time I see one of your example scenes... what a joy to see this elegant solution. Thank you. thanks, you're welcome! 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.