picometer.shapes
Attributes
Classes
Base class for protocol classes. |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
Functions
|
Check if input vectors point along the same line in any direction |
|
Check if input vectors point along the same line in the same direction |
|
Check if input vectors point along the same line in opposite directions |
|
Check in input vectors are perpendicular |
|
Normalize and choose lexicographically-larger of antiparallel v and -v |
|
Calculate angle between two vectors in degrees |
Module Contents
- picometer.shapes.logger
- picometer.shapes.Vector3
- picometer.shapes.Versor3
- picometer.shapes.zero3: Vector3
- class picometer.shapes.AtomSet[source]
Bases:
ProtocolBase class for protocol classes.
Protocol classes are defined as:
class Proto(Protocol): def meth(self) -> int: ...
Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing), for example:
class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check
See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:
class GenProto(Protocol[T]): def meth(self) -> T: ...
- cart_xyz: numpy.ndarray
- picometer.shapes.are_parallel(v: Vector3, w: Vector3) bool[source]
Check if input vectors point along the same line in any direction
- picometer.shapes.are_synparallel(v: Vector3, w: Vector3) bool[source]
Check if input vectors point along the same line in the same direction
- picometer.shapes.are_antiparallel(v: Vector3, w: Vector3) bool[source]
Check if input vectors point along the same line in opposite directions
- picometer.shapes.are_perpendicular(v: Vector3, w: Vector3) bool[source]
Check in input vectors are perpendicular
- picometer.shapes.versorize(v: Vector3) Versor3[source]
Normalize and choose lexicographically-larger of antiparallel v and -v
- picometer.shapes.degrees_between(v: Vector3, w: Vector3, normalize: bool = False) float[source]
Calculate angle between two vectors in degrees
- class picometer.shapes.Shape[source]
- class Kind[source]
Bases:
enum.EnumGeneric enumeration.
Derive from this class to define new enumerations.
- axial = 1
- planar = 2
- spatial = 3
- kind: Shape.Kind
- direction: Versor3
- origin: Vector3
- class picometer.shapes.ExplicitShape(direction: Vector3, origin: Vector3 = zero3)[source]
Bases:
Shape,abc.ABCHelper class that provides a standard way to create an ABC using inheritance.
- property direction: Versor3
- origin
- class picometer.shapes.Line(direction: Vector3, origin: Vector3 = zero3)[source]
Bases:
ExplicitShapeHelper class that provides a standard way to create an ABC using inheritance.
- kind