Creating pipework looking structure within a volume


I am looking into ways of creating a pipework looking like geometry that is controlled by a simple volume referenced from Rhino. The best I could come up with was to create smaller voxels, randomly reduce their count ( to not have so much of a grid looking system) and then simply pipe the edges.

It does not, however, give me that exact thing i am looking to create. Maybe there a way to perhaps have certain criteria for how a poly line can be drawn within the volume (like always turn 90 degrees, min max length of the segment)? Or any other suggestions on how to approach this?

I have attached my script and the image of the resulted geometry. The pink and grey render image is kind of what I am trying to achieve.

Thank you!

pipework within a (75.5 KB)


Not the fastest, but might get you going if you adapt to your script:

you’ll need mesh pipe component if you don’t have it

test of piping on one of the units (using mesh pipes as they’re faster) (44.1 KB)

[edit] alternatively you might want to ‘wrap’ your breps with a different logic like what Michael does here:

1 Like

Hi @corellaman!

Thank you for your response. Will give it a go.

I have a suspicion that #pufferfish can somehow be used to achieve the desired result as well.

1 Like

As an indication/fun only … try the attached as well (works on a cubic like grid minus [an user option if voids > 0] random origin voids [of size vx,vy,vz]). (130.3 KB)

It works (using recursion) solely dealing with indices thus is real-time fast (2ms or so) if you opt for the connection axis:

Time grows (10-20 ms) is you opt for pipes using poly segments as rails. No fillet option is implemented nor you can use the whole polyline as a pipe rail (VERY slow results in both cases for good reason).

Watch what the info panel has to say: there’s no guarantee that each polyline can have the maxNodes (since the directions of grow MAY are blocked by the previous ones).

1 Like

Very nice! Thanks!

BTW: The start of each poly is on some (randomly picked out of the 6) out side of the initial grid. But if the - optional - voids consume all the side pts … then there’s no start and nothing comes out. In fact several checks of that type must been implemented in order to achive(?) some(?) results(?) in any situation … but that was made just as an entry level Recursion demo for the people in the practice. Recursion is a freaky coding approach where a Method calls itself (LOL) until something right (cross fingers) happens and this paranoid loop terminates.

This means … er … hmm … that a red C# is not out of question (far from it).

Thus the usage of the whole thing is just for fun. Anyway I’ve added 2 “safety” checks more (out of a zillion required): (128.5 KB)

BTW: rollTheBones just re-executes the C# … meaning another random result

Second picture looks like pufferfish‘s discrete polyline

Added an autoZoom option (rather handy I guess) and a classic Indexing Tree (poly Nodes indexing, that is [requires ~ a millisecond more, but no pain no gain]): (129.1 KB)

Ohh! Thank you all!