[070] How to Split Procedural Windows and Facades in CityEngine

Continuing from the last session, we will keep splitting facade 0.

Below is an image to use as a reference for the measurements.

Grayscale building facade photo with dashed overlay lines and dimension labels 11.5m, 3.0m, 2.9m, 1.4m and 13m
figure 1

Among the code we wrote last time, the part corresponding to the ground floor is as follows.

Front_f_Ground_f_wall -->
    split(x){~1 : X. | 13 : Front_f_Ground_f_wall_door | ~1 : X.}
                            # ↑ The section where the door is located

Now we will subdivide Front_f_Ground_f_wall_door.

It looks like it is arranged as 'two windows - door - two windows'.

Then let's split it up.

Front_f_Ground_f_wall_door -->
    split(x){~4.5 : color(0,0,1) FFGWD_window | ~5 : FFGWD_door | ~4.5 :  color(0,0,1) FFGWD_window}
    #In case the window sizes might change, I split everything using approximate values.
Yellow facade: one wide purple band per row, two blue panels at the bottom, gray block on the left
figure 4

The blue area where the windows are located is where two windows go, so we split it once more.

FFGWD_window -->
    split(x){'0.5 : FFGWD_window_final | '0.5 : FFGWD_window_final }
    #Since this area is divided into 2 equal parts, it is fine to split by ratio.
Yellow facade: one wide purple band per row, four blue panels at the bottom, gray block on the left
figure 6

That completes the ground-floor split of facade 0.

Now we will split the window area of the middle floors.

Building facade photo with dashed overlay lines and arrows labeled 2.9m and 1.4m
figure 7

The code for the area where the windows will go is Front_f_Upper_f_Wall_Window_Frame on line 38.

Front_f_Upper_f_Wall  -->
    split(y){~1 : X. | 1.4 : color(0.5, 1, 0,5) Front_f_Upper_f_Wall_Window_Part | ~1 : X.}
    # Split so that the windows are located at the middle height of each floor. They are distinguished with light green.

Front_f_Upper_f_Wall_Window_Part -->
    split(x){~1 : X. | 11.5 : color(1,0.5,1) Front_f_Upper_f_Wall_Window_Frame | ~1 : X.}
    #The part where the windows are located is marked in light purple.

The window area has 6 windows installed.

You can split it in two ways.

The first is to measure the width of each window and split using approximate values.

The second is to use the scope size of that area.

Since we have learned about scope, we will use the scope size to divide the windows into 6.

Front_f_Upper_f_Wall_Window_Frame -->
    split(x){scope.sx/6 : FFUFWWF_final}*
    #Divide the x length of the scope by the number of windows, then repeat.

If there were 7 windows installed, you would divide scope.sx by 7 and then repeat.

Yellow facade: six purple panels per row, one wide purple panel on top, four blue panels at the bottom
figure 10

The middle-floor split is done.

Now we will start on the roof floor.

Close-up of a window band on a facade photo with dashed overlay lines and arrows labeled 11.5m and 3.0m
figure 11

The rule for the roof floor is Front_f_Roof_f_Wall_Window_Frame.

Front_f_Roof_f_Wall_Window_Part -->
    split(x){~1 : X. | 11.5 : color(1,0.5,1) Front_f_Roof_f_Wall_Window_Frame | ~1 : X.}
    #The part where the windows are located is marked in light purple.

The window split does not look normal in the image.

I'll just divide it into 5.

We split it using scope.sx, the same method as for the middle floors.

Front_f_Roof_f_Wall_Window_Frame -->
    split(x){scope.sx/5 : FFRFWWF_final}*
    #Divide the x length of the scope by the number of windows, then repeat.
Yellow facade: six purple panels per row, five purple panels on top, four blue panels at the bottom
figure 14

Okay. The split of facade 0 is now finished.

Textured gray building facade on the left, colored facade with purple windows and blue ground-floor panels on the right
figure 15

They look similar.

We still have 5 more faces to go.

We'll continue step by step, one at a time, in the next session too.

That's all for today.

Continue Learning
Explore complete tutorial collections for CityEngine and Global Mapper.

Comments

Popular posts from this blog

029] How to Split Polygon Areas with Intersecting Lines in Global Mapper

[008] How to Understand CGA Rule Structure in CityEngine (Beginner Guide)

046] How to Create Parallel Offset Lines in Global Mapper