We’re trying to model buildings as simple cubes in complex city landscapes. As a proof of concept, I’m working on this layout with the red lines being the building plots (as closed curves), the purple being roads with sidewalks and the blue being the center of the road.
The clue is that for each plot, I will have a pre-calculated area to fill. I can’t fill the entire plot. The “buildings” must also be built next to the road. That means that the building must follow the border of the plot that is adjacent to the road. We’ve tried using a series of offset functions, but the problem is that the resulting volume goes outside the borders of the plot (the green lines on the picture below).
Another issue is that using offset makes the borders “fail” when the area increases too much.
So we know the area of the plot (which can also be calculated as a certain percentage of the plot), and how its related to the road. How do we make surfaces with a specific area, adjacent to the roads ,and within the building plot? Any suggestion on methods or plugins to be used?
I’m trying my best to understand how this would work, but i am unable to figure it out. Could you point to a specific component to use or guide to show how this would work?
Where is your GH file? Do you have a list of surface areas (or percent of plot area) for each plot?
Working in millimeters That’s mistake for geometry this big, IMHO. Plot areas in billions
Well … for me the code way (C#) is rather easy - but maybe pointless for you.
Anyway:
A Bounce solver is a piece of code that attempts to approximate some value the implicit way. I.e. using some start value (in this case for the offset) and a step, say increasing, gets some result then compares some Property (in this case Area) VS a target value. If the comparison is less then sets value += step if not then sets step /= 2.0 and value += -step … until the delta (i.e. Math.Abs(result- target)) is less than some user tol value.
So given a “steady” edge (the red below) you should get the rest segments, join, offset (inwards at start), do the Ccx events (VS the steady edge), trim both, join and measure the area of the resulting Polyline VS a target Area … then either grow or srink (the offset value, that is) as explained in 1.
The big problem is that the R Crv Offset Method is more or less crap (and my Methods are strictly internal) so I can’t post a working C# on that matter.
As always I’m talking having the general case in mind: any Polyline etc etc. On a higher level (PolyCurves) we use more or less the “same” approach. Shown an abstract offset with no steady segment (as in your case - the side adjacent to road):