Example #1
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // Declare a variable for the input String
            Topologic.Wire wire = null;

            // Use the DA object to retrieve the data inside the first input parameter.
            // If the retieval fails (for example if there is no data) we need to abort.
            if (!DA.GetData(0, ref wire))
            {
                return;
            }

            // If the retrieved data is Nothing, we need to abort.
            // We're also going to abort on a zero-length String.
            if (wire == null)
            {
                return;
            }
            //if (data.Length == 0) { return; }

            // Convert the String to a character array.
            //char[] chars = data.ToCharArray();


            IList <Topologic.Edge> edges = wire.Edges;

            // Use the DA object to assign a new String to the first output parameter.
            DA.SetDataList(0, edges);
        }
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // Declare a variable for the input String
            global::Topologic.Wire wire = null;
            double tolerance            = 0.0001;

            // Use the DA object to retrieve the data inside the first input parameter.
            // If the retieval fails (for example if there is no data) we need to abort.
            if (!DA.GetData(0, ref wire))
            {
                return;
            }
            if (!DA.GetData(1, ref tolerance))
            {
                return;
            }

            // If the retrieved data is Nothing, we need to abort.
            // We're also going to abort on a zero-length String.
            if (wire == null)
            {
                return;
            }
            //if (data.Length == 0) { return; }

            // Convert the String to a character array.
            //char[] chars = data.ToCharArray();

            Topologic.Wire newWire = global::Topologic.Utilities.WireUtility.RemoveCollinearEdges(wire, tolerance);

            // Use the DA object to assign a new String to the first output parameter.
            DA.SetData(0, newWire);
        }
Example #3
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // Declare a variable for the input String
            Topologic.Graph  graph       = null;
            Topologic.Vertex startVertex = null;
            Topologic.Vertex endVertex   = null;

            // Use the DA object to retrieve the data inside the first input parameter.
            // If the retieval fails (for example if there is no data) we need to abort.
            if (!DA.GetData(0, ref graph))
            {
                return;
            }
            if (!DA.GetData(1, ref startVertex))
            {
                return;
            }
            if (!DA.GetData(2, ref endVertex))
            {
                return;
            }

            // If the retrieved data is Nothing, we need to abort.
            // We're also going to abort on a zero-length String.
            if (graph == null)
            {
                return;
            }
            if (startVertex == null)
            {
                return;
            }
            if (endVertex == null)
            {
                return;
            }
            //if (data.Length == 0) { return; }

            // Convert the String to a character array.
            //char[] chars = data.ToCharArray();


            Topologic.Wire path = graph.Path(startVertex, endVertex);

            // Use the DA object to assign a new String to the first output parameter.
            DA.SetData(0, path);
        }
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs Not store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // Declare a variable for the input String
            Topologic.Face face        = null;
            Topologic.Wire wire        = null;
            bool           reverseWire = false;

            // Use the DA object to retrieve the data inside the first input parameter.
            // If the retieval fails (for example if there is no data) we need to abort.
            if (!DA.GetData(0, ref face))
            {
                return;
            }
            if (!DA.GetData(1, ref wire))
            {
                return;
            }
            if (!DA.GetData(2, ref reverseWire))
            {
                return;
            }

            // If the retrieved data is Nothing, we need to abort.
            // We're also going to abort on a zero-length String.
            if (face == null)
            {
                return;
            }
            if (wire == null)
            {
                return;
            }
            //if (data.Length == 0) { return; }

            // Convert the String to a character array.
            //char[] chars = data.ToCharArray();


            Topologic.Face newFace = Topologic.Utilities.FaceUtility.TrimByWire(face, wire, reverseWire);

            // Use the DA object to assign a new String to the first output parameter.
            DA.SetData(0, newFace);
        }
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            // Declare a variable for the input String
            Topologic.Wire        externalBoundary   = null;
            List <Topologic.Wire> internalBoundaries = new List <Topologic.Wire>();

            // Use the DA object to retrieve the data inside the first input parameter.
            // If the retieval fails (for example if there is no data) we need to abort.
            if (!DA.GetData(0, ref externalBoundary))
            {
                return;
            }
            if (!DA.GetDataList(1, internalBoundaries))
            {
                return;
            }

            // If the retrieved data is Nothing, we need to abort.
            // We're also going to abort on a zero-length String.
            if (externalBoundary == null)
            {
                return;
            }
            if (internalBoundaries == null)
            {
                return;
            }
            //if (data.Length == 0) { return; }

            // Convert the String to a character array.
            //char[] chars = data.ToCharArray();


            Topologic.Face face = Topologic.Face.ByExternalInternalBoundaries(externalBoundary, internalBoundaries);

            // Use the DA object to assign a new String to the first output parameter.
            DA.SetData(0, face);
        }