From 400525dd07928c5dac222f4eb6d122054e29f6f1 Mon Sep 17 00:00:00 2001 From: que01 Date: Wed, 5 Aug 2026 11:54:26 +0800 Subject: [PATCH] fix: match Cesium intersection asphalt --- blender/osmassets/catalog.py | 2 +- blender/tests/test_pure.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/blender/osmassets/catalog.py b/blender/osmassets/catalog.py index 9e70d59..1c10631 100644 --- a/blender/osmassets/catalog.py +++ b/blender/osmassets/catalog.py @@ -29,7 +29,7 @@ ROAD_LAYERS = [ {"id": "road_surface", "material": "Road Asphalt", "color": (0.055, 0.065, 0.070), "z": 0.03}, {"id": "intersection_surface", "material": "Intersection Asphalt", - "color": (0.065, 0.075, 0.080), "z": 0.035}, + "color": (0.055, 0.065, 0.070), "z": 0.035}, {"id": "sidewalks", "material": "Sidewalk", "color": (0.49, 0.51, 0.49), "z": 0.065}, {"id": "sidewalk_corners", "material": "Sidewalk Corner", diff --git a/blender/tests/test_pure.py b/blender/tests/test_pure.py index 6d41c00..db5809d 100644 --- a/blender/tests/test_pure.py +++ b/blender/tests/test_pure.py @@ -30,12 +30,23 @@ from osmassets.geom import ( sample_tree_row, signed_polygon_area, ) +from osmassets.catalog import ROAD_LAYERS from osmassets.osm import Projector, parse_height, parse_osm, tags SQUARE = [(0.0, 0.0), (10.0, 0.0), (10.0, 10.0), (0.0, 10.0)] +class RoadLayerCatalogTest(unittest.TestCase): + def test_intersection_and_road_asphalt_share_the_same_colour(self): + layers = {layer["id"]: layer for layer in ROAD_LAYERS} + self.assertEqual(layers["road_surface"]["color"], + layers["intersection_surface"]["color"]) + # They remain distinct meshes so the intersection stays above the road. + self.assertNotEqual(layers["road_surface"]["z"], + layers["intersection_surface"]["z"]) + + class GeometryRingsTest(unittest.TestCase): def test_polygon_keeps_only_the_exterior_ring(self): geometry = {"type": "Polygon", "coordinates": [["outer"], ["hole"]]}