Skip to content

Box

A 3-dimensional box oriented on a plane.

This class represents a rectangular prism in 3D space, defined by a base plane and three intervals specifying its dimensions along the x, y, and z axes.

Attributes:

Name Type Description
basePlane Plane

The plane on which the box is oriented

xSize Interval

The interval defining the box's size along the x-axis

ySize Interval

The interval defining the box's size along the y-axis

zSize Interval

The interval defining the box's size along the z-axis

Example
from specklepy.objects.geometry.plane import Plane
from specklepy.objects.geometry.point import Point
from specklepy.objects.primitive import Interval

base_plane = Plane(origin=Point(0, 0, 0), normal=Point(0, 0, 1))
x_size = Interval(start=0, end=10)
y_size = Interval(start=0, end=5)
z_size = Interval(start=0, end=3)

box = Box(basePlane=base_plane, xSize=x_size, ySize=y_size, zSize=z_size)

basePlane instance-attribute

basePlane: Plane

xSize instance-attribute

xSize: Interval

ySize instance-attribute

ySize: Interval

zSize instance-attribute

zSize: Interval

area property

area: float

Calculates the surface area of the box.

Returns:

Type Description
float

The total surface area of the box.

volume property

volume: float

Calculates the volume of the box.

Returns:

Type Description
float

The volume of the box.