ddg.datastructures.nets package
Subpackages
- ddg.datastructures.nets.net_generators package
- Submodules
- ddg.datastructures.nets.net_generators.confocal_quadrics module
- ddg.datastructures.nets.net_generators.jacobi_elliptic_curve module
- ddg.datastructures.nets.net_generators.quadrics module
two_points()circle()hyperbola()linepair()interline()cline()parabola()sphere()hyperboloid_one_sheeted()hyperboloid_two_sheeted()paraboloid_elliptic()paraboloid_hyperbolic()cylinder_elliptic()cylinder_hyperbolic()cylinder_parabolic()cone()line()planes_intersecting()planes_parallel()plane()
- ddg.datastructures.nets.net_generators.spheres_and_circles module
- Module contents
- Submodules
Submodules
- ddg.datastructures.nets.conversion module
- ddg.datastructures.nets.domain module
is_bounded_interval()domain_decomposer()DomainEmptyDomainSmoothDomainSmoothRectangularDomainSmoothRectangularDomain.intervalsSmoothRectangularDomain.periodicitySmoothRectangularDomain.boundedSmoothRectangularDomain.dimensionSmoothRectangularDomain.recover()SmoothRectangularDomain.unbounded_directionsSmoothRectangularDomain.bounded_directionsSmoothRectangularDomain.count()SmoothRectangularDomain.index()
SmoothIntervalDiscreteDomainDiscreteRectangularDomainDiscreteRectangularDomain.edge_dataDiscreteRectangularDomain.face_dataDiscreteRectangularDomain.dimensionDiscreteRectangularDomain.double_edgedDiscreteRectangularDomain.intervalsDiscreteRectangularDomain.periodicityDiscreteRectangularDomain.traverserDiscreteRectangularDomain.boundedDiscreteRectangularDomain.recover()DiscreteRectangularDomain.unbounded_directionsDiscreteRectangularDomain.bounded_directionsDiscreteRectangularDomain.count()DiscreteRectangularDomain.index()
DiscreteIntervalDiscreteInterval.intervalDiscreteInterval.periodicDiscreteInterval.recover()DiscreteInterval.boundedDiscreteInterval.bounded_directionsDiscreteInterval.count()DiscreteInterval.dimensionDiscreteInterval.double_edgedDiscreteInterval.edge_dataDiscreteInterval.face_dataDiscreteInterval.index()DiscreteInterval.intervalsDiscreteInterval.periodicityDiscreteInterval.traverserDiscreteInterval.unbounded_directions
DiscreteTriangularDomainDiscreteDiagonalDomain
- ddg.datastructures.nets.net module
- ddg.datastructures.nets.traverser module
- ddg.datastructures.nets.utils module
domain_util()net_util()homogenize()dehomogenize()embed()vertices()applicable_to_netcollection()surface_of_revolution()cylinder()cone()sample_interval()coordinate_hypersurface()coordinate_line()coordinate_lines()coordinate_grid()diagonal_lines()octahedral_grid()shrink_domain()bound_domain()create_subdomain()continue_by_reflection()concatenate()evaluate()delete_direction()modify_direction()cut_bounding_box()
Module contents
Package Documentation
- class ddg.datastructures.nets.SmoothNet(fct, domain, *args, **kwargs)[source]
Bases:
NetStore and manage data of a smooth net.
- Parameters:
- fctfunction
Function defining the net.
- domainddg.datastructures.nets.domain.SmoothDomain or list of intervals
Domain of
fct.- periodicityset, optional
Set containing indices of periodic coordinate directions.
- periodicbool
Alternative way of specifying periodicity for one dimensional net. It precedes periodicity if set.
- namestr, optional
Name of the net (mostly used for blender conversion).
See also
Net,NetCollection
- property dimension
- property fct
- pop_transformation()
Pop transformation from the trafo-stack.
- Returns:
- function
- push_transformation(f)
Add a transformation to the trafo-stack.
- Parameters:
- fnumpy.ndarray or function
- transform(f)
Wrapper for
push_transformation.See also
- property transformation
Composition of all transformations on the stack.
- Returns:
- function
- class ddg.datastructures.nets.SmoothCurve(*args, **kwargs)[source]
Bases:
SmoothNet- property dimension
- property fct
- pop_transformation()
Pop transformation from the trafo-stack.
- Returns:
- function
- push_transformation(f)
Add a transformation to the trafo-stack.
- Parameters:
- fnumpy.ndarray or function
- transform(f)
Wrapper for
push_transformation.See also
- property transformation
Composition of all transformations on the stack.
- Returns:
- function
- class ddg.datastructures.nets.DiscreteNet(fct, domain, hint=None, **kwargs)[source]
Bases:
Net,IterableStore and manage data of a discrete net.
- Parameters:
- fctfunction
Function defining the net.
- domainddg.datastructures.nets.domain.DiscreteDomain or list of intervals
Domain of ‘fct’.
- periodicityset, optional
Set containing indices of periodic coordinate directions.
- traverserddg.datastructures.nets.traverser.Traverser, optional
Traversing scheme of the dicrete net.
- namestr, optional
Name of the net (mostly used for blender conversion).
- inititerable or ddg.datastructures.nets.domain.DiscreteDomain, optional
Preset initial data or generate all data in the given domain.
- hintfunction, optional
Function returning the net points needed to compute the value for a given net point (by default there is no hint function). If specified the values are calculated iteratively.
See also
Net,NetCollection
Notes
The
hintfunction has to return an empty list for all net points which are initialized byfct.The function
fctwill be called repeatedly to calculate the value for the given index. It has to guarantee that the calculation will stop, i.e. that it will hit initial data.:E.g.: Suppose the missing vertex has the index (i,j). Then `fct` could use the values at vertices ((i-1,j-1), (i,j-1), (i-1, j)) to calculate the missing value (i-1,j) (i,j) input -> o--------o <- missing | | | | | | input -> o--------o <- input (i-1,j-1) (i,j-1) If the standard axis {(i,0) | i int} and {(0,i) | i int} are initial data (either given by `fct` itself or previously set) this definition is well defined.If
hintis not given the calculations are made recursively. So it may easyly generateRecursionErrorfor exeeding recursition depth. Thus it is important to take the search pattern offctinto account for choosing the traverser.:E.g.: Suppose the inital data is given in a zick-zack pattern in the fourth quadrant like (0,0) o--o | (-1,-1) o--o | (-2,-2) o--o If we suppose `fct` to use the search pattern from the comment above a (finite) linear traverser will generate `RecursitionError` for a relatively small search box (about 80x80). However a diagonal traverser will guarantee a small recursition depth. 1-->2-->3-->4 1 5 8 10 \ \ \ 5-->6-->7 2 6 9 \ \ 8-->9 3 7 \ 10 4 (lin. trav.) (diag. trav.)
- Attributes:
traverserddg.datastructures.nets.traverser.TraverserGet the traverser of the Domain.
- property traverser
Get the traverser of the Domain.
- Returns:
- ddg.datastructures.nets.traverser.Traverser
- property dimension
- property fct
- pop_transformation()
Pop transformation from the trafo-stack.
- Returns:
- function
- push_transformation(f)
Add a transformation to the trafo-stack.
- Parameters:
- fnumpy.ndarray or function
- transform(f)
Wrapper for
push_transformation.See also
- property transformation
Composition of all transformations on the stack.
- Returns:
- function
- class ddg.datastructures.nets.DiscreteCurve(*args, **kwargs)[source]
Bases:
DiscreteRecursiveNet- property dimension
- evaluate()
- property fct
- pop_transformation()
Pop transformation from the trafo-stack.
- Returns:
- function
- push_transformation(f)
Add a transformation to the trafo-stack.
- Parameters:
- fnumpy.ndarray or function
- transform(f)
Wrapper for
push_transformation.See also
- property transformation
Composition of all transformations on the stack.
- Returns:
- function
- property traverser
Get the traverser of the Domain.
- Returns:
- ddg.datastructures.nets.traverser.Traverser
- class ddg.datastructures.nets.NetCollection(nets=[], name='NetCollection')[source]
Bases:
Sized,Iterable,Container,TransformableCollection of Nets
- Parameters:
- netsList of nets
Nets to be contained in the collection.
- namestr (default=’NetCollection’)
Name of the collection.
- Attributes:
- namestring
Name of the collection
dimensionintDimension of the collection.
- property dimension
Dimension of the collection.
Only works if all nets in the collection have the same dimension.
- Returns:
- int
- Raises:
- AttributeError
If collection is empty
If nets in collection have different dimensions.
- transform(f)
Wrapper for
push_transformation.See also
- property transformation
Composition of all transformations on the stack.
- Returns:
- function
- ddg.datastructures.nets.sample_smooth_net(net, sampling, anchor=None, atol=1e-08, name=None, outsnet=False)[source]
Samples a smooth net.
- Parameters:
- netddg.datastructures.nets.net.SmoothNet
Smooth net to sample.
- samplinglist, int or float
See sample_smooth_domain.
- anchorlist or None
Anchor point for sampling process.
- atollist, int or float
Tolerance(s) for sampling process.
- namestring
Name of the sampled net. If None, uses net.name instead.
- outsnetbool
Set to true, the function returns a tuple of the sampled net and the sampling net instead.
- Returns:
- ddg.datastructures.nets.net.DiscreteNet or
- tuple
See also
sample_smooth_domain