princeton-vl / infinigen

Infinite Photorealistic Worlds using Procedural Generation
https://infinigen.org
BSD 3-Clause "New" or "Revised" License
5.38k stars 466 forks source link

Control the area and height of the room #301

Closed GCChen97 closed 2 months ago

GCChen97 commented 2 months ago

Is it possible to roughly control the floor area and ceiling height of the room? If we can do that, then it may be easier to create some big room such as big classrooms.

I found freespace_2d in constraint_language/__init__.py that seems to control freespace on the floor. Since the room size seems to be decided in the RoomSolver, I don't know if I can define a new constraint in a similar way as freespace_2d to control the room size.

JerryLingjieMei commented 2 months ago

Room height can be changed in https://github.com/princeton-vl/infinigen/blob/88fb49cde0bbca401601d05d672b31d28e9b45cb/infinigen/core/constraints/constraint_language/constants.py#L56 Total room size can be implemented similarily to https://github.com/princeton-vl/infinigen/blob/88fb49cde0bbca401601d05d672b31d28e9b45cb/infinigen_examples/constraints/home.py#L380 but without room type specifications

GCChen97 commented 2 months ago

That is great! Thanks for pointing out the codes :+1:

5a5ha111 commented 1 month ago

It is still a mystery to me how to control the shape and size of the rooms. Can you give an example of how to get a rectangular room of a given size in meters?

RaiaN commented 3 weeks ago

Hey @JerryLingjieMei Can you give one example how to control total room size?

I can think of playing with X value in this code:

rooms[Semantics.Kitchen].sum(
    # lambda r: (r.area() / X).log().hinge(0, 0.4).pow(2)
)

Is this correct?