CGA, Static Lot, and Heightmap Issue

436
2
11-15-2011 11:32 AM
NathanJosway
New Contributor
I'm not sure if this is a bug in my CGA code or not.  I am trying to create a CGA that will create buildings that are horizontal on non horizontal lots by using some of the code from Tutorial 7 for creating floors and the Alignment2 code from the Non-Horizontal lot posted previously.  I managed to get everything working properly and on lots with any sort of angle the buildings generate correctly but on other lots no geometry is generated unless I move one vertex up or down on the Y axis.  The amount of movement on the Y axis is minimal but as soon as the vertex is moved geometry is generated. 

The picture shows building with aligned to the heightmap with one moved vertex on the left and the blank lot is all vertices aligned to the heightmap on the right.

Thanks in advance,
Nate
0 Kudos
2 Replies
MatthiasBuehler1
Frequent Contributor II
hi ..

My guess would be the issue is here :

LotAligned2(yDim) -->
alignScopeToAxes(y)
extrude(world.y, 100)
split(y) {yDim : BaseVolume | ~1 : NIL}

if yDim gets very small... like 0, no BaseVolume Shape gets created, which is logic. Thus, you get no building.

thus I'd write the code somfing like this :
LotAligned2(yDim) -->
 case yDim > 0.01 :
  alignScopeToAxes(y)
  extrude(world.y, 100)
  split(y) {yDim : BaseVolume | ~1 : NIL}
 else:
  Building


make sense ?
0 Kudos
by Anonymous User
Not applicable
Original User: njosway

Thank you for the help, your solution fixed the problem.  I didn't think about using the yDim as part of the case statement but that was the solution.
0 Kudos