def build_basic_shape(obj, options): vertices = options.vertices # TODO: Add width for the wall - how to add end lines to that? options.p1 = p1 = vertices[0] options.p2 = p2 = vertices[1] obj.inside_vector = vg.inside_vector(p1=p1, center=options.center, p2=p2) obj.outside_vector = obj.inside_vector * -1 h = options.height or 5 if h > 1: obj.vertices = vertices_with_up = [p1, p2, vg.up(p2, h), vg.up(p1, h)] # points straight up obj.height = options.height or (vg.highest(vertices_with_up) - vg.lowest(vertices_with_up) + 1) obj.points, obj.top_line, obj.bottom_line, obj.left_line, obj.right_line = vg.rectangular_face( p1, p2, h) obj.points_edges = obj.top_line + obj.bottom_line + obj.left_line + obj.right_line else: obj.vertices = [p1, p2] # points straight up obj.height = h obj.points_edges = obj.points = obj.top_line = obj.bottom_line = vg.getLine( p1.x, p1.y, p1.z, p2.x, p2.y, p2.z) obj.left_line = obj.points[0] obj.right_line = obj.points[-1] obj.cardinality = vg.cardinality(p1, p2) return obj
def build_basic_shape(obj, options): vertices = options.vertices # It's a non-y-rectangular-shaped polygon, so use a different getFace builder function obj.height = options.height or (vg.highest(vertices) - vg.lowest(vertices) + 1) obj.cardinality = options.cardinality obj.points = vg.unique_points(vg.getFace(obj.vertices)) null, obj.top_line, obj.bottom_line, obj.left_line, obj.right_line = vg.poly_point_edges(obj.points) obj.points_edges = obj.top_line + obj.bottom_line + obj.left_line + obj.right_line if options.vertices[0].y > options.center.y: obj.material_clear = Blocks.AIR else: obj.material_clear = Blocks.GRASS return obj