Line intersection with Surface not working

I have created sight lines at every 10m interval and checking its intersection with surface but its not giving me intersection points.

Hi @rinkesh02 ,

Would be great if you could share your Revit/ Host file and your Dynamo file.

SSD.dyn (268.7 KB)

Here is the Dynamo and Civil3d dwg file. @Daan
Drawing2.dwg (4.0 MB)

1 Like

Hey @rinkesh02 ,

I’ve looked at your files and I’m having a hard time understanding what you’re trying to achieve here. I see you got some sort of road and you’re trying to determine sightlines. Could you maybe make a sketch or something similar showing what you’re trying to evaluate?

I can partially understand what you are trying to do.

  • Is your objective to create sight lines and then check if any of the sight lines intersect with the surface?
  • Is your overall goal to assess whether the stopping sight distance is ensured along the road?

If yes, I have re-structured your graph into groups and added comments to explain what I think you are trying to do. (I put the parts that I don’t understand in blue.)

SSD1.dyn (71.9 KB)

Main Problem: lacing

In the Geometry.DoesIntersect node, there are 146 line geometries from Line.ByStartPointEndPoint being compared to 4340 surface geometries from Surface.ByPatch, but what is actually happening is 146 line geometries are compared to the first 146 surface geometries.

Solution: change node to Cross Product lacing

Change the lacing of the Geometry.DoesIntersect node from Auto to Cross Product. This means that each line will be compared to each surface. The result will be 146 list each containing 4340 booleans. This will create effectively do 633640 calculations and is a very processor-intensive task, so this will take time. Also, I think you want to know if any of the line intersect, so I added a List.AnyTrue node and set it to work at level 2: checking if any of the 4340 items in each list is true and returning a list of 146 booleans. I’m not sure if this is the most efficient way, but it works. See Dynamo Primer for more information on lacing.

Another problem: elevation of the sight lines

The start and end of the sight lines are points on the alignment with elevations from the surface, which means that they are all at surface level, so the lines will all intersect with the surface.

Improvement: add height to Z-values

Normally in road engineering, the height of the eye of the driver and the height of the target object are calculated above the road. For example, the height of the eye of the driver might be 1 m (for an average car) and the height of the object might be 0.15 m (the average doomed wild animal or something). You can adjust the height by adding to the Z value calculated by Surface.ElevationByXY when creating the 3D points.

Result: 60 of the 146 sight lines are shorter than the stopping sight distance.

I coloured the lines red or green to help visualise the result.

SSD2.dyn (89.3 KB)

Please mark this as the Solution if it answers your question.

2 Likes