Create rooms in house

2126
2
03-15-2016 05:45 PM
ChristianShiel1
New Contributor III

How would I create rooms within a house?

I want to randomly split up the house into several rooms and also the interior walls need different texturing.

ce_out1.PNG

There is the outside:

ce_in1.PNG

And the inside shares the same texture and no ceiling!

I tried making a split but cannot extrude an edge upwards to make partitions:

FloorBase -->

  setupProjection(0, scope.xy, scope.sx/5, scope.sy/5)

  set(material.normalmap, wall_norm)

    projectUV(0)

  texture(floor_tex)

  split(x) { 5: Rooms }*

Rooms -->

  color("#00ff00")

  comp(e) { 0: Room }

  extrude(1) Room

Room -->

  color("#ff0000")

I have tried to extrude and scale but get these weird issues:

prob1.PNG

0 Kudos
2 Replies
ChristianShiel1
New Contributor III

Somehow I have fixed the weird issue.

I am now trying to get random bedrooms inside any given shape. I am using touches() so if a wall touches a window then window is replaced by wall. Not sure how to randomly generate partitions however.

I have this that will create 4 divisions along the y axis but for large or small this won't work:

split(y) { '0.25: RoomsFloor | 0.2: InnerWall }*

I need a way of finding the area or length and then doing an appropriate split condition.

0 Kudos
CherylLau
Esri Regular Contributor

The extrude operation is meant to work on faces and is not defined for edges.  If you make your walls have some thickness, then you could split out a small, thin 2D footprint for the wall and then extrude it to get the wall.

Another option would be to use offset() on each room footprint to get walls around each room.  Here, then, you would have double walls, so you would have to offset by half the wall thickness.  This option would produce double the geometry though.

To create random rooms, you could come up with heuristics using a combination of rand() to generate random numbers, p() for randomness, geometry.area to get the area of the shape, and scope.sx and scope.sz to get the dimensions of the shape.

0 Kudos