d-wasserman / Complete_Street_Rule

The Complete Street Rule for ArcGIS CityEngine is a scenario oriented design tool intended to enable users to quickly create procedurally generated multimodal streets.
https://geonet.esri.com/docs/DOC-6915
Apache License 2.0
182 stars 36 forks source link

Street Lamps Overlap with the Bridges Above #40

Closed hzxie closed 3 years ago

hzxie commented 3 years ago

Similar to bridge piers, the lamps also overlap with the bridges above.

image

I tried to add an empty bounding box by extrude(y, 6.5) to test whether the lamps overlap with the bridges above.

Sidewalk_Lamp(offset) -->
    alignScopeToGeometry(yUp,largest,0)
    alignScopeToAxes(y)
    center(xz)
    r(0,90,0)
    s(0,0,0)
    report("Objects.Street Lamp Count", 1)
    extrude(y, 6.5)
    Lamp_Check(offset)

Lamp_Check(offset) -->
    case overlaps(inter):
        NIL
    else:
        Lamp_Asset(offset)

Lamp_Asset(offset) -->
    t( SLight_Translate_X ,0, SLight_Translate_Z )
    r(0,90,0)
    t(offset,0,0)
    set(material.name,"Street_Lamp")
    label("Street Lamp")
    color( _ThematicRouter ("Pedestrian","lamp"))
    i(Street_Lamp_Object)
    Delete_Texture

However, it sometimes changes the orientation of the lamps, i.e. some lamps are not in the correct orientation, as shown in the figure below

image

How to solve the problem?

d-wasserman commented 3 years ago

That is very odd, but I would need to see sample files and a project folder. I don't see anything that might change the scope of the inserted object in your code if all you added was the lamp check. Maybe it is the r(0,90,0) in the second rule call?

If you uncomment out the "@Hidden" Handle Parameters, I would just turn the lamps off manually using Handles.

Code modifications to the Complete Street Rule are outside the scope of the repository. I would be interested in your final CGA code post modifications for review if you are willing to share that. However, I am closing this issue for now.

hzxie commented 2 years ago

Please try this file. Bridge-Test.zip