Arch227B/D242/D142

Assignment 2:  Cloud Inter-formation

 

Work in groups of two.

Ask questions to Grace (grace_tsai@yahoo.com) or Kostas (kostas@ucla.edu)

 

Objective:

 

Description

Write the source code (with comments) for an application that will open two (or more) DXF files and save them in MyPoint arrays.  Then define operations that will combine/map the MyPoint arrays into a new one. 

        

 

The following is a proposed basic code structure:

. . . .

public class MyIFCloud  extends Frame{

 

    //*****************

    public MyIFCloud(){

 

          super("title");

          setSize(600, 600);

          show();

 

          //**** read the original clouds

          MyPoint[] points1, points2;

          MyFile file = new MyFile();

 

          try{

                points1 = file.readDXFFile(“cloud1.dxf”);

                points2 = file.readDXFFile(“cloud2.dxf”);

            }

            catch(IOException ioe){  }

 

 

            //*** combine the two clouds

            int maxpoints = Math.max(points1.length, points2.length);

            MyPoint[] points;

            points = new MyPoint[maxpoints];

 

            for(int i=0; i< maxpoints; i++){

               points[i].x = combine(points1[i].x, points2[i].x);

               points[i].y = combine(points1[i].y, points2[i].y)

               points[i].z = combine(points1[i].z, points2[i].z)

            }

    }

 

                                                    

 

 

Bonus:

Excessive creativity will be kindly appreciated and highly rewarded.

 

Deadline: