Select to view content in your preferred language

Negative extrusion — works in CE, doesn't in the viewer

3272
4
Jump to solution
10-07-2014 05:50 AM
LR
by
Frequent Contributor

I've been creating a bunch of buildings with negative extrusions in CE which works fine with my method below. However, when I checked them in the scene viewer, the buildings were full of holes. How do I avoid this?

Simplified script:

version "2014.0"

Lot-->

extrude(20) Gebaeude

Gebaeude--> comp(f){side: Facade(comp.index)  | top: Roof}

Facade(FacadeIndex) -->

case FacadeIndex == 0: Facade000

else: FacadeXXX

Facade000 -->

  color(1,0,0)

  split (x){

  5: side |

  5: center |

  ~5: side

  }

center -->

  split (y){

  5: top |

  5: middle | // Would be a single window texture, for example

  ~5: bottom

  }

middle -->

  extrude(-1)

  comp(f){side: FacadeXXX | top: Undefined} // "Undefined" rule doesn't exist, can be named anything. NIL doesn't work!

FacadeXXX -->

color(rand,rand,rand)

Screenshots:

CE_hole__0000_Layer-3.png

Scene viewer:

CE_hole__0002_Layer-1.png

View from inside/bottom:

CE_hole__0001_Layer-2.png

0 Kudos
1 Solution

Accepted Solutions
MatthiasBuehler
Deactivated User

Hi.

You need to fix the normals of the faces.

Extruding negative reverses the normals. CityEngine by default shows both sides of a polygon. The WebViewer does not to be more efficient.

Rather extrude positively, then translate back.

Ok ?

M.

Matthias Buehler

Head of 3D Technologies

twitter: @MattB3D

-------------------------------

Garsdale Design Limited
matthias.buehler@garsdaledesign.co.uk

www.garsdaledesign.co.uk

View solution in original post

4 Replies
MatthiasBuehler
Deactivated User

Hi.

You need to fix the normals of the faces.

Extruding negative reverses the normals. CityEngine by default shows both sides of a polygon. The WebViewer does not to be more efficient.

Rather extrude positively, then translate back.

Ok ?

M.

Matthias Buehler

Head of 3D Technologies

twitter: @MattB3D

-------------------------------

Garsdale Design Limited
matthias.buehler@garsdaledesign.co.uk

www.garsdaledesign.co.uk

LR
by
Frequent Contributor

Thanks, that fixed it.

Is it possible to enable this "viewer-view" in the editor?

0 Kudos
MatthiasBuehler
Deactivated User

Yes, activate 'backface culling' in the viewport render settings (cogwheel menu).

Cheers!

Matt

Matthias Buehler

Head of 3D Technologies

twitter: @MattB3D

-------------------------------

Garsdale Design Limited
matthias.buehler@garsdaledesign.co.uk

www.garsdaledesign.co.uk

LR
by
Frequent Contributor

Great, thanks again

0 Kudos