Trimming One Shape with Another

265
0
03-25-2022 08:55 AM
MattOlsen
New Contributor III

Hi everyone, 

Hoping you can help me with a geometric challenge.

I've generated a rule that creates a rectangular tower of a specified width at the corner of a lot, and a shorter podium covering the rest. 

In order to measure the width and length of the lot shape to get the tower, I've created a primitive Quad, which as you can see below extends beyond the footprint of the original, triangular lot.

MattOlsen_0-1648223297898.png

 

attr tower_width = 20

Lot-->
LotShape
alignScopeToGeometry(yUp, 0, 0)
primitiveQuad(scope.sx, scope.sz)
Shape(scope.sx, scope.sz)

Shape(width, length) -->
setback( comp(fe) { left = width - tower_width | back = length - tower_width } ) {all = Podium | remainder = Footprint}

Footprint-->
extrude(50)

Podium-->
extrude(10)

 

What I'm wondering is if it's somehow possible to use the shape of the original lot to trim the parts of the tower and podium shapes that extend outside of the lot?

It would be great if CityEngine had boolean operations (intersect, union etc), similar to some popular 3D modelling software.. but hoping there is some other workaround.

MattOlsen_1-1648223673815.png

 

 

 

 

0 Kudos
0 Replies