Adjusting bridge deck stiffeners within tolerance of a set distance (from a point)

I am creating stiffeners for a bridge deck - I do this by:

  1. divide curve - edge of deck
  2. project points - across deck to other edge
  3. simple line - a to b

When one of these is within a tolerance of the crank (one side of the deck splays out at each end) I require this to be at the crank (and not its current position).

When this is above the tolerance I need both stiffeners.

I can tackle this but I can only see a very clumsy, untidy way of doing. Can anyone suggest a smart way of doing this? (attached image should help if question isn’t clear)

edit: I think drawing the line at the crank, running a check against the rest of the stiffeners to find the nearest stiffener (min delta X value), eval x < tol, true: remove item index from (can’t think of this component) false: nothing


deck (68.8 KB)

I have made progress using:

  • closest points
  • distance ‘X’
    I require a way of processing if X < Y (input),
    Then cull closest points from list
    Else do nothing


This will cull points instead of numbers. Or you can drive multiple Cull Pattern components with a single Smaller output.

I managed to do it using distance and then evaluate. This provided a data tree with two lists (I was running two check points through the list). Then I added these to give (0,0,0…1,0,0) as an input for sift pattern.

IS that ‘cull pattern’ you are using?

Yes. I looked at your code but with all the wires hidden it was impossible (or way too much work) to see how it works. Looks like you should get familiar with Dispatch.

Thanks I will keep dispatch in mind in future

Rather than creating curves first, then checking if end points are within a tolerance to another point, you’d be better off thinking about it in reverse order. If you start with your end conditions in mind (no additional lines within 300mm of a line at a crank) you can start off by plotting points at the cranks, then generating your series of additional points, checking which ones are within your tolerance, and culling those points. Merge your culled list with your list of crank points and you’ve got the final list of points you want. All you need do the is use these points to generate lines between the two edge curves at these points:


You can also do this another way. The above method will give you evenly spaced stiffeners along the full length of your bridge, which is then interrupted by the stiffeners at the cranks. Instead, in my second method, I’ve found the crank points, then found how many points in between adjacent crank points I’d want to give me evenly spaced stiffeners. I then generate that many points evenly spaced, and use those to generate the lines. That way I get a much more even stiffener distribution:


A few general points for you:

  1. Don’t hide all your wires, it makes it a nightmare to follow what you’re doing. If you find the wires make it messy, that’s probably a sign you have too many wires i.e. (components) and the logic is a little cluttered than the wires themselves are the issue.

  2. On that note, you have a lot of repetition, which I think is largely down to the fact that you’re only using lists and not data trees. Since you’re designing a bridge here I’m going to guess you’re a structural engineer (as am I). Data trees are your best friend for scripts used in structural design as there is quite often lots of relatively simple repetition. Once you crack data trees your scripts will improve massively.

Revised script attached

deck (77.0 KB)



My solution actually does what you described. Essentially make a list of the end points - cull those within tolerance - project across the deck - draw lines. I culled pts using sift pattern.

Thanks a lot for the 2nd solution - that is quite elegant.

  1. I have a macro component with a toggle for wire - so I can flick between a state globally across the script. Its on the far left of my canvas.

  2. Yes - my first gh script so you may notice some areas for improvement. I didn’t aim for the minimal number of components, rather something I can understand how its working wherever I am. :slight_smile:. As I have gained an understanding of data trees I have really come to appreciate them - a long way to go though still. I will keep you comments in mind in future.

@Matt_Harwood I just wanted to come back and say thanks again. Your script really highlighted a few components I hadn’t found / encountered that are very usefull.

@Marc_Shanks thanks, sorry if my pointers came across a little preachy. I’ve spent a lot of time teaching GH to engineers so I may still be in teacher mode :slight_smile: