public static Topology Topology(this SAMObject sAMObject) { if (sAMObject == null) { return(null); } ParameterSet parameterSet = sAMObject.GetParameterSet(typeof(Topology).Assembly); if (parameterSet == null) { return(null); } string text = parameterSet.ToString("Topology"); if (string.IsNullOrEmpty(text)) { return(null); } string filePath = System.IO.Path.GetTempFileName(); System.IO.File.WriteAllText(filePath, text); global::Topologic.Topology result = global::Topologic.Topology.ByImportedBRep(filePath); System.IO.File.Delete(filePath); return(result); }
public static global::Topologic.Graph GraphByTopology(global::Topologic.Topology topology, bool direct = true, bool viaSharedTopologies = false, bool viaSharedApertures = false, bool toExteriorTopologies = false, bool toExteriorApertures = false, bool useFaceInternalVertex = false, double tolerance = 0.0001) { return(global::Topologic.Graph.ByTopology(topology, direct, viaSharedTopologies, viaSharedApertures, toExteriorTopologies, toExteriorApertures, useFaceInternalVertex, tolerance)); }
internal static global::Topologic.Cluster ClusterByCompositeGeometry(CompositeGeometry bhomCompositeGeometry, double tolerance) { List <global::Topologic.Topology> topologies = new List <global::Topologic.Topology>(); foreach (IGeometry bhomGeometry in bhomCompositeGeometry.Elements) { global::Topologic.Topology topology = Create.TopologyByGeometry(bhomGeometry, tolerance); topologies.Add(topology); } return(ClusterByTopologies(topologies)); }
/// <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.Topology topology = null; global::Topologic.Topology parentTopology = null; int typeFilter = 0; // 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 topology)) { return; } if (!DA.GetData(1, ref parentTopology)) { return; } if (!DA.GetData(2, ref typeFilter)) { return; } // If the retrieved data is Nothing, we need to abort. // We're also going to abort on a zero-length String. if (topology == null) { return; } if (parentTopology == null) { return; } //if (data.Length == 0) { return; } // Convert the String to a character array. //char[] chars = data.ToCharArray(); IList <global::Topologic.Topology> adjacentTopologies = global::Topologic.Utilities.TopologyUtility.AdjacentTopologies(topology, parentTopology, typeFilter); // Use the DA object to assign a new String to the first output parameter. DA.SetDataList(0, adjacentTopologies); }
public static List <global::Topologic.Edge> AdjacentEdges(global::Topologic.Vertex vertex, global::Topologic.Topology parentTopology) { return(global::Topologic.Utilities.VertexUtility.AdjacentEdges(vertex, parentTopology)); }
public static global::Topologic.Topology Rotate(global::Topologic.Topology topology, global::Topologic.Vertex origin, double xVector = 0.0, double yVector = 0.0, double zVector = 0.0, double degree = 0.0) { return(global::Topologic.Utilities.TopologyUtility.Rotate(topology, origin, xVector, yVector, zVector, degree)); }
public static List <global::Topologic.Topology> AdjacentTopologies(global::Topologic.Topology topology, global::Topologic.Topology parentTopology, int typeFilter) { return(global::Topologic.Utilities.TopologyUtility.AdjacentTopologies(topology, parentTopology, typeFilter)); }
public static bool ExportToBRep(global::Topologic.Topology topology, String path) { return(topology.ExportToBRep(path)); }
public static global::Topologic.Topology Divide(global::Topologic.Topology topology, global::Topologic.Topology tool = null, bool transferDictionary = false) { return(topology.Divide(tool, transferDictionary)); }
public static global::Topologic.Vertex CenterOfMass(global::Topologic.Topology topology) { return(topology.CenterOfMass); }
public static List <global::Topologic.Topology> SharedTopologies(global::Topologic.Topology topology, global::Topologic.Topology anotherTopology, int typeFilter = 255) { return(topology.SharedTopologies(anotherTopology, typeFilter)); }
public static Dictionary <String, Object> Dictionary(global::Topologic.Topology topology) { return(topology.Dictionary); }
public static int Type(global::Topologic.Topology topology) { return(topology.Type); }
public static String TypeAsString(global::Topologic.Topology topology) { return(topology.TypeAsString); }
public static global::Topologic.Topology ClosestSimplestSubshape(global::Topologic.Topology topology, global::Topologic.Topology selector) { return(topology.ClosestSimplestSubshape(selector)); }
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"); }
public static global::Topologic.Topology SelfMerge(global::Topologic.Topology topology) { return(topology.SelfMerge()); }
public static global::Topologic.Vertex Centroid(global::Topologic.Topology topology) { return(topology.Centroid); }
public static global::Topologic.Topology XOR(global::Topologic.Topology topology, global::Topologic.Topology otherTopology = null, bool transferDictionary = false) { return(topology.XOR(otherTopology, transferDictionary)); }
public static global::Topologic.Topology AddContents(global::Topologic.Topology topology, List <global::Topologic.Topology> contents, int typeFilter = 0) { return(topology.AddContents(contents, typeFilter)); }
public static global::Topologic.Topology ShallowCopy(global::Topologic.Topology topology) { return(topology.ShallowCopy()); }
public static IGeometry Geometry(global::Topologic.Topology topology) { return(BasicGeometry(topology)); // will this do? }
public static global::Topologic.Topology Translate(global::Topologic.Topology topology, double x = 0.0, double y = 0.0, double z = 0.0) { return(global::Topologic.Utilities.TopologyUtility.Translate(topology, x, y, z)); }
public static global::Topologic.Topology RemoveContents(global::Topologic.Topology topology, List <global::Topologic.Topology> contentTopologies) { return(topology.RemoveContents(contentTopologies)); }
public static global::Topologic.Topology Scale(global::Topologic.Topology topology, global::Topologic.Vertex origin, double xFactor = 1.0, double yFactor = 1.0, double zFactor = 1.0) { return(global::Topologic.Utilities.TopologyUtility.Scale(topology, origin, xFactor, yFactor, zFactor)); }
public static global::Topologic.Topology AddApertures(global::Topologic.Topology topology, IEnumerable <global::Topologic.Topology> apertureTopologies) { return(topology.AddApertures(apertureTopologies)); }
public static global::Topologic.Aperture ApertureByTopologyContext(global::Topologic.Topology topology, global::Topologic.Context context) { return(global::Topologic.Aperture.ByTopologyContext(topology, context)); }
public static global::Topologic.Topology SetDictionary(global::Topologic.Topology topology, Dictionary <String, Object> dictionary) { return(topology.SetDictionary(dictionary)); }
public static double Distance(global::Topologic.Vertex vertex, global::Topologic.Topology otherTopology) { return(global::Topologic.Utilities.VertexUtility.Distance(vertex, otherTopology)); }
public static global::Topologic.Topology SetDictionaries(global::Topologic.Topology topology, List <global::Topologic.Vertex> selectors, List <Dictionary <String, Object> > dictionaries, int typeFilter = 255) { return(topology.SetDictionaries(selectors, dictionaries, typeFilter)); }