blenderproc.python.sampler.SuncgPointInRoomSampler module

Allows the sampling in the SUNCG scenes

class blenderproc.python.sampler.SuncgPointInRoomSampler.SuncgPointInRoomSampler(suncg_objects)[source]

Bases: object

Allows the sampling in the SUNCG scenes

_find_floor(suncg_objects, room_obj)[source]

Returns the floor object of the given room object.

Goes through all children and returns the first one with type “Floor”.

Parameters:
Return type:

Optional[MeshObject]

Returns:

The found floor object or None if none has been found.

sample(height, max_tries=1000)[source]

Samples a point inside one of the loaded suncg rooms.

The points are uniformly sampled along x/y over all rooms. The z-coordinate is set based on the given height value.

Parameters:
  • height (float) – The height above the floor to use for the z-component of the point.

  • max_tries (int) – The maximum number of times sampling above the floor should be tried.

Return type:

Tuple[ndarray, int]

Returns:

The sampled point and the id of the room it was sampled in.