This class does not strictly enforce the definition of a spherical design, in fact it is just a collection of points (Cartesian objects) which you can set arbitrarily. The expectation however is that you'll be importing designs that are provided, such as those t-designs available through the subclass TDesign, or assigning your own points to be regarded as a spherical design.
Create an empty SphericalDesign without any initial points. To populate a design with predefined design points, use one of the subclasses, or the convenience methods provided in this class such as *newT for a spherical t-design.
Returns a new TDesign.
numPoints |
The number of points you'd like in your design. If multiple matches in the design library are found, the |
t |
The desired t parameter. Can be |
Rotate all points in the design around the origin. Positive rotation is counter clockwise.
Tilt all points in the design around the origin. Positive tilt moves the leftmost point (+Y) toward the zenith (+Z).
Tumble all points in the design around the origin. Positive tumble moves the forward point (+X) toward the zenith (+Z).
Reflect all points in the design along the X axis (through the YZ plane).
recalcTriplets |
See explanation in -mirrorO. |
Reflect all points in the design along the Y axis (through the XZ plane).
recalcTriplets |
See explanation in -mirrorO. |
Reflect all points in the design along the Z axis (through the XY plane).
recalcTriplets |
See explanation in -mirrorO. |
Reflect all points in the design through the origin.
recalcTriplets |
Mirroring the design invalidates the design's -triplets. By default, if triplets have already been calculated, they will be recalculated, unless |
If methodOrFunc
is a Symbol, this method behaves as Object: -perform, iterating over each Cartesian point.
If methodOrFunc
is a Function, this method evaluates the function for each point, passing in as arguments: the Cartesian point, the point index, and *args
.
If the method you perform on the design invalidates the design's -triplets (assuming you've calculated and are using them), you'll want to either -resetTriplets beforehand to clear them and/or call -calcTriplets after performing the method
.
Reset the points to their the positions when -captureState was called. TDesign, for example, captures the initial state of the points on creation.
Return the point nearest to [theta, phi
].
Return the index of point nearest to [theta, phi
].
Returns an Array of the Cartesian points that lie within a region centered at [theta, phi
] with an extent of spread
radians across. Points exactly on the boundary will be included if inclusive
is true
.
Returns an Array of the Cartesian points that lie within a region centered at [theta, phi
] with an extent of spread
radians across. Points exactly on the boundary will be included if inclusive
is true
.
Same as -pointsWithin, but the point indices are sorted by ascending distance from [theta, phi
].
Same as -indicesWithin, but the point indices are sorted by ascending distance from [theta, phi
].
Returns an Array of anglular distances from [theta, phi
] to each point.
Get/set the points that comprise the spherical design. In normal use you would not set this directly but rather this would be set by the underlying design library.
cartesianArray |
Get/set the directions (azimuth, elevation) of points that comprise the spherical design. The resulting -points are assigned a rho of 1, so they lie on the surface of a unit sphere. In normal use you would not set this directly but rather this would be set by the underlying design library.
azElArray |
Directions are specified and returned as a 2D Array of [azimuth, elevation] (theta, phi) pairs. |
Returns the number of points in the design. Synonymous with -size.
Returns the number of points in the design. Synonymous with -numPoints.
Returns an Array of triplets (an Array of three Floats) describing the indices of triangles formed through the calculation of the triangular mesh across the points.
Returns nil
if triplets haven't yet been calculated. See -calcTriplets for more information.
Return the PointView created after calling -visualize.
Create a PointView displaying the design.
parent | |
bounds |
An optional Rect describing the position and size of the PointView. |
showConnections |
A Boolean denoting whether connecting lines between points will be displayed on opening. The connections between points will default to the corresponding -triplets, so if |
Calculate the triangular mesh across the points and populate -triplets with indices of the triangles. Similar to the Delaunay triangulation or convex hull, which is useful for visualization (see -visualize) and generating triangles for VBAP. 2
Set -triplets to nil
and clear the internal table of vector angles between points. If you're working with large designs and transforming, etc., this may be useful to manually reset these internal variables.
Capture the state to which you'd like to return when calling -reset. TDesign, for example, captures the initial state of the points on creation.
M. McCrea, D. Peterson 2018