예제 #1
0
        public static Config RandomConfig(string sentence)
        {
            var randomPolys = new PolygonConfig[Random.Range(1, 3)];

            for (int i = 0; i < randomPolys.Length; i++)
            {
                randomPolys[i] = PolygonConfig.RandomConfig();
            }
            return(new Config(
                       new Alphabet(),
                       sentence,
                       BorderConfig.RandomConfig(),
                       randomPolys,
                       BorderConfig.RandomConfig(),
                       null,
                       .5f
                       ));
        }
예제 #2
0
 public Config(
     Alphabet alphabet,
     string sentence,
     BorderConfig borderConfig,
     PolygonConfig[] polygonConfigs,
     BorderConfig innerBorderConfig,
     PolygonConfig innerPolygonConfig,
     float textSize
     )
 {
     this.alphabet           = alphabet;
     this.sentence           = sentence.ToUpper();
     this.borderConfig       = borderConfig;
     this.polygonConfigs     = polygonConfigs;
     this.innerBorderConfig  = innerBorderConfig;
     this.innerPolygonConfig = innerPolygonConfig;
     this.textSize           = textSize;
 }
예제 #3
0
        private float DrawMiddle(float maxRadius, Vector2 middleCords, PolygonConfig polyConfig)
        {
            float apothem = maxRadius * Mathf.Cos(Mathf.PI / polyConfig.Sides());

            drawingTool.Polygon(middleCords, maxRadius, polyConfig.Sides() * 2, Mathf.PI / 2, lineThickness);
            drawingTool.Polygon(middleCords, maxRadius, polyConfig.Sides(), Mathf.PI / 2, lineThickness);
            PolyVertexIntersections(middleCords, maxRadius, polyConfig.Sides() * 2, (Mathf.PI / 2 + Mathf.PI / polyConfig.Sides()));

            float midpointCircleRadius = maxRadius / 8.0f;

            if (polyConfig.Circles())
            {
                PolyMidpointCircles(
                    middleCords,
                    apothem,
                    polyConfig.Sides(),
                    (Mathf.PI / 2 + Mathf.PI / polyConfig.Sides()),
                    midpointCircleRadius
                    );
            }

            return((apothem - midpointCircleRadius) * 0.99f);
        }