Corridor.SolidsByRange: Wrong usage or potential bug?

Hello,

I’m trying to extract corridor solids by using the Corridor.SolidsByRange-node that was added in 2025.1.


Forum_SolidsByRange.dyn (74.0 KB)
Forum_SolidsByRange.dwg (1.6 MB)

I’m feeding it a list of start-stations and a list of end-stations but the solids don’t follow those stations exactly but seem to jump to the nearest corridor-interval. I havn’t tested it thoroughly yet but it only seems to be an issue as soon as alignment-arcs are involved.

stations_start = [0,30.08419,86.8222,106.87881,119.0313]
stations_end = [30.08419,86.8222,106.87881,119.0313,125]

According to my inputs, the first solid should be created from 0 to 30.08 which it does.
The second solid however should start from 30.08 but is actually created from 30.5 which is the next corridor interval.

I thought that Dynamo might have a problem with floats/precision but the problem persists even if I alter my inputs to have some “gaps” between start- and endstations.
I think I’m doing something wrong or that there’s an issue with the node. Any kind of help is appreciated!

Hi @pumpaij,

Correct, currently this node has the same behavior as the Station range option that you see in the UI:

image

Hey @zachri.jensen ,
thanks for your reply!

I didn’t have time lately to revisit this - the example graph I shared above is a hot mess but upon further investigation, I think I’ve pinpointed the issue now and I do think that it is kind of a bug:

When there’s an alignment with curves and a profile that stretches over the whole alignment, the value for the alignment end station is calculated with a different precision than the value for the profile end station. The profile end station is usually one digit longer, therefore you can’t hook “Profile.EndStation” into “Baseline.AddRegion” without getting the error that the end station is not in the range of the baseline.

This doesn’t happen for alignments without curves and it’s also not an issue with profiles that do not span over the whole alignment, which is why my script sometimes worked and sometimes it didn’t.

I’ve attached sample-documents to reproduce the issue.
If you run it with the curved alignment called “test” and the profile “test”, there will be a difference of 0.00000000000003m between the alignment end station and the profile end station.
If you run it with the alignment called “test2” without curves and the profile “test2”, Baseline.AddRegion will not produce an error.

I’m not sure what’s the best way forward. It would be really convenient if you could just connect Profile.EndStation to Baseline.AddRegion. I might have to do some roundings on everything beforehand.

(Funnily enough, the “is equal”-operator returns True, although there is a difference between the values)

Example_AddRegion.dwg (1.1 MB)
Example_AddRegion.dyn (39.9 KB)

A simple codeblock if-condition does the trick for now! :slight_smile:

correction = (alignmentEndstation - profileEndStation)<0.00001 ? alignmentEndstation : profileEndStation;

I think your solution is good, and rounding is also a good practice. The values that you see in the UI are rounded for presentation purposes, but the actual internal values that are stored at full precision often have a lot of noise out past the decimal.

This is the same behavior when editing station limits in the UI as well :slight_smile:

1 Like