AnsweredAssumed Answered

Corner lot test not working

Question asked by trilec on May 5, 2015
Latest reply on May 7, 2015 by trilec

imports fail to load

reports "no such function" : ? streetWidth()

 

file Colors.cga contains:

SNOW -->color("#FFFAFA")

 

real bummer if this is the case, as you cant test a corner lots if you have imports

this code was the default example to test corners, WHY this is not a standard "geometry.isCorner" is beyond me...

 

version "2014.0"

 

import col  : "Colors.cga"  <<<<< error "no such function" : ? streetWidth()

 

 

#BuildingVariables

attr    BldMasterHeightMin = 10

attr    BldMasterHeightMax = 30

 

attr BldIsCorner =  false

 

attr streetWidth(i) =  0  <<<<<the offending line needed for index Recursion

 

 

Lot-->

    CornerRecursion(geometry.nVertices - 1, 0)

 

CornerRecursion ( edgeID, nStreetEdges ) -->

    case edgeID >= 0 :

        case streetWidth(edgeID) > 0 :

            #print (edgeID)

            CornerRecursion ( edgeID - 1, nStreetEdges + 1 )

        else:

            #print (edgeID)

            CornerRecursion ( edgeID - 1, nStreetEdges )

    else:

        case nStreetEdges >= 2 :

            #set(BldIsCorner, true)

            doLot #corner Lot

        else:

            #set(BldIsCorner, false)

            doLot #Not corner lot

 

doLot-->

    extrude(rand(BldMasterHeightMin, BldMasterHeightMax))

    comp(f) { top: doTop | all: doFacard }

 

doTop-->

    roofHip(20)

    col.PINK

 

doFacard-->

    col.PINK

Outcomes