Pointcloud.from_box
- classmethod Pointcloud.from_box(box, n)[source]
Construct a point cloud within a given box.
- Parameters:
- box: :class:`compas.geometry.Box`
The axis aligned bounding box of the cloud.
- n: int
The number of points in the cloud.
- Returns:
Examples
>>> from compas.geometry import Box >>> cloud = Pointcloud.from_box(Box.from_width_height_depth(10, 3, 5), 100) >>> all((-5 < x < +5) and (-2.5 < y < +2.5) and (-1.5 < z < +1.5) for x, y, z in cloud.points) True