# 2.1. Geometric Primitives¶

class raysect.primitive.Box

A box primitive.

The box is defined by lower and upper points in the local co-ordinate system.

Parameters: lower (Point3D) – Lower point of the box (default = Point3D(-0.5, -0.5, -0.5)). upper (Point3D) – Upper point of the box (default = Point3D(0.5, 0.5, 0.5)). parent (Node) – Scene-graph parent node or None (default = None). transform (AffineMatrix3D) – An AffineMatrix3D defining the local co-ordinate system relative to the scene-graph parent (default = identity matrix). material (Material) – A Material object defining the box’s material (default = None). name (str) – A string specifying a user-friendly name for the box (default = “”).
lower

Lower 3D coordinate of the box in primitive’s local coordinates.

Return type: Point3D
upper

Upper 3D coordinate of the box in primitive’s local coordinates.

Return type: Point3D
class raysect.primitive.Sphere

A sphere primitive.

The sphere is centered at the origin of the local co-ordinate system.

Parameters: radius (float) – Radius of the sphere in meters (default = 0.5). parent (Node) – Scene-graph parent node or None (default = None). transform (AffineMatrix3D) – An AffineMatrix3D defining the local co-ordinate system relative to the scene-graph parent (default = identity matrix). material (Material) – A Material object defining the sphere’s material (default = None). name (str) – A string specifying a user-friendly name for the sphere (default = “”).
radius

Return type: float
class raysect.primitive.Cylinder

A cylinder primitive.

The cylinder is defined by a radius and height. It lies along the z-axis and extends over the z range [0, height]. The ends of the cylinder are capped with disks forming a closed surface.

Parameters: radius (float) – Radius of the cylinder in meters (default = 0.5). height (float) – Height of the cylinder in meters (default = 1.0). parent (Node) – Scene-graph parent node or None (default = None). transform (AffineMatrix3D) – An AffineMatrix3D defining the local co-ordinate system relative to the scene-graph parent (default = identity matrix). material (Material) – A Material object defining the cylinder’s material (default = None). name (str) – A string specifying a user-friendly name for the cylinder (default = “”).
height

Extent of the cylinder along the z-axis.

radius

Radius of the cylinder in x-y plane.

Return type: float
class raysect.primitive.Cone

A cone primitive.

The cone is defined by a radius and height. It lies along the z-axis and extends over the z range [0, height]. The tip of the cone lies at z = height. The base of the cone sits on the x-y plane and is capped with a disk, forming a closed surface.

Parameters: radius (float) – Radius of the cone in meters in x-y plane (default = 0.5). height (float) – Height of the cone in meters (default = 1.0). parent (Node) – Scene-graph parent node or None (default = None). transform (AffineMatrix3D) – An AffineMatrix3D defining the local co-ordinate system relative to the scene-graph parent (default = identity matrix). material (Material) – A Material object defining the cone’s material (default = None). name (str) – A string specifying a user-friendly name for the cone (default = “”).
height

The extend of the cone along the z-axis

Return type: float
radius

The radius of the cone base in the x-y plane

Return type: float
class raysect.primitive.Parabola

A parabola primitive.

The parabola is defined by a radius and height. It lies along the z-axis and extends over the z range [0, height]. The base of the parabola is capped with a disk forming a closed surface. The base of the parabola lies on the x-y plane, the parabola vertex (tip) lies at z=height.

Parameters: radius (float) – Radius of the parabola in meters (default = 0.5). height (float) – Height of the parabola in meters (default = 1.0). parent (Node) – Scene-graph parent node or None (default = None). transform (AffineMatrix3D) – An AffineMatrix3D defining the local co-ordinate system relative to the scene-graph parent (default = identity matrix). material (Material) – A Material object defining the parabola’s material (default = None). name (str) – A string specifying a user-friendly name for the parabola (default = “”).
height

The parabola’s extent along the z-axis [0, height].

Return type: float
radius

Radius of the parabola base in x-y plane.

Return type: float