Data matching points to closest curve while usign hierarchy (31.2 KB)

My first post so please don’t hate if I did something not right…

I’m trying to work off of Inno’s script for road offset using hierarchy. I’d like to add different “Fillet” depending on road hierarchy (see left side of script for inputs). I managed to call for closest points and sort the centerlines intersections for hierarchy. But now I’m stuck as I can not visualize in my head…

…what and how to match so I can use “Fillet curve at parameter”.

I know the very basics of datamatching (i.e. you have to have same paths of trees, same count of trees, sometimes even same amount of items inside tree structures) but I really don’t know what to use here.

Thanks in advance

Roads from Centerlines

the only thing that comes to my mind is something like this, which is not very “Grasshoppery” …in the sense that let’s say you have like 15 types of road, then of course this is not a viable path as you’d have to manually create a very complex tree… :slight_smile:

I drew a fairly dense network just for testing purposes, where green is Main, yellow Secondary and red terciary, in order to see many “weird cases” that might not be highlighted in the more simple sample you have attached:

I thought inheriting the fillet radius from the closest intersection type would be the best solution, but in a case like the following, the inheritance by proximity fails:

also in situations like these inheritance would fail:

so my best guess is to use some sort of layered looping, where first you loop through each type of road separately, looking just for self intersections for a given same_type-same_type fillet radius

then after those are done you can start to loop with same_type-different_type intersections, each of those defined by a different radius

also, because of how the Parameter Fillet component works, a nested loop might be the best solution at hand (probably with something like Anemone plugin)

it’s an interesting problem, will try to put together a dirty prototype sketch :+1:

i think this problem becomes simplified if each road retains the layer info from it’s centerline. then when doing the fillet, a simple switch to tell it to chose one of n radiuses depending on the layer combination of intersecting curves

@adel.albloushi it’s simplier said than done, but eventually that’s what I wanna do (see new script below)

The troubles of selecting the right intersection are halfway solved when the geometry is perfect (which IRL you’d make it by hand perfect). Also I implemented (or I hope so) the “cull” solving the “non intersection points” issue.

I think this gives me part of my troubles as of my own development … but I don’t know what you mean… can you elaborate?

All in all I tried and did exactly what I wanted, but perhaps made mistakes on the way. Can someone help please? (54.7 KB)

the Fillet Curve at Parameter will produce one new curve with just that very fillet at that very parameter

stupid example on rectangle: 4 corners → 4 discontinuity points → 4 curves each with its own fillet:

if I bake them and move around to check what’s the output:

we want to iterate filletting the very same curve again and again at different parameters, so need to take into account two things:

  1. we need a loop, in such a way we mod the curve and reuse it for the next iteration
  2. the curve was just filleted at previous iteration, so it changed: probably the list of Parameters for next iteration is no good anymore, because it referes to the original curve without fillets

there’s a magic component from @magicteddy that would make the world of difference to you in this case; it comes from a library of components he has written himself, not released as an official plugin yet, but that he published himself in this forum:

it’s called Fillet Multiple, and allows for those fillet at parameters to be created -I assume- simultaneously:

but if I use that on your final definition “as it is” it gives plenty of errors :frowning:

before I study your script a little bit, there’s just one thing I didn’t fully understand: you have sliders for Road width, sliders for turn radius, but what happens for instance when two different kind of road intersect each other, like a Majour road is intersecting a Secondary one? what turn radius should to be used in that case? always the greater of the two?

I eventually tried the same thing as you with a n-gon :smiley: but realized it’s beyond my scope for now due to the changing parameters… I could try the magic component and get to you back in a few days. Unfortunately, I will have to wrap it up and finish in 2 weeks, and thus I need to spend my time on different parts of the script.

regarding your question, I made this logic gate:

That should filter the major x something intersections into first list, then secondary x sec/terc and last set composing of terciary x terciary only.
Those sets would be used by closest point component to divide the fillet points into 3 groups of 3 radiuses.

I’m posting update as well.
- Warning, ca 2 min loading time with disabled bottleneck. - (10.4 MB)