Element in Inside Room

Hello. How can I find out if an element can be placed in a room? First I got the geometry of the room, then I got the geometry of the other elements in the room, then I found the geometry outside the elements as a surface. Thanks for your help.

You’re going to need to provide more information. What do you mean by “if an element can be placed in a room”? If the element fits? If it can avoid intersection with other elements? Do you only care about the footprint of the element? How is it placed? Can it be rotated? Are there requirements that the room must meet?

All of these considerations will affect how you determine what “fits” and what doesn’t. It sounds like you might have a packing problem but it could be simpler than that. Once we know what kind of problem you’re dealing with, we can start to suggest different approaches or packages.

Hello @Nick_Boyts. I want to find out if a cube with a width of 1 meter can fit in a room without intersection with other elements.

This is called a packing problem. I suggest you look into custom packages or python modules that can help with this. I believe Sparrow has some nodes that should help. Not sure if Refinery is supported anymore, but it used to have packing nodes as well. It’s also a good idea to look into other threads that cover this kind of topic. The discussions there should give you a good starting point.

Once you have something put together we can answer any specific questions you may have.

1 Like

Refinery toolkit still works as of 2.19. I haven’t checked 3.0 builds. That said there are requirements which make it less useful in my opinion.

I recommend a Python or C# based solution leveraging coordinate systems.

2 Likes

Actually Revit API supported to do that with method IsPointInRoom :

But you can try with orignal node in OpenMEP package :slight_smile: in case use with complex purpose
https://chuongmep.github.io/OpenMEP/api/OpenMEPSandbox.Geometry.Point.html#OpenMEPSandbox_Geometry_Point_IsInPolygonPlus_Autodesk_DesignScript_Geometry_Point_Autodesk_DesignScript_Geometry_Polygon_
Point.IsInPolygons

3 Likes

@chuongmep That’s just finding if a point is in the room. I think OP is trying to find out if a cube fits in the room - zero overlap with anything.

@yaseminV2XL5 …
The packing algorithms aren’t as good as humans yet…

But working out if you have 1m squared in a room is a different problem maybe? Could have some fun with that one.

Maybe find the pole of inaccessibility then placing the centre of the object there and seeing if it clashes would be a nice way to go.

@Alien Where should I start for this?

I usually start by Googling and seeing what’s been done before.

What’s this for?

Nah - they’re plenty good in 2d or 3d - in fact they’re orders of magnitude faster than we are in many cases. You just have to understand how to use them for what you’re after; this means we have to learn how to build them on our own. This is because in design we rarely ‘just want things to fit’, but instead ‘want things to fit so we get a good outcome’. And so true packing algorithms aren’t usually ideal for our use.

To use an analogy: it’s less about ‘fit the groceries in the bag’ and more about ‘fit the groceries in the bag so that cold things stay together and the eggs and bread don’t get squished and the load is evenly balanced and I can unload it easily when I get home and…’. And while we can build an algorithm to accomplish any one of those things, we can’t build it in such a way as to enable all the things after that last and... as humans aren’t good at listing what all of those are, never mind deciding which are most important in every situation.

Space Planning

2 Likes

I stand by my comment… Humans are better at packing, eg, squishing the most stuff in a tight space… Putting stuff into a space with enough room left over to swing a moose isn’t what I’d call good packing.
Speed the computers win at. But hey, I can splash paint all over at a great speed, Michelangelo I am not. :laughing:

The ‘sample’ there was built from scratch in about an hour between calls a few months back, and doesn’t allow for altering the provided objects in any way (ie no rotation relative to the location or resizing the object to ‘fill small areas otherwise unused’), all of which can be done.

A better example might be finding the way to best utilize stock of cut lumber, a problem which people very much struggle with, yet computers work though very consistently.

not sure guess @Thomas_Corrie have a package there can do so…cant remember the name…but a really good one next time you are shopping in Ikea :wink:

1 Like

Miscellany

3 Likes

@sovitek Love that package. :slight_smile:

@jacob.small I’m not saying computers can’t do stuff… And i’m not saying that script isn’t cool… however it’s rectangles in a shape with lots of left over space, and some weird shapes and the computer struggles without super complex code and big processing, using lots of energy.

There are tonnes of articles and research on this subject, some amazing reads. For example MIT came up with a new method last year. And there’s one from the American Airforce.

however, for the OP, I think my suggestion of pole of inaccessibility will work well for the single item.

1 Like

If you’re only looking for one object to be placed anywhere within the given space, then I think a voxel workflow could work as well. Viability would be dependent on how “detailed” your space may be and would also have some edge cases for really tight areas. But as a quick and dirty method, could work pretty well.

@jacob.small I researched it. But does it only work on rectangles? Does it work in other geometries? Can we do this with PackingRectangles in RefineryToolkit?

@Nick_Boyts Yes,firstly I looking for only one object to be placed anywhere. You mean the VASA package, right?

Most packing algorithms assume regular shapes (typically rectangular or circular). If your object’s footprint is a 1x1 meter square then you would use that as the packing objects, not the “full” geometry of the object.

That’s where I’d start.

1 Like

We should do this as a fun forum comp :smiley:

@yaseminV2XL5 is this for work or for study? I’m wondering why you’d want a 1m cube in a space. :smiley: