Esempio n. 1
0
def setBoundary(mapBound_grid):
    boundary = init.initBoundMarker()

    # first point
    tempPoint = Point()
    tempPoint.x = 0
    tempPoint.y = 0
    tempPoint.z = 0
    boundary.points.append(tempPoint)

    # second point
    tempPoint = Point()
    tempPoint.x = mapBound_grid[0]
    tempPoint.y = 0
    tempPoint.z = 0
    boundary.points.append(tempPoint)

    # third point
    tempPoint = Point()
    tempPoint.x = mapBound_grid[0]
    tempPoint.y = mapBound_grid[1]
    tempPoint.z = 0
    boundary.points.append(tempPoint)

    # fourth point
    tempPoint = Point()
    tempPoint.x = 0
    tempPoint.y = mapBound_grid[1]
    tempPoint.z = 0
    boundary.points.append(tempPoint)

    # first point again to complete the box
    tempPoint = Point()
    tempPoint.x = 0
    tempPoint.y = 0
    tempPoint.z = 0
    boundary.points.append(tempPoint)

    # first point on the top
    tempPoint = Point()
    tempPoint.x = 0
    tempPoint.y = 0
    tempPoint.z = mapBound_grid[2]
    boundary.points.append(tempPoint)

    # second point
    tempPoint = Point()
    tempPoint.x = mapBound_grid[0]
    tempPoint.y = 0
    tempPoint.z = mapBound_grid[2]
    boundary.points.append(tempPoint)

    # third point
    tempPoint = Point()
    tempPoint.x = mapBound_grid[0]
    tempPoint.y = mapBound_grid[1]
    tempPoint.z = mapBound_grid[2]
    boundary.points.append(tempPoint)

    # fourth point
    tempPoint = Point()
    tempPoint.x = 0
    tempPoint.y = mapBound_grid[1]
    tempPoint.z = mapBound_grid[2]
    boundary.points.append(tempPoint)

    # first point again to complete the box
    tempPoint = Point()
    tempPoint.x = 0
    tempPoint.y = 0
    tempPoint.z = mapBound_grid[2]
    boundary.points.append(tempPoint)

    return boundary
Esempio n. 2
0
def setBoundary(length_of_map, width_of_map, height_of_map):
    boundary= init.initBoundMarker()

    # first point
    tempPoint = Point()
    tempPoint.x = 0
    tempPoint.y = 0
    tempPoint.z = 0
    boundary.points.append(tempPoint)

    # second point
    tempPoint = Point()
    tempPoint.x = length_of_map
    tempPoint.y = 0
    tempPoint.z = 0
    boundary.points.append(tempPoint)

    # third point
    tempPoint = Point()
    tempPoint.x = length_of_map
    tempPoint.y = width_of_map
    tempPoint.z = 0
    boundary.points.append(tempPoint)

    # fourth point
    tempPoint = Point()
    tempPoint.x = 0
    tempPoint.y = width_of_map
    tempPoint.z = 0
    boundary.points.append(tempPoint)

    # first point again to complete the box
    tempPoint = Point()
    tempPoint.x = 0
    tempPoint.y = 0
    tempPoint.z = 0
    boundary.points.append(tempPoint)

    # first point on the top
    tempPoint = Point()
    tempPoint.x = 0
    tempPoint.y = 0
    tempPoint.z = height_of_map
    boundary.points.append(tempPoint)

    # second point
    tempPoint = Point()
    tempPoint.x = length_of_map
    tempPoint.y = 0
    tempPoint.z = height_of_map
    boundary.points.append(tempPoint)

    # third point
    tempPoint = Point()
    tempPoint.x = length_of_map
    tempPoint.y = width_of_map
    tempPoint.z = height_of_map
    boundary.points.append(tempPoint)

    # fourth point
    tempPoint = Point()
    tempPoint.x = 0
    tempPoint.y = width_of_map
    tempPoint.z = height_of_map
    boundary.points.append(tempPoint)

    # first point again to complete the box
    tempPoint = Point()
    tempPoint.x = 0
    tempPoint.y = 0
    tempPoint.z = height_of_map
    boundary.points.append(tempPoint)

    return boundary