Sprinkler distribution in a room

Hello everyone!

I hope someone can help me with my sprinkler issue…

I am creating a script which will automatically place sprinklers in a room (un-hosted for now). The sprinklers need to be within a range of a minimum of 500mm away from a wall, to a max of 1500mm. The sprinklers need to be distributed throughout the room ideally using a maximum spacing of 4000mm between each sprinkler.
My question is this… How can I build in the logic which identifies the distance between opposite ends of the room, then automatically places sprinklers at the maximum distance possible between each sprinkler and also takes into account the 500mm to 1500mm range, trying to get as close to the max spacing of 4000mm as possible? This doesn’t seem too difficult if its a simple square or rectangular room… but when you start getting a shape like the one below, how do you start accounting for the doglegs in the room shape?

One thought: offset the surface curve loops by 1.5m internally and make a new surface from these loops (the exterior loop should be -1.5m, all others would be 1.5m). Then get isocurves on the surface, intersect those curves with the offset surface to trim them,l. Next divide the intersected curve’slength by 4m and add one, then get a count. Next use a point at parameter on the offset curves by using the range 0..1..#cnt; where cnt is the count of parameters.

At each generated point you’ll want a sprinkler head.

Doesn’t ‘flex’ the ends between 1.5 and 0.5m off the ends, but you don’t need to do that as I read your problem statement.

1 Like

Hi Jacob,

Okay great I will give this approach a go now. Thanks very much for the detailed breakdown!

Hi Jacob,

I have gotten the room boundaries, grouped them by polycurves and offset them the required amount. I then created the surface.
I don’t quite understand what you mean by the “Get isocurves and intersect those curves with the offset surface to trim them”. I think I follow the rest of your instructions after that point, but I’m having trouble interpreting that section.

Creating isocurves can be done by this node: Dynamo Dictionary text`

Practice with it so you can understand how to do one curve on the U parameter 0.5. Spacing the parameters has a few steps left out - that is you’ll have to measure the maximum length on the V axis to get the count of curves on the U axis. Give it a try, post images of where you get stuck along with a sample RVT and your DYN and I’ll do my best to guide you when time permits.

Thank you very much Jacob.

Here is an attempt… I don’t seem to be able to upload anything to the forum, it says I am new and I cant upload.
I have done everything that you have mentioned up to the point where I mentioned I got stuck in the previous message.


I used a 0.1 increment for the parameter for now just to get the lines on the surface, although I understand that will need to change. I am not sure how to trim the lines as you mentioned… I presume this step is to stop the isoline from protruding past the wall to the “Square” edge of the surface?

Trim via Geometry.Intersect between the lines and the original surface. Your assumption for why is spot on. :slight_smile:

It may help to disable the geometry preview for most nodes as you go along.

Morning Jacob,
Thanks for the tip to hide preview, that really helped! I had no idea that the Geometry.Intersect node worked this way, that is so good to know!
I have divided the intersected lines by 4m but I’m not sure what was meant by “And add one, then get a count”?
What am I adding 1 to, and what am I getting a count of?
I prepared the point at parameter node as well, I just need to give it the count from the previous step.

1 Like

I made an adjustment in the direction I think you were referring to by adding the count and the pointatparameter.
image
Kind of points all over the place but is this the correct direction? Now I think I need to work out how to divide the isolines by the same distance as the sprinkler placement

Sorry, picture didnt load
image

Can you post your dyn? If not to the forum, to another web host (onedrive, google drive, etc.)?

Just got upgraded right now :slight_smile:
Sprinkler Placment_New Method.dyn (124.7 KB)

3 Likes

Hi @jacob.small, I hope you are well!

I managed to solve this issue I was having but I wanted to know if I could pick your brain one more time? I have automatically spaced the sprinklers by measuring the distance between the two furthest walls vertically as well as horizontally, and made sure that those spacings cannot be more than 4000mm, and this works!
The last piece of the puzzle for me is to try and make sure that those spacings are perfectly divisible by 600mm… I have tried a few things but cannot seem to crack this one. This is the method that I am using below.

I would be very grateful for any help.
Thank you!

Hard to see which part you’re trying ot get help with - perhaps swap the Curve.PointsAtEqualChortLength for a Curve.PointsAtSegmentLengthFromPoint node? Dynamo Dictionary

I have tried that approach, but I cant get the final number to be divisible by 600mm. If I end up with equal segments of 2675mm as an example, how would I make sure that that number is rather 2400mm or 3000mm?

Thank you Jacob.
My apologies I was not clear with what I was trying to accomplish.
I was trying to see if there was a flexible way to do this? In the example I gave above where I end up with equal segments of 2675mm, those equal segments have been calculated taking into account the distance from the wall and the maximum sprinkler spacing etc. After running these calculations I end up with that value of 2675mm… I was wondering if these was another process I could run after the fact to nudge all of these points/sprinklers into positions along the curve that were divisible by 600mm, potentially placing in additional points/sprinklers should the value drop by enough to include another point, or remove points/sprinklers should the value jump to the next highest number divisible by 600mm. So it would almost be like a round up or down function I guess?

1 Like