示例#1
0
        /// <summary>
        /// find link from main triangle of line-hub to another line hub
        /// </summary>
        /// <param name="analyzingHub"></param>
        /// <param name="hubs"></param>
        static void LinkEachLineHubTogether(CentroidLineHub analyzingHub, List <CentroidLineHub> hubs)
        {
            int j = hubs.Count;

            for (int i = 0; i < j; ++i)
            {
                CentroidLineHub otherHub = hubs[i];
                if (otherHub == analyzingHub)
                {
                    continue;
                }

                //from a given hub,
                //find bone joint that close to the main triangle for of the analyzingHub
                if (otherHub.FindBoneJoint(analyzingHub.StartTriangle, out CentroidLine foundOnBr, out Joint foundOnJoint))
                {
                    //create a new bone joint
                    // FindNearestEdge(analyzingHub.MainTriangle, foundOnJoint);
                    //add connection from analyzingHub to otherHub
                    otherHub.AddLineHubConnection(analyzingHub);
                    //also set head connection from joint to this analyzing hub
                    analyzingHub.SetHeadConnnection(foundOnBr, foundOnJoint);
                    //
                    //TODO: review this, why return here?
                    return;
                }
            }
        }