# Creating a floor plan! urgent! final assignment due

please format code with </> button * homework policy * asking questions

Please can someone help me create a floor plan!!! this is an elective course im no longer going to take it later on, however i have this final assignment due I need to create a 2D floor plan from processing please please can someone help, anything is ok like either simple or anything, as long as a few walls and room then it’ll be fine pls help!!!

THankyou

1 Like
1. Decide on the image size for the displayed 2D plan e.g. 600x400
2. Get some graph paper and draw a rectangle to represent the whole-floor-area. Make sure there is a simple correlation between graph paper grid size and screen pixels.
3. Now inside this rectangle draw lines, boxes and circles to represent rooms, furniture etc.
4. On the graph paper write down the coordinates (pixel equivalent) for corners line ends etc.
5. Start the Processing IDE and using basic methods such as `line(...)`, `rect(...)`, `fill(...), `stroke(…)` etc to reproduce the drawing

No one here is going to give you a fully coded example because it is an assignment. The assignment is designed for you to prove what YOU have learnt on the course.

3 Likes

please show your entire code and tell us where you are stuck

1 Like

i have actually 0 knowledge TT_TT I do not know how to start, i’ve only made changes to examples i found on youtube.

1 Like

Everyone has to start somewhere and if you have managed to edit some examples from youtube then you should know enough about Processing to create a simple sketch to draw a rectangle or a line. If you can manage that then you should follow the instructions I posted earlier and have a go.

Just get it started and post your code here.

No one is going to code this for you !!!

3 Likes

i understand, thank you!

can someone pls guide me to do something similar to this…

Do you understand that code? It’s doing two loops and drawing some things near the middle, maybe.

Also, a screenshot of code is pretty useless. Please post your code as text, and use the </> button to format it.

1 Like

OK the following code will get you started. Once you have it working simply follow the instructions I have given in my previous posts and you will have a floor plan.

If you get stuck then look in the reference documents for methods that might help you or explanations for the methods used here e.g. `fill(...)`, `rect(...)` etc. If after looking at the reference you don’t understand something then ask here.

I think it’s about time YOU did some work and created some code

``````// Declare any variables here for example we can use these to
// represent the floor plan size
float planW, planH;

// This function is executed once and is used to initialise any
// variables needed by the sketch.
void setup() {
size(600, 400);
planW = 580;
planH = 380;
}

// After setup has been executed This method is used to draw a single
//frame. Processing repeats this method 60 times a second.
void draw() {
background(255); // clear the display with a white background
// Draw floor plan edge
fill(255, 255, 240);
stroke(0);
strokeWeight(3); // default is 1
rect(0, 0, planW, planH);
// From here you can use the drawing commands to draw the rest
// of the floor plan
// ...
}
``````
1 Like

thank you so much for helping

yea!! exactly the point… i guess im not really understanding it… but i figured how to draw a simple floor plan with my friend… thankyou for the help… I’ll keep in mind of that next time

1 Like

Hey, quark!
Thank you very much for your code.
I am teaching myself Python and just got the book, ‘Learn Python Visually - Creative Coding With Processing.py’. As a way to practice, I decided to create an American flag. I had the blue square and red and white stripes done. I figured how to create a star in a senate file and to scale to any size I want using a function. My problem was how to reproduce and place the stars correctly, and your code gave me some ideas on how to do it. When I finish I will place the code. I am sure this is very basic, but it is a good way for practicing/learning.

1 Like