prochitecture / pml

Translator for PML (Prochitecture Markup Language)
2 stars 0 forks source link

Syntax for elements derived from the footprint (detected patterns, elements defined on a footprint node) #10

Open vvoovv opened 3 years ago

vvoovv commented 3 years ago

WORK IN PROGRESS, NOT YET READY FOR THE REVIEW

An example of the element defined on a footprint node is a building entrance (OpenStreetMap tag: entrance)

facade[@apply_footprint_data](..condtion..) {
    // generate a div for a pattern
    generateFor: pattern, entrance;
    generate: div;
    markup: [

        div(item.edge.pattern is rectangle and not item.edge.hasEntrance()) {
            markup: [
                level {
                    markup: [
                        balcony {
                            class: myclass;
                        }
                    ]
                }
            ]
        }

        div(item.edge.pattern is rectangle and item.edge.hasEntrance()) {
            markup: [
                extrude_original {
                    markup: [
                        face(item.front) {
                            markup: [
                                level[0] {
                                    generateFor: entrance;
                                    generate: door;
                                    markup: [
                                        door{
                                            class: entrance_door
                                        }
                                    ]
                                }
                            ]        
                        }
                    ]
                }
            ]
        }

       div(item.center) {
           fromPattern: rectangle;
           level {
               markup: [
                 balcony {
                     class: myclass;
                 }
               ]
           }
       }

    ]
}
vvoovv commented 3 years ago

How to deal with a curvy part in PML.

A PML style is applied to the whole curvy facade generated from the curvy sequence.

Suppose a curvy part is formed by the segments S1, S2, S3, S4, S5. A PML style is applied to the flat area created after unwrapping the polygons generated from the segments S1, S2, S3, S4, S5.

The attribute curvy can be used in the style block condition:

facade(item.curvy) {
    ...
}