prochitecture / blosm

GNU General Public License v3.0
11 stars 3 forks source link

Border of the area of interest #50

Open vvoovv opened 1 year ago

vvoovv commented 1 year ago

To create terrain patches between streets it is required to add a border of the area of interest.

This issue is intended to discuss the above matter.

vvoovv commented 1 year ago

Do you clip all ways and intersections so that all points are located within the extent of the area of interest?

polarkernel commented 1 year ago

Do you clip all ways and intersections so that all points are located within the extent of the area of interest?

Yes, they are clipped. Such a border is already included in the section network graph as virtual ways of the category scene_border, connecting each clipped way end. This is a relic from the time when we tried to use way-cycles. It could easily be extracted from this network. The only problem now are the clusters. These end at the cluster centerline, which is constructed from the outermost ways in the cluster. These endpoints are close to the scene border, but are not part of the network.

Below is an illustration. The black lines are the outermost cluster ways, their endpoints are included in the border from the network graph. The centerline (red) is constructed from these ways, their endpoint is the middle between the endpoints of the ways. The blue dotted line is the scene border.

vvoovv commented 1 year ago

minX, minY, maxX, maxY are now available as properties of the class BlenderApp or CommandLineApp. I made the related changes in the method createWaySectionNetwork of the class StreetGenerator.

vvoovv commented 1 year ago

For now I am using minX, minY, maxX, maxY with some margin to generate the border of the area of interest.

The resulting terrain patches look nice. Later a precise area border as described in your message will be needed.

image

image

polarkernel commented 1 year ago

Very nice! How do you find these patches? Does Blender provide some tool to create them?

vvoovv commented 1 year ago

The tools are "Merge by distance" (used to remove duplicated vertices) and "Fill" (used to create face out of edge loops). They are available both as Geometry Nodes and traditional Blender operators.

So the task was to create edge sequences for the edge lops.

I offset to the left and to the right each centerline of a way-section or way-cluster (the original centerline is in the middle). That is done in Geometry Nodes image

I close the caps for dead-ends. That's done in the code. image

I create edge sequences between the connectors of the intersection polygons. Such an edge sequence follows the related intersection polygon. That's done in the code. image

Than duplicated vertices are removed in the Geometry Nodes to form edge loops and polygons for terrain patches are created using the Fill Curve node.

polarkernel commented 1 year ago

Thanks! You get a similar result as I did by way cycles, but in a much more general way, without islands and all that annoying stuff. Great idea!

vvoovv commented 1 year ago

I didn't consider sidewalks so far. It will be my next task to create terrain patches with sidewalks.