ddg.geometry.intersection module

Intersections and joins of geometric objects.

The join of two objects X and Y is defined as the union of all lines connecting a point in X with a point in Y.

The functions in this module automatically choose elementary intersection/join functions based on the types of objects and reduce intersections/joins of more than two objects as much as possible. The following types are currently supported:

Supported types for intersections

Types

Function

Subspace and Subspace

ddg.geometry.subspaces.intersect_subspaces()

Quadric and Subspace

ddg.geometry.quadrics.intersect_quadric_subspace()

Supported types for joins

Types

Function

Subspace and Subspace

ddg.geometry.subspaces.join_subspaces()

Quadric and Subspace

ddg.geometry.quadrics.join_quadric_subspace()

Please refer to the elementary functions for further restrictions and details.

ddg.geometry.intersection.intersect(*objects, resolve=True)[source]

Intersect any number of supported geometric objects.

Parameters:
*objectsAny

Objects to intersect

resolvebool (default=False)

Whether or not the intersection should be resolved immediately

Returns:
ddg.geometry.intersection.Intersection or resolved Intersection

Instance of Intersection containing obj1 and obj2 or the intersection of the class obtained by resolving the intersection

See also

join
ddg.geometry.intersection.meet(*objects, resolve=True)

Alias for intersect.

See also

intersect
ddg.geometry.intersection.join(*objects, resolve=True)[source]

Join any number of supported geometric objects.

Parameters:
*objectsAny

Objects to join

resolvebool (default=False)

Whether or not the join should be resolved immediately

Returns:
ddg.geometry.intersection.Join or resolved Intersection

Instance of Join containing obj1 and obj2 or the join of the class obtained by resolving the join

See also

intersect
class ddg.geometry.intersection.Intersection(*obj)[source]

Bases: _IntersectionJoinAux, Iterable

Base class for Intersections.

Parameters:
*objobject

Intersecting objects

See also

Join

Notes

This class supports the “in” keyword, meaning the set element relation.

Attributes:
objectstuple

Tuple of intersecting objects.

Methods

resolve()

Resolve the intersection.

resolve()[source]

Resolve the intersection.

This performs a functools.reduce-like operation on the objects contained in objects until no further reduction is possible with the existing elementary intersection functions.

Returns:
Intersection or resolved type

Returns an Intersection object if full reduction was not possible. Otherwise, returns the result of the final reduction step.

property atol

Maximum of absolute tolerances of objects.

Returns:
float
property rtol

Maximum of relative tolerances of objects.

Returns:
float
property types

Set of types of objects.

Returns:
Set
class ddg.geometry.intersection.Join(*obj)[source]

Bases: _IntersectionJoinAux, Iterable

Base class for joins.

Parameters:
*objobject

Objects to join

See also

Intersection
Attributes:
objectstuple

Tuple of joined objects.

Methods

resolve()

Resolve the Join.

property atol

Maximum of absolute tolerances of objects.

Returns:
float
resolve()[source]

Resolve the Join.

This performs a functools.reduce-like operation on the objects contained in objects until no further reduction is possible with the existing elementary join functions.

Returns:
Join or resolved type

Returns a Join object if full reduction was not possible. Otherwise, returns the result of the final reduction step.

property rtol

Maximum of relative tolerances of objects.

Returns:
float
property types

Set of types of objects.

Returns:
Set