Author Topic: Ceiling Grid - Revisited - assistance, please  (Read 10088 times)

0 Members and 1 Guest are viewing this topic.

nivuahc

  • Guest
Ceiling Grid - Revisited - assistance, please
« on: March 02, 2005, 03:42:43 PM »
I'm working out the new, sleeker, better code for the ceiling grid routine that I want to implement. The whole change was sparked by the idea, which never even occurred to me originally, of changing my snapbase. That was a superb idea. I'm glad I posted that ugly code, simply for that.

Take a look at this image and try to understand what I'm doing here, if you would. My intent is to have the drafter draw the frame around the room using a polyline, collecting a list of the points along the way and calculating the center of the room.



The list of points displayed, if you want to try the math out on your own, are as follows:

(107.508 381.76 0.0)
(107.508 278.607 0.0)
(177.133 278.607 0.0)
(177.133 169.462 0.0)
(330.07 169.481 0.0)
(330.07 169.481 0.0)

With my new snapbase figured as

(218.789 275.611 0.0)


How do I go about figuring that out? To figure out the new value of X for my new snapbase I use

Code: [Select]
((highest_X_value - lowest_X_value) / 2 + lowest_X_value) = new_X_value

so, in my example, I get this:

Code: [Select]
((330.07 - 107.508) / 2 + 107.508) = 218.789

Same formula, essentially, for figuring the new value of Y as in

Code: [Select]
((highest_Y_value - lowest_Y_value) / 2 + lowest_Y_value) = new_Y_value

so, in my example, I get this:

Code: [Select]
((381.76 - 169.462) / 2 + 169.462) = 275.611

That works out wonderfully. Perfect, in fact. Is there a better, quicker, sleeker way to do it? That's what I'm asking you. But take a look at this, because this is where I'm really stumped:





At an angle:

(475.141 324.779 0.0)
(548.081 251.839 0.0)
(597.314 301.071 0.0)
(674.491 223.894 0.0)
(782.621 332.05 0.0)
(632.516 482.154 0.0)

My snapbase, which I have figured out manually, should come out to be:

(628.895 328.419 0.0)

My formula above doesn't work, I am suffering from severe tunnel vision regarding what I need to do, so I really could use a fresh set of eyes and another brain to look at this and guide me in the right direction. My brain is stuck in a do-while loop.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Ceiling Grid - Revisited - assistance, please
« Reply #1 on: March 02, 2005, 04:18:25 PM »
You must get the user to make the first two picks along the wall you want as the horizontal reference.
When you get all points you can set a new UCS, trans the points, get the snapbase & trans back before
you use it. Another way would be to mathematically rotate the point about the first pick based on the
angle of p1 p2. I don't know how to do that but it can be done.
Another way would be to draw a pline using the points, rotate it as mentioned above. Get the snapbase
and place a point. Then rotate that point back. Then it would be the base point you need.

The last two make my head hurt so I choose number one. :)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

nivuahc

  • Guest
Ceiling Grid - Revisited - assistance, please
« Reply #2 on: March 02, 2005, 04:34:21 PM »
Thanks CAB.

I considered having them select the points, using the 'rubber-band' method, getting the angle from point_1 to point_2, drawing the polyline, rotating it based on that angle (point_1 to point_2), getting a list of the points along that newly rotated polyline, calculating the center, changing the snapbase, doing the hatch, putting the snapbase back, then rotating the whole mess back in place... but that seems like an awful lot of un-necessary stuff. I know there is a better way and I know I just can't see it right now.

The only problem I see is, whenever you start off thinking "You must get the user to..." you can usually rest assured that the user will do anything but what you want/need them to do.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Ceiling Grid - Revisited - assistance, please
« Reply #3 on: March 02, 2005, 04:43:15 PM »
Your method will work fine. It gets the job done. It's not that hard.
As for the room orientation, there is no way to tell what wall to use as
a base line with out help from the user, period. Given an irregular
shaped room it is the user that decides which way the grid should orient.
So the user must convey that to the routine.

You may want the user to pick the orientation separately from the outline
to be sure you are communicating.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

nivuahc

  • Guest
Ceiling Grid - Revisited - assistance, please
« Reply #4 on: March 02, 2005, 04:56:49 PM »
Actually, think it through... if a user picks the first point, then the next, despite which point the choose at whatever angle they choose, I have an angle that I can use to do my rotating. It doesn't really matter which two points they pick, just so long as they are on the same wall. Right?

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Ceiling Grid - Revisited - assistance, please
« Reply #5 on: March 02, 2005, 05:21:24 PM »
Take a look at this living room. There are several starting points that will get you into trouble.
Given some time I can come up with a better example, if you need it. :)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

nivuahc

  • Guest
Ceiling Grid - Revisited - assistance, please
« Reply #6 on: March 02, 2005, 05:26:09 PM »
point duly noted! :lol:

whdjr

  • Guest
Ceiling Grid - Revisited - assistance, please
« Reply #7 on: March 02, 2005, 05:26:29 PM »
WOW CAB!

you got a bunch of stuff runnin on your machine.  You must have a super computer over there. 8)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Ceiling Grid - Revisited - assistance, please
« Reply #8 on: March 02, 2005, 05:53:24 PM »
You would laugh if you saw it. The side panel of the tower is open & I have a small electric fan
blowing on the mother board. The early AUSUS with AMDs have an inferior fan.
At 1.4ghz it is slow compared to today's toys. :D
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

hudster

  • Gator
  • Posts: 2848
Ceiling Grid - Revisited - assistance, please
« Reply #9 on: March 03, 2005, 03:55:51 AM »
CAB, I see you are using IE, try the fox, it's way better.
Revit BDS 2017, 2016, 2015, 2014, AutoCAD 2017, 2016, Navisworks 2017, 2016, BIM360 Glue

SMadsen

  • Guest
Ceiling Grid - Revisited - assistance, please
« Reply #10 on: March 03, 2005, 07:23:46 AM »
Nothing happens when I click the buttons on your screen, CAB. Why?!?

 :lol:

By the way, what's a lanai? Is that an outdoor thing?

daron

  • Guest
Ceiling Grid - Revisited - assistance, please
« Reply #11 on: March 03, 2005, 07:32:31 AM »
Lanai, is another one of those words for porch or patio, mostly enclosed. Yes, it's an outdoor thing.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Ceiling Grid - Revisited - assistance, please
« Reply #12 on: March 03, 2005, 07:38:36 AM »
Quote from: SMadsen
Nothing happens when I click the buttons on your screen, CAB. Why?!?

 :lol:

By the way, what's a lanai? Is that an outdoor thing?


I put my screen lock on. :)

When a house living area gets over 4000 sq feet living area you're not allow to use
mundane labels like porch and hall. You must use Lanai [French] and gallery.
Makes the rich folk happy. 8)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

sinc

  • Guest
Ceiling Grid - Revisited - assistance, please
« Reply #13 on: March 03, 2005, 08:09:15 AM »
I'm not entirely sure what you're trying to accomplish here and why, but it seems like you might be able to use regions to find the centroid, instead of using a closed polyline.  You might want to check the documentation on Region objects and see if they'll help you.  You can create a region with lines and arcs, then simply ask it for its centroid.

nivuahc

  • Guest
Ceiling Grid - Revisited - assistance, please
« Reply #14 on: March 03, 2005, 09:26:25 AM »
Quote from: sinc
I'm not entirely sure what you're trying to accomplish here and why, but it seems like you might be able to use regions to find the centroid, instead of using a closed polyline.  You might want to check the documentation on Region objects and see if they'll help you.  You can create a region with lines and arcs, then simply ask it for its centroid.


Nice idea, but it's a no-go.

Tried several methods for obtaining the centroid of the newly created region (in the first image) and each method came up with a different result. None of them came up with the actual center of the room, though.

But I appreciate you thinking outside of the box. That's the kind of responses I was looking for. I fear that I have poisoned the mind of anyone who reads this thread by telling how I intended to go about accomplishing this.

The normal, manual, method that we use to determine the center of a room is simply to draw a diagonal line from the apparent intersections of the outermost corners of a room and select the midpoint of that line. I'll try to illustrate:



You see, in the example above, with a room that is not at an angle that this is fairly simple. The midpoint of my diagonal line is the location of my new snapbase. Setting my snapbase to this point, then creating a user defined hatch with a spacing of 24 inches places my ceiling grid centered in the room, just like the contractor would install it, and spaced evenly so that the lighting that I will place will have the most even distribution possible.

When the room is at an angle, however, we use a different method as shown here:



While, in this example, the diagonal line method would also work, that quickly becomes a problem when the room area gets a little more complex, like the image that CAB posted. In this situation, we would draw two lines. One of them from the midpoint of an outermost wall perpindicular to the outermost wall in the opposite direction (it doesn't matter at this point if the wall you choose is the larger or the smaller). Again, another line, perpindicular to the first. Both lines are moved to their respective midpoints and you get what is shown above, with the location of the new snapbase being the intersection of those two lines.

All of this is to achieve what we have in the following image:



The tile (grid) is equal on each opposite side of the room. The length of the tile along the wall with our bathroom and the opposing door is the same length as our tile on the opposite wall. The length of the tile on the wall with the two outgoing doors is the same length as the tile on the opposing wall of the overall room. All of our tiles are 'centered', all of our lights are placed in these tiles, and our light distribution is as even as it can be throughout the room.

Whatever method I use to determine the center of a room at an angle should also be capable of finding the center of a room that is not at an angle. The manual method that I spoke of does just that. I know there has to be a simpler, less complicated way to get to this point.

Forget any method I have mentioned thus far and consider it your task to find the center of the room using lisp. How would you go about doing that? And, for the record, we're working in 2D.