using mapping layer to generate doors/entrances on building models

644
2
03-31-2017 05:58 AM
MarekDekys
New Contributor III

Hello, I have a mapping layer that represents building entrance positions

I would like to use this information to cut the door on a facade of an existing building model (not generated from footprint) using following approach:

the building's facade will be cut vertically into regular 1m slices (blue color) then I will check each of these slices if it is lying on 100% red color from the mapping layer. If true, then I will make a 2nd subdivision (green color) to create a small face to place a door texture on it as on the picture below:

the problem is that:

1) if there is only little color below the building, and I'm using attribute that has mapping layer connected to it - it only returns 0 (because there is too little red color compared to the area of the building model)

2) I don't know if it is possible to get color information from mapping layer for a subface - from my tests it looks like it isn't working (as on the picture below). When I subdivide facade using split() command, all building slices seem to contain the same information as the whole building model using following rule on them:

#attr that connect to mapping layer to get color info
attr Red_texture = 0

#decompose to vertical faces only
Lot --> comp(f){ vertical : VerticalPlane}

VerticalPlane -->
#fixes for correct alignment
alignScopeToGeometry (zUp, any, world.lowest)
alignScopeToAxes(y)
#splitting faces indefinetly by 1m spacing
split(x){1:verticalSegment}*

#subface
verticalSegment-->
case Red_texture > 100: # if it contains at least a little ammount of red color
color(1,0,0) # paint this subface red
else:
color(0,1,0) # otherwise paint it green

or if there is any better working approach for creating building entrances please share your ideas

thanks,

Mark

0 Kudos
2 Replies
CherylLau
Esri Regular Contributor

The reason why the vertical split pieces are not getting the color information from the map layer is because only the initial shape can read the map layer information.  The attribute Red_texture is set to a value that it gets from the map layer before any rules are executed.  The map layer is sampled at the center of the initial shape.  When the rules are executed, each piece of the split has the attribute Red_texture = 0 because the map layer was sampled once for the initial shape at the center of the initial shape.

Possible Solution:

Create another shape the size of the map layer.  Then, put a rule on this shape that splits the shape into grid cells with the size of your door.  Then, create static shapes out of each grid cell (Shape -> Convert model to shapes).  On each grid cell shape, assign a rule that has an attribute that connects to the map layer.  Instead of red circles, use red squares in your map image (since the grid cells are square and sampling happens at the center).  Then, each grid cell shape will have an attribute value that comes from the map layer, and this value will be 1 where there should be a door and 0 otherwise.  Also in the rule, if the grid cell corresponds to a door location (attribute value is 1), then create an extruded shape (some shape with a volume), and otherwise, do not create any geometry (NIL).  Then, in your building rule, test if the face intersects (operations touches, overlaps, or inside) one of the door location shapes.  If it does intersect, then you know you can create a door there, and otherwise, create a wall.

MarekDekys
New Contributor III

Hi Cheryl,

thanks for quick reply. that's a pity that only the initial shape can read color information...

I was thinking about similiar possible solution with occlusion queries but unfortunatelly I am also using these occlusion queries for checking intersection with terrain (as discussed here detecting terrain intersetion with a shape to achieve more realistic window texturing )

Therefore, If I implement both things into texturing generation (mesh-terrain intersection and door intersection) the second check will always give me wrong results (it will detect door position as a high hill in terrain and put window texture only above this intersection..) because If I am not mistaken, I cannot target specific shape to check againtst: I can only use overlaps(inter) to check against (all ) geometry in other shape trees

If somebody has some other solution please let me know.

thank you

0 Kudos