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:
Types |
Function |
|---|---|
Subspace and Subspace |
|
Quadric and Subspace |
Types |
Function |
|---|---|
Subspace and Subspace |
|
Quadric and 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
- 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
- class ddg.geometry.intersection.Intersection(*obj)[source]
Bases:
_IntersectionJoinAux,IterableBase class for Intersections.
- Parameters:
- *objobject
Intersecting objects
See also
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
objectsuntil 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,IterableBase class for joins.
- Parameters:
- *objobject
Objects to join
See also
- 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
objectsuntil 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