@@ -11,32 +11,55 @@ import { PointPath } from './PointPath';
1111
1212export interface IPotentialOptions {
1313 /**
14- * how many pixels per potential area group to improve speed
14+ * the resolution of the algorithm in square pixels
1515 * @default 4
1616 */
1717 pixelGroup ?: number ;
18+ /**
19+ * the amount of space to move the virtual edge when wrapping around obstacles
20+ * @default 10
21+ */
1822 morphBuffer ?: number ;
1923}
2024
2125export interface IRoutingOptions {
2226 virtualEdges ?: boolean ;
2327 /**
24- * maximum number of iterations when computing routes between members
28+ * number of times to run the algorithm to refine the path finding in difficult areas
2529 * @default 100
2630 */
2731 maxRoutingIterations ?: number ;
32+ /**
33+ * the amount of space to move the virtual edge when wrapping around obstacles
34+ * @default 10
35+ */
2836 morphBuffer ?: number ;
2937}
3038export interface IOutlineOptions {
3139 /**
32- * maximum number of iterations when computing the contour
40+ * number of times to refine the boundary
3341 * @default 20
3442 */
3543 maxMarchingIterations ?: number ;
36-
44+ /**
45+ * the distance from edges at which energy is 1 (full influence)
46+ * @default 10
47+ */
3748 edgeR0 ?: number ;
49+ /**
50+ * the distance from edges at which energy is 0 (no influence)
51+ * @default 20
52+ */
3853 edgeR1 ?: number ;
54+ /**
55+ * the distance from nodes which energy is 1 (full influence)
56+ * @default 15
57+ */
3958 nodeR0 ?: number ;
59+ /**
60+ * the distance from nodes at which energy is 0 (no influence)
61+ * @default 50
62+ */
4063 nodeR1 ?: number ;
4164
4265 threshold ?: number ;
@@ -48,14 +71,15 @@ export interface IOutlineOptions {
4871export interface IBubbleSetOptions extends IRoutingOptions , IOutlineOptions , IPotentialOptions { }
4972
5073export const defaultOptions : Readonly < Required < IBubbleSetOptions > > = {
51- maxRoutingIterations : 100 ,
52- maxMarchingIterations : 20 ,
53- pixelGroup : 4 ,
54- edgeR0 : 10 ,
55- edgeR1 : 20 ,
56- nodeR0 : 15 ,
57- nodeR1 : 50 ,
58- morphBuffer : 10 ,
74+ // override these defaults to change the spacing and bubble precision; affects performance and appearance
75+ maxRoutingIterations : 100 , // number of times to run the algorithm to refine the path finding in difficult areas
76+ maxMarchingIterations : 20 , // number of times to refine the boundary
77+ pixelGroup : 4 , // the resolution of the algorithm in square pixels
78+ edgeR0 : 10 , // the distance from edges at which energy is 1 (full influence)
79+ edgeR1 : 20 , // the distance from edges at which energy is 0 (no influence)
80+ nodeR0 : 15 , // the distance from nodes which energy is 1 (full influence)
81+ nodeR1 : 50 , // the distance from nodes at which energy is 0 (no influence)
82+ morphBuffer : 10 , // the amount of space to move the virtual edge when wrapping around obstacles
5983
6084 threshold : 1 ,
6185 memberInfluenceFactor : 1 ,
0 commit comments