Select to view content in your preferred language

CityEngine - comp and split operations

4895
5
Jump to solution
09-21-2015 04:33 AM
SchSch
by
Deactivated User

Hi,

I would like to use comp() operation and after this the split() operation on my building.

But the building has so many faces / facades on the same sides with different attributes, like textures, windows etc.

How can I use these operations? For example if I use this operation "comp(f) {front : fFacade | side : sFacade | top : Roof}" and then if I use the split() operation, it will split all the faces on the same side, but I want to split only a specific face.

You can find an example about my problem on this link:

I would like to split only one face on the Y axis which is in front.

Thanks for all answers!

BR

Aletta

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
LR
by
Frequent Contributor

Going by face index (as opposed to front, etc) gives you full control but also requires more work since you, AFAIK, can't mix top/bottom/front/etc and face indexes. Try this on a T-shape:

Lot -->
extrude(200)
comp(f){
0: zero | 1: one | 2: two | 3: rc 
| 4: rc | 5: rc | 5: rc | 6:rc | 
7: rc | 8: rc | 9:rc }

zero -->
split(x){~0.5: rc | ~0.5: rc}

one --> color(rand,rand,rand)
two --> color(rand,rand,rand)
rc -->  color(rand,rand,rand)

T.png

View solution in original post

5 Replies
JawadhHabeeb1
Deactivated User

Hello Sch,

You can split the faces by the following also 

comp(f){1 : 1stface | 2 : 2ndface |  ..... and so on to n th face}  -- Here you can access each face of comp(f)

This is another method rather than front, side and Top split.

Regards,

Jawadh

SchSch
by
Deactivated User

Hi,

Thank you for your answer, but this approach of the subdivision doesn't work for me unfortunately properly.

Can you tell me more accurate informations about it?

Besides that I'm waiting for another solutions, too.

Thanks a lot!

BR

Aletta

0 Kudos
BenLeslie1
Frequent Contributor

I don't think you can use a number as the first character of a rule, so Jawadh's example should be altered to something like this:

comp(f){1 : First | 2 : Second |  ..... and so on to n th face}

Otherwise tell us what doesn't work - is it an error or a particular reason it doesn't work for what you're trying to achieve.

LR
by
Frequent Contributor

Going by face index (as opposed to front, etc) gives you full control but also requires more work since you, AFAIK, can't mix top/bottom/front/etc and face indexes. Try this on a T-shape:

Lot -->
extrude(200)
comp(f){
0: zero | 1: one | 2: two | 3: rc 
| 4: rc | 5: rc | 5: rc | 6:rc | 
7: rc | 8: rc | 9:rc }

zero -->
split(x){~0.5: rc | ~0.5: rc}

one --> color(rand,rand,rand)
two --> color(rand,rand,rand)
rc -->  color(rand,rand,rand)

T.png

SchSch
by
Deactivated User

Hi,

Everything is all right, thank you everyone for the helpful advices and the perfect illustration!

BR

Aletta

0 Kudos