# Module Scientific.Geometry.Objects3D

## Class GeometricalObject3D: Geometrical object in 3D space

This is an abstract base class; to create instances, use one of the subclasses.

Methods:

- intersectWith(other)

  Returns the geometrical object that results from the intersection with other. If there is no intersection, the result is `None`.

  Note that intersection is not implemented for all possible pairs of objects. A `ValueError` is raised for combinations that haven't been implemented yet.

- hasPoint(point)

  Returns 1 if point is in the object.

- distanceFrom(point)

  Returns the distance of point from the closest point of the object.

- volume()

  Returns the volume. The result is `None` for unbounded objects and zero for lower-dimensional objects.

## Class Sphere: Sphere

A subclass of GeometricalObject3D.

Constructor: Sphere(center, radius), where center is a vector and radius a float.

## Class Plane: Plane

A subclass of GeometricalObject3D.

Constructor:

- Plane(point, normal), where point (a vector) is an arbitrary point in the plane and normal (a vector) indicated the direction normal to the plane.

- Plane(p1, p2, p3), where each argument is a vector and describes a point in the plane. The three points may not be colinear.

Methods:

- projectionOf(point)

  Returns the projection of point onto the plane.

- rotate(axis, angle)

  Returns a copy of the plane rotated around the coordinate origin.

## Class Cone: Cone

A subclass of GeometricalObject3D.

Constructor: Cone(tip, axis, angle), where tip is a vector indicating the location of the tip, axis is a vector that describes the direction of the line of symmetry, and angle is the angle between the line of symmetry and the cone surface.

## Class Circle: Circle

A subclass of GeometricalObject3D.

Constructor: Circle(center, normal, radius), where center is a vector indicating the center of the circle, normal is a vector describing the direction normal to the plane of the circle, and radius is a float.

## Class Line: Line

A subclass of GeometricalObject3D.

Constructor: Line(point, direction), where point is a vector indicating any point on the line and direction is a vector describing the direction of the line.

Methods:

- projectionOf(point)

  Returns the projection of point onto the line.

## Class RhombicLattice: Lattice with rhombic elementary cell

A lattice object contains values defined on a finite periodic structure that is created by replicating a given elementary cell along the three lattice vectors. The elementary cell can contain any number of points.

Constructor: RhombicLattice(elementary_cell, lattice_vectors, cells, function=`None`, base=`None`)

elementary_cell

  a list of the points (vectors) in the elementary cell

lattice_vectors

  a tuple of three vectors describing the edges of the elementary cell

cells

  a tuple of three integers, indicating how often the elementary cell should be replicated along each lattice vector

function

  the function to be applied to each point in the lattice in order to obtain the value stored in the lattice. If no function is specified, the point itself becomes the value stored in the lattice.

base

  an offset added to all lattice points

## Class BravaisLattice: General Bravais lattice

This is a subclass of RhombicLattice, describing the special case of an elementary cell containing one point.

Constructor: BravaisLattice(lattice_vectors, cells, function=`None`, base=`None`)

lattice_vectors

  a tuple of three vectors describing the edges of the elementary cell

cells

  a tuple of three integers, indicating how often the elementary cell should be replicated along each lattice vector

function

  the function to be applied to each point in the lattice in order to obtain the value stored in the lattice. If no function is specified, the point itself becomes the value stored in the lattice.

base

  an offset added to all lattice points

## Class SCLattice: Simple cubic lattice

This is a subclass of BravaisLattice, describing the special case of a cubic elementary cell.

Constructor: SCLattice(cellsize, cells, function=`None`, base=`None`)

cellsize

  the edge length of the cubic elementary cell

cells

  a tuple of three integers, indicating how often the elementary cell should be replicated along each lattice vector

function

  the function to be applied to each point in the lattice in order to obtain the value stored in the lattice. If no function is specified, the point itself becomes the value stored in the lattice.

base

  an offset added to all lattice points