City Engine: Trim Object at Border of other Shape

3497
0
07-20-2015 07:09 AM
JonasWeiter
New Contributor

Hello,

I have got a Problem and don't know how to solve this.

I have two overlaying shapes representing the outline of a building and the outline of the property(Pic.1).

Starting from the first edge of the building I want to create s.th like a roof ranging to the outline of the property(Pic.2).

(Pic. 1)

Building and property.png

(Pic. 2)

Building and property2.png

However I am not able to trim the yellow plane at the edge of the shape.

I tried to use the functions overlaps(), inside(), and touches() and trim() but it doesn't work.

Btw I am using Version 2014.1 and my code looks like this:

version "2014.1"
const height= rand(5,8)
const length=50

Lot-->
    comp(f){0:rest|1:Lot1 Lot2}
rest-->
    color(50,50,50)
    extrude(-.1)
Lot1-->
    extrude(height)
Lot2-->
    comp(e){0:firstedge}
firstedge-->
    i("builtin:cube")
    r(90,0,0)
    t(0,0,-scope.sx)
    comp(f){bottom:cubeBottom}
cubeBottom-->
    reverseNormals()
    t(0,scope.sx,0)
    s('1,-length,'1)
    test1  
test1-->
    case overlaps(inter):
        color(255,0,0)
        trim()
    else:
        color(255,255,0)

Can anyone help me with this?

I have also tried to use a multipolygon (combine Shapes), but even this doesn't work.

regards

0 Kudos
0 Replies