1) { for (i = 1, i < Steps, i += 1) { min = max max = count for (j = min, j < max, j += 1) { for (k = 0, k < N+1, k += 1) { c[count] = Mobius.TransformCircle(m[k], c[j]) ' ' Skip circles that are too small. ' if (c[count].Radius >= RadiusMin) { index[count] = index[j] level[count] = i count += 1 } } } } } ' ' Reset Total in case you skipped circles that were too small. ' Total = count CurveTrap.Initialize( \ Center, DegreeToRadian(Angle), Scale, AlternateAngle, 6, False, LineWidth \ ) ' ' Add the circles to the trap based on user criteria. ' for (i = 0, i < Total, i += 1) { lev = level[i] idx = index[i] ' ' Note: idx=N for center circles. ' if (idx = 0) { if (ShowCenter[lev]) { CurveTrap.AddCircle2(c[i], Solid, IIf(Solid, lev, 0), idx, lev) } } else { if (ShowRing[lev]) { CurveTrap.AddCircle2(c[i], Solid, IIf(Solid, lev, 0), idx, lev) } } } trap: trappedPoint = CurveTrap.Apply(z) properties: divider { caption = "General Options" } option Center { type = Complex caption = "Center" details = "Center of trap" default = 0 } option Angle { type = Float caption = "Angle" details = "Angle of rotation" default = 0 range = [-360,360] } option Scale { type = Float caption = "Scale" details = "Scale factor applied to trap" range = (0,) default = 2 } option Solid { type = Boolean caption = "Solid" details = "Check to create solid trap" default = False } option AlternateAngle { type = Boolean caption = "Alternate Angle" details = "Use alternate angle calculation" default = False } option LineWidth { type = Float caption = "Line Width" details = "Extent of trap on either side of curve (> 0)" range = (0,) default = 0.00411522633744855967078189300413 enabled = ~Solid } divider { caption = "U/V Controls" } option AbsU { type = Float caption = "Abs(U)" details = "Magnitude of U (1-2)" default = 1.1 range = [1,2] } option ArgU { type = Float caption = "Arg(U)" details = "Angle of U" default = 0 range = [-360,360] } option ArgV { type = Float caption = "Arg(V)" details = "Angle of V" default = 180 range = [-360,360] } divider { caption = "Circle Controls" } option N { type = IntegerEnum(3,12) caption = "N" details = "Number of base circles" default = 4 } option Steps { type = IntegerEnum(1,16) caption = "Steps" details = "Number of inversion steps" default = 7 } option Shift { type = Boolean caption = "Shift" details = "Check to rotate initial chain by pi/N" default = False } option RadiusMin { type = Float caption = "Radius Min" details = "Minimum acceptable circle radius" default = 0 range = [0,) } #define ShowLevel(Index) divider { caption = "Level #Index# Options" } option LR#Index# { type = Boolean caption = "Show Ring" details = "Show ring of circles at level #Index#" default = True enabled = Steps >= #Index# } option LC#Index# { type = Boolean caption = "Show Center" details = "Show center circle at level #Index#" default = True enabled = Steps >= #Index# } #end #include ShowLevel("1") #include ShowLevel("2") #include ShowLevel("3") #include ShowLevel("4") #include ShowLevel("5") #include ShowLevel("6") #include ShowLevel("7") #include ShowLevel("8") #include ShowLevel("9") #include ShowLevel("10") #include ShowLevel("11") #include ShowLevel("12") #include ShowLevel("13") #include ShowLevel("14") #include ShowLevel("15") #include ShowLevel("16")]]>