 |
| View previous topic :: View next topic |
| Author |
Message |
gphillips Newbie
Joined: 13 Oct 2005 Posts: 22
|
Posted: Oct 21st, 2005 07:54 AM Post subject: House |
|
|
Guys,
Doing a vb application to create a house.
Must 1000 from edge of form
4000 twips wide and two floors high - this one is 3000 twips high
Walls are to be red brick - twice as long as they are high and there should be twent brick courses on the fascade. Layed in standard bond. So I make this 20 bricks high, 40 brick wide.
There needs to be roof wich is green - tiles must be visable larger than the bricks - five or six layers.
The problem I have so far is:-
1. I have no idea of code for "even" part of the brick structure. i.e 2nd line of brick from botom all the way to top. This must be overlapping i.e normal structure .
2. This code need to change somehow to make it 40 bricks wide - at the moment it only 16.
Private Sub Command1_Click()
Dim i As Integer, j As Integer, y As Integer, x As Integer, s As Integer
' This will produce black boarder outline of house.
Line (1000, 6000)-(5000, 3000), vbBlack, B
'These are horisotontal line accross the walls - 1st step to created bricks
y = 0
For i = 1 To 20
y = y + 150
Line (1000, 6000 - y)-(5000, 6000 - y), vbBlack
Next i
x = 0
'This creates the 1st segment of the brick structure i.e 1,3 - odd numbers
For i = 1 To 16
x = x + 250
y = 6300
For j = 2 To 20 Step 2
y = y - 300
Line (1000 + x, y)-(1000 + x, y - 150), vbBlack
'Line (1000 + x, 6000)- (1000 + x, 3000) vbblack
Next j
Next i
Private Sub Form_Load()
frmHouse.Show
Line (1000, 6000)-(5000, 30000), vbRed, BF
End Sub
Any help would be appreciated.
Thanks
G |
|
| Back to top |
|
DoobieKeebler Moderator

Joined: 17 Jun 2005 Posts: 254 Location: 181°15'2.003"W, 93°5'16.956"N
|
Posted: Oct 25th, 2005 09:18 AM Post subject: |
|
|
I've been looking at this and trying to get a grip on what's going on. But there's some odd things happening here. Where did the original code come from, and what did it do?
One thing to point out: if the bricks are twice as long as they are high, then a wall 20 bricks high should only be 10 bricks wide, not 40. But here's some "theory" that may help.
You've got your horizontal lines drawn; that part looks good. Now the tricky part. If you know how many twips high a brick is, then you also know how many twips wide it is. So the number of full bricks in a row is the integer of the width of the row divided by the width of a brick. (If a wall is 10 feet wide and a brick is 2 feet long then there are 5 full bricks in a row.)
The problem comes in when then you need X bricks plus part of another brick to make a full row. This is the problem you have. How do you handle the piece of brick?
Let's make things simple and say that the bottom row starts with a full brick on the left edge. So in that row a brick ends at however long a brick is. If a brick is two feet long then a brick ends every two feet. (We're totally ignoring the mortar between the bricks the whole way through here.)
In the second row up, the middle of the first brick is right over the edge between the first and second bricks in the first row. So every brick is shifted half a brick to the right. The first FULL brick starts at half a brick from the left edge, the second brick starts at 1.5 bricks from the left edge, and so on. You're just adding 1/2 a brick length to the strating values of the first row.
The third row is just like the first. The fourth row is just like the second. And so on. I find that it's easier to understand if I draw it out on paper. But that's the logic behind it. Now you just have to turn that logic into code.
Again, it would really help to know where the original code came from and what it did. This will make it easier to modify the code for your purpose. _________________ Always take into account what a user would never ever in a million years do, because someone will.
"In theory, there's no difference between theory and practice. In practice, there is." -- Yogi Berra |
|
| Back to top |
|
gphillips Newbie
Joined: 13 Oct 2005 Posts: 22
|
Posted: Oct 25th, 2005 02:42 PM Post subject: |
|
|
Not sure if I'm getting confused but I still read twice as long as they are high as:-
20 bricks on the fascade - I assume fascade is vertical i,e height of house
therefore the width of the house should be 40 bricks wide.
This is in relation to the number of bricks you see.
You help is greatly appreciated, I somehow conjured up and what you say is coorect, the even numbeed bricks 1st brick should be half the size , to allow a secure structure, overlapping
How you on arrays, timers and interaction with spreadhsheet buddy , Iwill post a message soon on |
|
| Back to top |
|
gphillips Newbie
Joined: 13 Oct 2005 Posts: 22
|
Posted: Oct 25th, 2005 02:50 PM Post subject: |
|
|
will post it on vb application/ vb 6.0 or named timers/ arrays/spreadsheet/
Thanks my friend.
Cheers,
G. |
|
| Back to top |
|
DoobieKeebler Moderator

Joined: 17 Jun 2005 Posts: 254 Location: 181°15'2.003"W, 93°5'16.956"N
|
Posted: Oct 25th, 2005 02:57 PM Post subject: |
|
|
Regarding the number of bricks wide and high. Just to make the math easier let's say the house is 3000 twips by 3000 twips. At 20 rows, the height of a brick is 150 twips and the width of a brick is 300 twips. Since the house is 3000 twips wide and a brick is 300 twips wide, there are 10 bricks in each row. Unless I'm not understanding something you're saying.
I'm good with arrays, OK with timers, and have never really done anything with spreadsheets where VB (or even VBA) is concerned. But I'll help however I can. _________________ Always take into account what a user would never ever in a million years do, because someone will.
"In theory, there's no difference between theory and practice. In practice, there is." -- Yogi Berra |
|
| Back to top |
|
gphillips Newbie
Joined: 13 Oct 2005 Posts: 22
|
Posted: Oct 26th, 2005 05:51 AM Post subject: |
|
|
I think I got confused,
To make bricks twice as long as they are high, and there are 20 brick course on the fascade.Why i think mean vertically.
This means that if the walls of the house is 4000 twips wide, vertcally it must be 2000 twips high , otherwise its impossible to achieve - "twice as long as they are high.
Which means there should be 20 bricks high by 20 bricks wide I believe to achieve this.
Will post some question soon under vba, vb 6.
Thanks,
G |
|
| Back to top |
|
DoobieKeebler Moderator

Joined: 17 Jun 2005 Posts: 254 Location: 181°15'2.003"W, 93°5'16.956"N
|
Posted: Oct 26th, 2005 08:29 AM Post subject: |
|
|
That confirms a sneaking suspicion I had. We're laying out our bricks differently. I'm laying them out this way: ---- and you're laying them out this way: ||||. That makes a world of difference in the math. In my xperience walls are laid out my way while walkways and patios are laid out your way. Since this is your project I'll rotate my layout 90°. _________________ Always take into account what a user would never ever in a million years do, because someone will.
"In theory, there's no difference between theory and practice. In practice, there is." -- Yogi Berra |
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|