topologicpy.Vertex module
- class topologicpy.Vertex.Vertex
Bases:
objectMethods
AlignCoordinates(vertex[, xList, yList, ...])Aligns the coordinates of the input vertex with the list of x,y, and z coordinates.
AreCollinear(vertices[, mantissa, tolerance])Returns True if the input list of vertices form a straight line.
AreCoplanar(vertices[, mantissa, tolerance, ...])Returns True if the input list of vertices are coplanar.
AreIpsilateral(vertices, face)Returns True if the input list of vertices are on one side of a face.
AreIpsilateralCluster(cluster, face)Returns True if the two input vertices are on the same side of the input face.
AreOnSameSide(vertices, face)Returns True if the two input vertices are on the same side of the input face.
AreOnSameSideCluster(cluster, face)Returns True if the two input vertices are on the same side of the input face.
ByCoordinates(*args, **kwargs)Creates a vertex at the coordinates specified by the x, y, z inputs.
ByOffset2DRelativeToEdge(vertex, edge[, ...])Creates a new vertex offset from the input vertex in the XY plane, using the 2D left-hand normal direction of the input edge.
Centroid(vertices[, mantissa])Returns the centroid of the input list of vertices.
Clockwise2D(vertices)Sorts the input list of vertices in a clockwise fashion.
Coordinates(vertex[, outputType, mantissa])Returns the coordinates of the input vertex.
CounterClockwise2D(vertices[, mantissa])Sorts the input list of vertices in a counterclockwise fashion.
Degree(vertex, hostTopology[, topologyType])Returns the vertex degree (the number of super topologies connected to it).
Distance(vertex, topology[, ...])Returns the distance between the input vertex and the input topology.
EnclosingCells(vertex, topology[, ...])Returns the list of Cells found in the input topology that enclose the input vertex.
EnclosingEdges(vertex, topology[, ...])Returns the list of Edges found in the input topology that enclose the input vertex.
EnclosingFaces(vertex, topology[, ...])Returns the list of Faces found in the input topology that enclose the input vertex.
ExternalBoundary(vertex[, tolerance, silent])Returns the external boundary of the input vertex (None according OGC / ISO / DE-9IM).
Fuse(vertices[, mantissa, tolerance])Returns a list of vertices where vertices within a specified tolerance distance are fused while retaining duplicates, ensuring that vertices with nearly identical coordinates are replaced by a single shared coordinate.
IncomingEdges(vertex, hostTopology[, tolerance])Returns the incoming edges connected to a vertex.
Index(vertex, vertices[, strict, tolerance])Returns the index of the input vertex in the input list of vertices.
InterpolateValue(vertex, vertices[, n, key, ...])Interpolates the value of the input vertex based on the values of the n nearest vertices.
IsCoincident(vertexA, vertexB[, tolerance, ...])Returns True if the input vertexA is coincident with the input vertexB.
IsExternal(vertex, topology[, tolerance, silent])Returns True if the input vertex is external to the input topology.
IsInternal(vertex, topology[, maxLeafSize, ...])Returns True if the input vertex lies inside the input topology.
IsInternal2D(vertices, face[, ...])Fast, batch point-in-face test (supports holes) using NumPy vectorized ray casting.
IsInternal_old(vertex, topology[, ...])Returns True if the input vertex lies inside the input topology.
IsPeripheral(vertex, topology[, tolerance, ...])Returns True if the input vertex is peripheral to the input topology.
NearestVertex(vertex, topology[, useKDTree, ...])Returns the vertex found in the input topology that is the nearest to the input vertex.
Normal(vertices[, mantissa, tolerance, silent])Computes the normal vector of a list of co-planar Topologic vertices.
Origin()Returns a vertex with coordinates (0, 0, 0)
OutgoingEdges(vertex, hostTopology[, tolerance])Returns the outgoing edges connected to a vertex.
PerpendicularDistance(vertex, face[, mantissa])Returns the perpendicular distance between the input vertex and the input face.
PlaneEquation(vertices[, mantissa])Returns the equation of the average plane passing through a list of vertices.
Point([x, y, z])Creates a point (vertex) using the input parameters
Project(vertex, face[, direction, mantissa])Returns a vertex that is the projection of the input vertex unto the input face.
Quadrance(vertex, topology[, ...])Returns the quadrance between the input vertex and the input topology.
RandomVertex(vertices[, maxTries, pad, ...])Creates a random vertex within the bounding box of the input list of vertices, ensuring that it is not coincident with any input vertex.
Separate(*vertices[, minDistance, ...])Separates the input vertices such that no two vertices are within the input minimum distance.
Transform(vertex, matrix[, mantissa, silent])Transforms a 3D vertex using a 4x4 transformation matrix.
Weld(vertices[, mantissa, tolerance])Returns a list of vertices where vertices within a specified tolerance distance are fused while retaining duplicates, ensuring that vertices with nearly identical coordinates are replaced by a single shared coordinate.
X(vertex[, mantissa, silent])Returns the X coordinate of the input vertex.
Y(vertex[, mantissa, silent])Returns the Y coordinate of the input vertex.
Z(vertex[, mantissa, silent])Returns the Z coordinate of the input vertex.
- static AlignCoordinates(vertex, xList: list = None, yList: list = None, zList: list = None, xEpsilon: float = 0.0001, yEpsilon: float = 0.0001, zEpsilon: float = 0.0001, transferDictionary: bool = False, mantissa: int = 6, silent: bool = False)
Aligns the coordinates of the input vertex with the list of x,y, and z coordinates.
- Parameters
- vertextopologic_core.Vertex
The input vertex.
- xListlist , optional
The input numerical list of x-coordinates. Default is None.
- yListlist , optional
The input numerical list of y-coordinates. Default is None.
- zListlist , optional
The input numerical list of z-coordinates. Default is None.
- xEpsilonfloat , optional
The desired tolerance for the x coordinates. Default is 0.0001.
- yEpsilonfloat , optional
The desired tolerance for the y coordinates. Default is 0.0001.
- zEpsilonfloat , optional
The desired tolerance for the z coordinates. Default is 0.0001.
- transferDictionarybool , optional
if set to True, the dictionary of the input vertex is transferred to the new vertex.
- mantissaint , optional
The number of decimal places to round the result to. Default is 6.
- silentbool , optional
If set to True, error and warning messages are suppressed. Default is False.
- Returns
- topologic_core.Vertex
The created vertex aligned to the input list of x,y, and z coordinates.
- static AreCollinear(vertices: list, mantissa: int = 6, tolerance: float = 0.0001)
Returns True if the input list of vertices form a straight line. Returns False otherwise.
- Parameters
- verticeslist
The input list of vertices.
- mantissaint , optional
The number of decimal places to round the result to. Default is 6.
- tolerancefloat, optional
The desired tolerance. Default is 0.0001.
- Returns
- bool
True if the input vertices are collinear. False otherwise.
- static AreCoplanar(vertices: list, mantissa: int = 6, tolerance: float = 0.0001, silent: bool = False) bool
Returns True if the input list of vertices are coplanar. Returns False otherwise.
- Parameters
- verticeslist
The input list of vertices.
- mantissaint , optional
The number of decimal places to round the result to. Default is 6.
- tolerancefloat , optional
The desired tolerance. Default is 0.0001
- silentbool , optional
If set to True, error and warning messages are suppressed. Default is False.
- Returns
- bool
True if the input vertices are coplanar.
- static AreIpsilateral(vertices: list, face) bool
Returns True if the input list of vertices are on one side of a face. Returns False otherwise. If at least one of the vertices is on the face, this method return True.
- Parameters
- verticeslist
The input list of vertices.
- facetopologic_core.Face
The input face
- Returns
- bool
True if the input vertices are on the same side of the face. False otherwise. If at least one of the vertices is on the face, this method return True.
- static AreIpsilateralCluster(cluster, face) bool
Returns True if the two input vertices are on the same side of the input face. Returns False otherwise. If at least one of the vertices is on the face, this method return True.
- Parameters
- clustertopologic_core.Cluster
The input list of vertices.
- facetopologic_core.Face
The input face
- Returns
- bool
True if the input vertices are on the same side of the face. False otherwise. If at least one of the vertices is on the face, this method return True.
- static AreOnSameSide(vertices: list, face) bool
Returns True if the two input vertices are on the same side of the input face. Returns False otherwise. If at least one of the vertices is on the face, this method return True.
- Parameters
- verticeslist
The input list of vertices.
- facetopologic_core.Face
The input face
- Returns
- bool
True if the input vertices are on the same side of the face. False otherwise. If at least one of the vertices is on the face, this method return True.
- static AreOnSameSideCluster(cluster, face) bool
Returns True if the two input vertices are on the same side of the input face. Returns False otherwise. If at least one of the vertices is on the face, this method return True.
- Parameters
- clustertopologic_core.Cluster
The input list of vertices.
- facetopologic_core.Face
The input face
- Returns
- bool
True if the input vertices are on the same side of the face. False otherwise. If at least one of the vertices is on the face, this method return True.
- static ByCoordinates(*args, **kwargs)
Creates a vertex at the coordinates specified by the x, y, z inputs. You can call this method using a list of coordinates or individually. Examples: v = Vertex.ByCoordinates(3.4, 5.7, 2.8) v = Vertex.ByCoordinates([3.4, 5.7, 2.8]) v = Vertex.ByCoordinates(x=3.4, y=5.7, z=2.8)
- Parameters
- xfloat , optional
The X coordinate. Default is 0.
- yfloat , optional
The Y coordinate. Default is 0.
- zfloat , optional
The Z coordinate. The defaults is 0.
- Returns
- topologic_core.Vertex
The created vertex.
- static ByOffset2DRelativeToEdge(vertex, edge, offset: float = 1.0, tolerance: float = 0.0001)
Creates a new vertex offset from the input vertex in the XY plane, using the 2D left-hand normal direction of the input edge.
- Parameters
- vertextopologic_core.Vertex
The vertex to offset.
- edgetopologic_core.Edge
The reference edge used to compute the perpendicular direction.
- offsetfloat , optional
The offset distance. Default is 1.0.
- tolerancefloat , optional
The desired tolerance. Default is 0.0001.
- Returns
- topologic_core.Vertex
The offset vertex.
- static Centroid(vertices: list, mantissa: int = 6)
Returns the centroid of the input list of vertices.
- Parameters
- verticeslist
The input list of vertices
- mantissaint , optional
The number of decimal places to round the result to. Default is 6.
- Returns
- topologic_core.Vertex
The computed centroid of the input list of vertices
- static Clockwise2D(vertices)
Sorts the input list of vertices in a clockwise fashion. This method assumes that the vertices are on the XY plane. The Z coordinate is ignored.
- Parameters
- verticeslist
The input list of vertices
- Returns
- list
The input list of vertices sorted in a counter clockwise fashion
- static Coordinates(vertex, outputType: str = 'xyz', mantissa: int = None) list
Returns the coordinates of the input vertex.
- Parameters
- vertextopologic_core.Vertex
The input vertex.
- outputTypestring, optional
The desired output type. Could be any permutation or substring of “xyz” or the string “matrix”. Default is “xyz”. The input is case insensitive and the coordinates will be returned in the specified order.
- mantissaint , optional
The number of decimal places to round the result to. None means no rounding. Default is None.
- Returns
- list
The coordinates of the input vertex.
- static CounterClockwise2D(vertices: list, mantissa: int = 6)
Sorts the input list of vertices in a counterclockwise fashion. This method assumes that the vertices are on the XY plane. The Z coordinate is ignored.
- Parameters
- verticeslist
The input list of vertices
- mantissaint , optional
The number of decimal places to round the result to. Default is 6.
- Returns
- list
The input list of vertices sorted in a counter clockwise fashion
- static Degree(vertex, hostTopology, topologyType: str = 'edge')
Returns the vertex degree (the number of super topologies connected to it). See https://en.wikipedia.org/wiki/Degree_(graph_theory).
- Parameters
- vertextopologic_core.Vertex
The input vertex.
- hostTopologytopologic_core.Topology
The input host topology in which to search for the connected super topologies.
- topologyTypestr , optional
The topology type to search for. This can be any of “edge”, “wire”, “face”, “shell”, “cell”, “cellcomplex”, “cluster”. It is case insensitive. If set to None, the immediate supertopology type is searched for. Default is None.
- Returns
- int
The number of super topologies connected to this vertex
- static Distance(vertex, topology, includeCentroid: bool = True, mantissa: int = 6) float
Returns the distance between the input vertex and the input topology. This method returns the distance to the closest sub-topology in the input topology, optionally including its centroid.
- Parameters
- vertextopologic_core.Vertex
The input vertex.
- topologytopologic_core.Topology
The input topology.
- includeCentroidbool
If set to True, the centroid of the input topology will be considered in finding the nearest subTopology to the input vertex. Default is True.
- mantissaint , optional
The number of decimal places to round the result to. Default is 6.
- Returns
- float
The distance between the input vertex and the input topology.
- static EnclosingCells(vertex, topology, exclusive: bool = True, mantissa: int = 6, tolerance: float = 0.0001, silent: bool = False) list
Returns the list of Cells found in the input topology that enclose the input vertex.
- Parameters
- vertextopologic_core.Vertex
The input vertex.
- topologytopologic_core.Topology
The input topology.
- exclusivebool , optional
If set to True, return only the first found enclosing cell. Default is True.
- mantissaint , optional
The number of decimal places to round the result to. Default is 6.
- tolerancefloat , optional
The tolerance for computing if the input vertex is enclosed in a cell. Default is 0.0001.
- silentbool , optional
If set to True, error and warning messages are suppressed. Default is False.
- Returns
- list
The list of enclosing cells.
- static EnclosingEdges(vertex, topology, exclusive: bool = True, mantissa: int = 6, tolerance: float = 0.0001, silent: bool = False) list
Returns the list of Edges found in the input topology that enclose the input vertex.
- Parameters
- vertextopologic_core.Vertex
The input vertex.
- topologytopologic_core.Topology
The input topology.
- exclusivebool , optional
If set to True, return only the first found enclosing face. Default is True.
- mantissaint , optional
The number of decimal places to round the result to. Default is 6.
- tolerancefloat , optional
The tolerance for computing if the input vertex is enclosed in a face. Default is 0.0001.
- silentbool , optional
If set to True, error and warning messages are suppressed. Default is False.
- Returns
- list
The list of enclosing faces.
- static EnclosingFaces(vertex, topology, exclusive: bool = True, mantissa: int = 6, tolerance: float = 0.0001, silent: bool = False) list
Returns the list of Faces found in the input topology that enclose the input vertex.
- Parameters
- vertextopologic_core.Vertex
The input vertex.
- topologytopologic_core.Topology
The input topology.
- exclusivebool , optional
If set to True, return only the first found enclosing face. Default is True.
- mantissaint , optional
The number of decimal places to round the result to. Default is 6.
- tolerancefloat , optional
The tolerance for computing if the input vertex is enclosed in a face. Default is 0.0001.
- silentbool , optional
If set to True, error and warning messages are suppressed. Default is False.
- Returns
- list
The list of enclosing faces.
- static ExternalBoundary(vertex, tolerance: float = 0.0001, silent: bool = False)
Returns the external boundary of the input vertex (None according OGC / ISO / DE-9IM). This method is trivial, but included for completeness.
- Parameters
- vertextopologic_core.Vertex
The input vertex.
- tolerancefloat , optional
The desired tolerance. Default is 0.0001.
- silentbool , optional
If set to True, error and warning messages are suppressed. Default is False.
- Returns
- topologic_core.Vertex
The external boundary of the input vertex. This is the input vertex itself.
- static Fuse(vertices: list, mantissa: int = 6, tolerance: float = 0.0001)
Returns a list of vertices where vertices within a specified tolerance distance are fused while retaining duplicates, ensuring that vertices with nearly identical coordinates are replaced by a single shared coordinate.
- Parameters
- verticeslist
The input list of topologic vertices.
- mantissaint , optional
The desired length of the mantissa for retrieving vertex coordinates. Default is 6.
- tolerancefloat , optional
The desired tolerance for computing if vertices need to be fused. Any vertices that are closer to each other than this tolerance will be fused. Default is 0.0001.
- Returns
- list
The list of fused vertices. This list contains the same number of vertices and in the same order as the input list of vertices. However, the coordinates of these vertices have now been modified so that they are exactly the same with other vertices that are within the tolerance distance.
- static IncomingEdges(vertex, hostTopology, tolerance: float = 0.0001) list
Returns the incoming edges connected to a vertex. An edge is considered incoming if its end vertex is coincident with the input vertex.
- Parameters
- vertextopologic_core.Vertex
The input vertex.
- hostTopologytopologic_core.Topology
The input host topology to which the vertex belongs.
- tolerancefloat , optional
The desired tolerance. Default is 0.0001.
- Returns
- list
The list of incoming edges
- static Index(vertex, vertices: list, strict: bool = False, tolerance: float = 0.0001) int
Returns the index of the input vertex in the input list of vertices.
This implementation avoids rebuilding the input list and uses a fast coordinate pre-check before falling back to Topology.IsSame or Vertex.Distance.
- Parameters
- vertextopologic_core.Vertex
The input vertex.
- verticeslist
The input list of vertices.
- strictbool , optional
If set to True, the vertex must be strictly identical to the one found in the list. Otherwise, a distance comparison is used. Default is False.
- tolerancefloat , optional
The tolerance for computing if the input vertex is identical to a vertex from the list. Default is 0.0001.
- Returns
- int
The index of the input vertex in the input list of vertices.
- static InterpolateValue(vertex, vertices: list, n: int = 3, key: str = 'intensity', mantissa: int = 6, tolerance: float = 0.0001)
Interpolates the value of the input vertex based on the values of the n nearest vertices.
- Parameters
- vertextopologic_core.Vertex
The input vertex.
- verticeslist
The input list of vertices.
- nint , optional
The maximum number of nearest vertices to consider. Default is 3.
- keystr , optional
The key that holds the value to be interpolated in the dictionaries of the vertices. Default is “intensity”.
- mantissaint , optional
The number of decimal places to round the result to. Default is 6.
- tolerancefloat , optional
The tolerance for computing if the input vertex is coincident with another vertex in the input list of vertices. Default is 0.0001.
- Returns
- topologic_core.vertex
The input vertex with the interpolated value stored in its dictionary at the key specified by the input key. Other keys and values in the dictionary are preserved.
- static IsCoincident(vertexA, vertexB, tolerance: float = 0.0001, silent: bool = False) bool
Returns True if the input vertexA is coincident with the input vertexB. Returns False otherwise.
- Parameters
- vertexAtopologic_core.Vertex
The first input vertex.
- vertexBtopologic_core.Vertex
The second input vertex.
- tolerancefloat , optional
The tolerance for computing if the input vertexA is coincident with the input vertexB. Default is 0.0001.
- Returns
- bool
True if the input vertexA is coincident with the input vertexB. False otherwise.
- static IsExternal(vertex, topology, tolerance: float = 0.0001, silent: bool = False) bool
Returns True if the input vertex is external to the input topology. Returns False otherwise.
- Parameters
- vertextopologic_core.Vertex
The input vertex.
- topologytopologic_core.Topology
The input topology.
- tolerancefloat , optional
The tolerance for computing if the input vertex is external to the input topology. Default is 0.0001.
- silentbool , optional
If set to True, error and warning messages are suppressed. Default is False.
- Returns
- bool
True if the input vertex is external to the input topology. False otherwise.
- static IsInternal(vertex, topology, maxLeafSize: int = 4, identify: bool = False, tolerance: float = 0.0001, silent: bool = False)
Returns True if the input vertex lies inside the input topology.
- Parameters
- vertextopologic_core.Vertex
The input vertex.
- topologytopologic_core.Topology
The input topology.
- maxLeafSize: int , optional
Retained for backward compatibility. This implementation avoids building a BVH for every call because that is expensive for single-point queries. Default is 4.
- identify: bool, optional
If set to True, a tuple is returned where the identified subTopology is returned (e.g. (True, edge)). Default is False.
- tolerancefloat, optional
The desired tolerance. Default 0.0001.
- silentbool , optional
If set to True, error and warning messages are suppressed. Default is False.
- Returns
- bool or tuple
True/False, or (True/False, topology) if identify is True.
- static IsInternal2D(vertices, face, includeBoundary: bool = True, mantissa: int = 6, tolerance: float = 0.0001, silent: bool = False)
Fast, batch point-in-face test (supports holes) using NumPy vectorized ray casting.
- Parameters
- facetopologic_core.Face
Input face (may have holes). Assumes planar and evaluated in XY.
- verticestopologic_core.Vertex or list[topologic_core.Vertex]
Query vertex/vertices.
- includeBoundarybool, optional
If True, points on the outer boundary are counted as inside. Points on hole boundaries are always treated as outside. Default is True.
- mantissaint, optional
Rounding precision for XY conversion. Default is 6.
- tolerancefloat, optional
The desired tolerance. Default 0.0001.
- silentbool , optional
If set to True, error and warning messages are suppressed. Default is False.
- Returns
- bool or list[bool]
If a single vertex is supplied, returns a bool. If a list is supplied, returns a list of bools of the same length.
- static IsInternal_old(vertex, topology, maxLeafSize: int = 4, identify: bool = False, tolerance: float = 0.0001, silent: bool = False)
Returns True if the input vertex lies inside the input topology.
- Parameters
- vertextopologic_core.Vertex
The input vertex.
- topologytopologic_core.Topology
The input topology.
- maxLeafSize: int , optional
The maximum number of primitives (topologies) that can be stored in a single leaf node of the BVH. Smaller values result in deeper trees with finer spatial subdivision (potentially faster queries but slower build times), while larger values produce shallower trees with coarser spatial grouping (faster builds but less precise queries). Default is 4.
- identify: bool, optional
If set to True, a tuple is returned where the identified subTopology is returned (e.g. (True, edge)). Default is False.
- tolerancefloat, optional
The desired tolerance. Default 0.0001.
- silentbool , optional
If set to True, error and warning messages are suppressed. Default is False.
- Returns
- bool
- static IsPeripheral(vertex, topology, tolerance: float = 0.0001, silent: bool = False) bool
Returns True if the input vertex is peripheral to the input topology. Returns False otherwise. A vertex is said to be peripheral to the input topology if: 01. Vertex: If it is internal to it (i.e. coincident with it). 02. Edge: If it is internal to its start or end vertices. 03. Manifold open wire: If it is internal to its start or end vertices. 04. Manifold closed wire: If it is internal to any of its vertices. 05. Non-manifold wire: If it is internal to any of its vertices that has a vertex degree of 1. 06. Face: If it is internal to any of its edges or vertices. 07. Shell: If it is internal to external boundary 08. Cell: If it is internal to any of its faces, edges, or vertices. 09. CellComplex: If it is peripheral to its external boundary. 10. Cluster: If it is peripheral to any of its free topologies. (See Cluster.FreeTopologies)
- Parameters
- vertextopologic_core.Vertex
The input vertex.
- topologytopologic_core.Topology
The input topology.
- tolerancefloat , optional
The tolerance for computing if the input vertex is peripheral to the input topology. Default is 0.0001.
- silentbool , optional
If set to True, error and warning messages are suppressed. Default is False.
- Returns
- bool
True if the input vertex is peripheral to the input topology. False otherwise.
- static NearestVertex(vertex, topology, useKDTree: bool = True, mantissa: int = 6)
Returns the vertex found in the input topology that is the nearest to the input vertex.
- Parameters
- vertextopologic_core.Vertex
The input vertex.
- topologytopologic_core.Topology
The input topology to be searched for the nearest vertex.
- useKDTreebool , optional
if set to True, the algorithm will use a KDTree method to search for the nearest vertex. Default is True.
- mantissaint , optional
The number of decimal places to round the result to. Default is 6.
- Returns
- topologic_core.Vertex
The nearest vertex.
- static Normal(vertices, mantissa: int = 6, tolerance: float = 0.0001, silent: bool = False)
Computes the normal vector of a list of co-planar Topologic vertices. Depending on the order of the vertices, the normal can be flipped 180 degrees.
- Parameters
- verticeslist
A list of Topologic Vertex objects that are assumed to be co-planar.
- mantissaint, optional
The number of decimal places to round the result to. Default is 6.
- tolerancefloat, optional
The desired tolerance. Default is 0.0001.
- silentbool , optional
If set to True, error and warning messages are suppressed. Default is False.
- Returns
- list
A unit normal vector [x, y, z] of the plane defined by the vertices, or None if invalid.
- static Origin()
Returns a vertex with coordinates (0, 0, 0)
- Parameters
- Returns
- topologic_core.Vertex
- static OutgoingEdges(vertex, hostTopology, tolerance: float = 0.0001) list
Returns the outgoing edges connected to a vertex. An edge is considered incoming if its start vertex is coincident with the input vertex.
- Parameters
- vertextopologic_core.Vertex
The input vertex.
- hostTopologytopologic_core.Topology
The input host topology to which the vertex belongs.
- tolerancefloat , optional
The desired tolerance. Default is 0.0001.
- Returns
- list
The list of outgoing edges
- static PerpendicularDistance(vertex, face, mantissa: int = 6)
Returns the perpendicular distance between the input vertex and the input face. The face is considered to be infinite.
- Parameters
- vertextopologic_core.Vertex
The input vertex.
- facetopologic_core.Face
The input face.
- mantissa: int , optional
The number of decimal places to round the result to. Default is 6.
- Returns
- float
The distance between the input vertex and the input topology.
- static PlaneEquation(vertices, mantissa: int = 6)
Returns the equation of the average plane passing through a list of vertices.
- Parameters
- verticeslist
The input list of vertices
- mantissaint , optional
The number of decimal places to round the result to. Default is 6.
- Returns
- dict
The dictionary containing the values of a, b, c, d for the plane equation in the form of ax+by+cz+d=0. The keys in the dictionary are [“a”, “b”, “c”. “d”]
- static Point(x=0, y=0, z=0)
Creates a point (vertex) using the input parameters
- Parameters
- xfloat , optional.
The desired x coordinate. Default is 0.
- yfloat , optional.
The desired y coordinate. Default is 0.
- zfloat , optional.
The desired z coordinate. Default is 0.
- Returns
- topologic_core.Vertex
- static Project(vertex, face, direction: bool = None, mantissa: int = 6)
Returns a vertex that is the projection of the input vertex unto the input face.
- Parameters
- vertextopologic_core.Vertex
The input vertex to project unto the input face.
- facetopologic_core.Face
The input face that receives the projection of the input vertex.
- directionvector, optional
The direction in which to project the input vertex unto the input face. If not specified, the direction of the projection is the normal of the input face. Default is None.
- mantissaint , optional
The length of the desired mantissa. Default is 6.
- Returns
- topologic_core.Vertex
The projected vertex.
- static Quadrance(vertex, topology, includeCentroid: bool = True, mantissa: int = 6) float
Returns the quadrance between the input vertex and the input topology.
Quadrance is the squared Euclidean distance. This method returns the quadrance to the closest sub-topology in the input topology, optionally including its centroid.
- Parameters
- vertextopologic_core.Vertex
The input vertex.
- topologytopologic_core.Topology
The input topology.
- includeCentroidbool
If set to True, the centroid of the input topology will be considered in finding the nearest subTopology to the input vertex. Default is True.
- mantissaint , optional
The number of decimal places to round the result to. Default is 6.
- Returns
- float
The quadrance between the input vertex and the input topology.
Notes
For Vertex/Edge/Wire, this is purely “squared distance” in Euclidean 3D.
For Face distance to plane (when projection is internal), this returns the
squared orthogonal distance to the face’s plane: (|ax+by+cz+d|^2)/(a^2+b^2+c^2).
- static RandomVertex(vertices, maxTries: int = 1000, pad: float = 0.0, tolerance: float = 0.0001, silent: bool = False)
Creates a random vertex within the bounding box of the input list of vertices, ensuring that it is not coincident with any input vertex.
- Parameters
- verticeslist
The input list of vertices.
- padfloat , optional
The desired additional distance to use outside the bounding box of the input list of vertices. Default is 0.0.
- tolerancefloat , optional
The desired tolerance for coincidence checking. The default is 0.0001.
- maxTriesint , optional
The maximum number of attempts to generate a non-coincident random vertex. The default is 1000.
- silentbool , optional
If set to True, error and warning messages are suppressed. Default is False.
- Returns
- topologic_core.Vertex or None
A random vertex within the bounding box of the input vertices that is not coincident with any of them. Returns None on failure.
- static Separate(*vertices, minDistance: float = 0.0001, iterations: int = 100, strength: float = 0.1, tolerance: float = 0.0001, silent: bool = False)
Separates the input vertices such that no two vertices are within the input minimum distance.
- Parameters
- vertices*topologicpy.Vertex
One or more instances of a topologic vertex to be processed.
- minDistancefloat , optional
The desired minimum distance. Default is 0.0001.
- iterationsint
The number of iterations to run the repulsion simulation. Default is 100.
- strengthfloat
The force multiplier controlling how strongly vertices repel each other. Default is 0.1.
- tolerancefloat
The desired tolerance. Default is 0.0001.
- silentbool , optional
If set to True, error and warning messages are suppressed. Default is False.
- Returns
- list
The list of vertices with adjusted positions
- static Transform(vertex, matrix, mantissa: int = 6, silent: bool = False)
Transforms a 3D vertex using a 4x4 transformation matrix.
- Parameters
- vertextopologic_core.Vertex
The input vertex
- matrixlist
The 4x4 transformation matrix.
- mantissaint , optional
The number of decimal places to round the result to. Default is 6.
- silentbool , optional
If set to True, error and warning messages are suppressed. Default is False.
- Returns
- topologic_core.Vertex
The transformed vertex.
- static Weld(vertices: list, mantissa: int = 6, tolerance: float = 0.0001)
Returns a list of vertices where vertices within a specified tolerance distance are fused while retaining duplicates, ensuring that vertices with nearly identical coordinates are replaced by a single shared coordinate.
- Parameters
- verticeslist
The input list of topologic vertices.
- mantissaint , optional
The desired length of the mantissa for retrieving vertex coordinates. Default is 6.
- tolerancefloat , optional
The desired tolerance for computing if vertices need to be fused. Any vertices that are closer to each other than this tolerance will be fused. Default is 0.0001.
- Returns
- list
The list of fused vertices. This list contains the same number of vertices and in the same order as the input list of vertices. However, the coordinates of these vertices have now been modified so that they are exactly the same with other vertices that are within the tolerance distance.
- static X(vertex, mantissa: int = None, silent: bool = False)
Returns the X coordinate of the input vertex.
- Parameters
- vertextopologic_core.Vertex
The input vertex
- mantissaint , optional
The desired length of the mantissa for retrieving vertex coordinates. None means no rounding. Default is None.
- silentbool , optional
If set to True, error and warning messages are suppressed. Default is False.
- Returns
- float
The X coordinate of the input vertex.
- static Y(vertex, mantissa: int = None, silent: bool = False)
Returns the Y coordinate of the input vertex.
- Parameters
- vertextopologic_core.Vertex
The input vertex
- mantissaint , optional
The desired length of the mantissa for retrieving vertex coordinates. None means no rounding. Default is None.
- silentbool , optional
If set to True, error and warning messages are suppressed. Default is False.
- Returns
- float
The Y coordinate of the input vertex.
- static Z(vertex, mantissa: int = None, silent: bool = False)
Returns the Z coordinate of the input vertex.
- Parameters
- vertextopologic_core.Vertex
The input vertex
- mantissaint , optional
The desired length of the mantissa for retrieving vertex coordinates. None means no rounding. Default is None.
- silentbool , optional
If set to True, error and warning messages are suppressed. Default is False.
- Returns
- float
The Z coordinate of the input vertex.