예제 #1
0
        internal static IGeometry BasicGeometry(global::Topologic.Edge edge)
        {
            Object edgeGeometry = edge.BasicGeometry;

            // Only line for now
            return(Line(edge));
        }
예제 #2
0
        internal static BH.oM.Geometry.Line Line(global::Topologic.Edge edge)
        {
            global::Topologic.Vertex startVertex = edge.StartVertex;
            Point bhomStartPoint = Convert.Point(startVertex);

            global::Topologic.Vertex endVertex = edge.EndVertex;
            Point bhomEndPoint = Convert.Point(endVertex);

            BH.oM.Geometry.Line line = new BH.oM.Geometry.Line {
                Start = bhomStartPoint, End = bhomEndPoint, Infinite = false
            };
            return(line);
        }
예제 #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
            global::Topologic.Edge     edge           = null;
            global::Topologic.Topology parentTopology = 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 edge))
            {
                return;
            }
            if (!DA.GetData(1, ref parentTopology))
            {
                return;
            }

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

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

            List <global::Topologic.Wire> adjacentWires = global::Topologic.Utilities.EdgeUtility.AdjacentWires(edge, parentTopology);

            // Use the DA object to assign a new String to the first output parameter.
            DA.SetDataList(0, adjacentWires);
        }
예제 #4
0
        internal static IGeometry BasicGeometry(global::Topologic.Topology topology)
        {
            if (topology == null)
            {
                return(null);
            }

            global::Topologic.Vertex vertex = topology as global::Topologic.Vertex;
            if (vertex != null)
            {
                return(Convert.BasicGeometry(vertex));
            }

            global::Topologic.Edge edge = topology as global::Topologic.Edge;
            if (edge != null)
            {
                return(Convert.BasicGeometry(edge));
            }

            global::Topologic.Wire wire = topology as global::Topologic.Wire;
            if (wire != null)
            {
                return(Convert.BasicGeometry(wire));
            }

            global::Topologic.Face face = topology as global::Topologic.Face;
            if (face != null)
            {
                return(Convert.BasicGeometry(face));
            }

            global::Topologic.Shell shell = topology as global::Topologic.Shell;
            if (shell != null)
            {
                return(Convert.BasicGeometry(shell));
            }

            global::Topologic.Cell cell = topology as global::Topologic.Cell;
            if (cell != null)
            {
                return(Convert.BasicGeometry(cell));
            }

            global::Topologic.CellComplex cellComplex = topology as global::Topologic.CellComplex;
            if (cellComplex != null)
            {
                return(Convert.BasicGeometry(cellComplex));
            }

            global::Topologic.Cluster cluster = topology as global::Topologic.Cluster;
            if (cluster != null)
            {
                return(Convert.BasicGeometry(cluster));
            }

            //global::Topologic.Aperture aperture = topology as global::Topologic.Aperture;
            //if (aperture != null)
            //{
            //    return Aperture.Convert.BasicGeometry(aperture);
            //}

            throw new NotImplementedException("Geometry for this shape is not supported yet");
        }
예제 #5
0
 public static bool ContainsEdge(global::Topologic.Graph graph, global::Topologic.Edge edge, double tolerance = 0.0001)
 {
     return(graph.ContainsEdge(edge, tolerance));
 }
예제 #6
0
 public static List <global::Topologic.Vertex> SharedVertices(global::Topologic.Edge edge, global::Topologic.Edge otherEdge)
 {
     return(edge.SharedVertices(otherEdge));
 }
예제 #7
0
 public static List <global::Topologic.Wire> Wires(global::Topologic.Edge edge)
 {
     return(edge.Wires);
 }
예제 #8
0
 public static List <global::Topologic.Vertex> Vertices(global::Topologic.Edge edge)
 {
     return(edge.Vertices);
 }
예제 #9
0
 public static global::Topologic.Vertex EndVertex(global::Topologic.Edge edge)
 {
     return(edge.EndVertex);
 }
예제 #10
0
 public static global::Topologic.Vertex StartVertex(global::Topologic.Edge edge)
 {
     return(edge.StartVertex);
 }
예제 #11
0
 public static List <global::Topologic.Edge> AdjacentEdges(global::Topologic.Edge edge)
 {
     return(edge.AdjacentEdges);
 }
예제 #12
0
 public static List <global::Topologic.Wire> AdjacentWires(global::Topologic.Edge edge, global::Topologic.Topology parentTopology)
 {
     return(global::Topologic.Utilities.EdgeUtility.AdjacentWires(edge, parentTopology));
 }
예제 #13
0
 public static global::Topologic.Vertex VertexAtParameter(global::Topologic.Edge edge, double u)
 {
     return(global::Topologic.Utilities.EdgeUtility.VertexAtParameter(edge, u));
 }
예제 #14
0
 public static double ParameterAtVertex(global::Topologic.Edge edge, global::Topologic.Vertex vertex)
 {
     return(global::Topologic.Utilities.EdgeUtility.ParameterAtVertex(edge, vertex));
 }