1. Trang chủ
  2. » Luận Văn - Báo Cáo

Algorithms for visual design using the processing language part 2

203 0 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Nội dung

Chapter Advanced Graphics Algorithms An algorithm is a computational procedure for addressing a problem in a finite number of steps In the world of design, and in particular, architecture, the problems designers are called upon to solve are not necessarily solvable in the traditional sense of finding a path between A and B Apart from specific quantitative localized sub-problems that occur within some standardized patterns of construction, the general formal, aesthetic, or planning considerations are barely addressable as discrete solvable problems Consequently, it may be more appropriate to use the term problem addressing rather than problem solving in order to characterize the solution strategy Contrary to common belief, algorithms are not always based on a solution strategy conceived entirely in the mind of a human programmer Many algorithms are simulations of the way that natural processes work and as such they must not be regarded as human inventions but rather as human discoveries Unlike inventions, discoveries are not conceived, owned, or controlled by the human mind, yet as abstract processes they can be codified to be executed by a computer system In this case, the human programmer serves the purpose of codifying a process, that is, a translator of a process external to the human mind to be compiled into machine language, which is also external to the human mind In this chapter, we will present a series of algorithms that although not directly conceived, constructed, or applied for design purposes, can be used indirectly to address design issues A Voronoi tessellation, stochastic search, 153 75488c07.indd 153 3/20/09 1:38:18 PM 154 Chapter n Advanced Graphics Algorithms hybridization, fractals, cellular automata, and evolutionary algorithms are just a few of the algorithms that can be used to address design issues 7.1 Voronoi Tessellation A Voronoi tessellation is the partitioning of a plane into sets of points, each set based on their points’ position from a set of marked points All points closest to the mark are considered sets of a Voronoi tessellation For instance, if two pixels are marked in a computer screen, they will produce two areas that will divide all pixels into those that are closest to either one of the two points These two areas will be bordered by a straight line, dividing the pixels of the screen into these two areas This line, of course, is perpendicular to the line connecting the two marked points (See Figure 7-1.) Figure 7-1: A Voronoi tessellation The problem of the Voronoi tessellation can be addressed in at least in two ways: either by finding the lines and their intersections that divide the plane into areas or by coloring each pixel of the plane based on its proximity to a mark In other words, the problem can be solved either as an analytical geometrical problem or as a finite element problem In this section, we will use the second method: 75488c07.indd 154 float [] px = new float[0]; // hold the mouse pressed marks float [] py = new float[0]; float [] distance = new float[0]; //holds the pixel’s distance to the marked point int [] idx = new int[0]; //used for sorting the pixels 3/20/09 1:38:19 PM Chapter n Advanced Graphics Algorithms 155 PImage MyImage; void setup(){ size (400,400); MyImage = createImage (width, height, RGB); //create an image image(MyImage,0,0); 10 } 11 void draw(){ 12 stroke(0); 13 for(int i=0; i

Ngày đăng: 29/08/2023, 08:27

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN