topologicpy.Face module

class topologicpy.Face.Face

Bases: object

Methods

AddInternalBoundaries(face, wires)

Adds internal boundaries (closed wires) to the input face.

AddInternalBoundariesCluster(face, cluster)

Adds the input cluster of internal boundaries (closed wires) to the input face.

Angle(faceA, faceB[, mantissa])

Returns the angle in degrees between the two input faces.

Area(face[, mantissa])

Returns the area of the input face.

BoundingRectangle(topology[, optimize, ...])

Returns a face representing a bounding rectangle of the input topology.

ByEdges(edges[, tolerance, silent])

Creates a face from the input list of edges.

ByEdgesCluster(cluster[, tolerance, silent])

Creates a face from the input cluster of edges.

ByOffset(face[, offset, offsetKey, ...])

Creates an offset face from the input face.

ByOffsetArea(face, area[, offsetKey, ...])

Creates an offset face from the input face based on the input area.

ByShell(shell[, origin, angTolerance, ...])

Creates a face by merging the faces of the input shell.

ByThickenedWire(wire[, offsetA, offsetB, ...])

Creates a face by thickening the input wire.

ByVertices(vertices[, tolerance, silent])

Creates a face from the input list of vertices.

ByVerticesCluster(cluster[, tolerance, silent])

Creates a face from the input cluster of vertices.

ByWire(wire[, tolerance, silent])

Creates a face from the input closed wire.

ByWires(externalBoundary[, ...])

Creates a face from the input external boundary (closed wire) and the input list of internal boundaries (closed wires).

ByWiresCluster(externalBoundary[, ...])

Creates a face from the input external boundary (closed wire) and the input cluster of internal boundaries (closed wires).

CHS([origin, radius, thickness, sides, ...])

Creates a circular hollow section (CHS).

CShape([origin, width, length, a, b, c, ...])

Creates a C-shape.

Circle([origin, radius, sides, fromAngle, ...])

Creates a circle.

Compactness(face[, mantissa])

Returns the compactness measure of the input face.

CompassAngle(face[, north, mantissa, tolerance])

Returns the horizontal compass angle in degrees between the normal vector of the input face and the input vector.

CrossShape([origin, width, length, a, b, c, ...])

Creates a Cross-shape.

Edges(face)

Returns the edges of the input face.

Einstein([origin, radius, direction, ...])

Creates an aperiodic monotile, also called an 'einstein' tile (meaning one tile in German, not the name of the famous physicist).

Ellipse([origin, inputMode, width, length, ...])

Creates an ellipse and returns all its geometry and parameters.

ExteriorAngles(face[, ...])

Returns the exterior angles of the input face in degrees.

ExternalBoundary(face[, tolerance, silent])

Returns the external boundary (closed wire) of the input face.

FacingToward(face[, direction, asVertex, ...])

Returns True if the input face is facing toward the input direction.

Fillet(face[, radius, sides, radiusKey, ...])

Fillets (rounds) the interior and exterior corners of the input face given the input radius.

Harmonize(face[, tolerance, silent])

Returns a harmonized version of the input face such that the u and v origins are always in the upperleft corner.

IShape([origin, width, length, a, b, c, ...])

Creates an I-shape.

InteriorAngles(face[, ...])

Returns the interior angles of the input face in degrees.

InternalBoundaries(face)

Returns the internal boundaries (closed wires) of the input face.

InternalVertex(face[, tolerance, silent])

Creates a vertex guaranteed to be inside the input face.

Invert(face[, tolerance, silent])

Creates a face that is an inverse (mirror) of the input face.

IsConvex(face[, mantissa, silent])

Returns True if the input face is convex.

IsCoplanar(faceA, faceB[, mantissa, tolerance])

Returns True if the two input faces are coplanar.

Isovist(face, vertex[, obstacles, ...])

Returns the face representing the isovist projection from the input viewpoint.

LShape([origin, width, length, a, b, ...])

Creates an L-shape.

MedialAxis(face[, resolution, ...])

Returns a wire representing an approximation of the medial axis of the input topology.

Normal(face[, outputType, mantissa])

Returns the normal vector to the input face.

NormalEdge(face[, length, tolerance, silent])

Returns the normal vector to the input face as an edge with the desired input length.

NorthArrow([origin, radius, sides, ...])

Creates a north arrow.

Planarize(face[, origin, tolerance])

Planarizes the input face such that its center of mass is located at the input origin and its normal is pointed in the input direction.

PlaneEquation(face[, mantissa])

Returns the a, b, c, d coefficients of the plane equation of the input face.

Project(faceA, faceB[, direction, mantissa, ...])

Creates a projection of the first input face unto the second input face.

RHS([origin, width, length, thickness, ...])

Creates a rectangluar hollow section (RHS).

Rectangle([origin, width, length, ...])

Creates a rectangle.

RemoveCollinearEdges(face[, angTolerance, ...])

Removes any collinear edges in the input face.

Ring([origin, radius, thickness, sides, ...])

Creates a circular ring.

SHS([origin, size, thickness, outerFillet, ...])

Creates a square hollow section (SHS).

Simplify(face[, method, tolerance, silent])

Simplifies the input wire edges based on the selected algorithm: Douglas-Peucker or Visvalingam–Whyatt.

Skeleton(face[, boundary, tolerance])

Creates a straight skeleton. This method is contributed by 高熙鹏 xipeng gao <gaoxipeng1998@gmail.com>

Square([origin, size, direction, placement, ...])

Creates a square.

Squircle([origin, radius, sides, a, b, ...])

Creates a Squircle which is a hybrid between a circle and a square.

Star([origin, radiusA, radiusB, rays, ...])

Creates a star.

TShape([origin, width, length, a, b, ...])

Creates a T-shape.

ThirdVertex(face[, tolerance, silent])

Returns a third vertex on the input face to enable rotation matrix creation.

Trapezoid([origin, widthA, widthB, offsetA, ...])

Creates a trapezoid.

Triangulate(face[, mode, meshSize, ...])

Triangulates the input face and returns a list of faces.

TrimByWire(face, wire[, reverse])

Trims the input face by the input wire.

VertexByParameters(face[, u, v])

Creates a vertex at the u and v parameters of the input face.

VertexParameters(face, vertex[, outputType, ...])

Returns the u and v parameters of the input face at the location of the input vertex.

Vertices(face)

Returns the vertices of the input face.

Wire(face)

Returns the external boundary (closed wire) of the input face.

Wires(face)

Returns the wires of the input face.

RectangleByPlaneEquation

static AddInternalBoundaries(face, wires: list)

Adds internal boundaries (closed wires) to the input face. Internal boundaries are considered holes in the input face.

Parameters
facetopologic_core.Face

The input face.

wireslist

The input list of internal boundaries (closed wires).

Returns
topologic_core.Face

The created face with internal boundaries added to it.

static AddInternalBoundariesCluster(face, cluster)

Adds the input cluster of internal boundaries (closed wires) to the input face. Internal boundaries are considered holes in the input face.

Parameters
facetopologic_core.Face

The input face.

clustertopologic_core.Cluster

The input cluster of internal boundaries (topologic wires).

Returns
topologic_core.Face

The created face with internal boundaries added to it.

static Angle(faceA, faceB, mantissa: int = 6) float

Returns the angle in degrees between the two input faces.

Parameters
faceAtopologic_core.Face

The first input face.

faceBtopologic_core.Face

The second input face.

mantissaint , optional

The number of decimal places to round the result to. Default is 6.

Returns
float

The angle in degrees between the two input faces.

static Area(face, mantissa: int = 6) float

Returns the area of the input face.

Parameters
facetopologic_core.Face

The input face.

mantissaint , optional

The number of decimal places to round the result to. Default is 6.

Returns
float

The area of the input face.

static BoundingRectangle(topology, optimize: int = 0, tolerance: float = 0.0001)

Returns a face representing a bounding rectangle of the input topology. The returned face contains a dictionary with key “zrot” that represents rotations around the Z axis. If applied the resulting face will become axis-aligned.

Parameters
topologytopologic_core.Topology

The input topology.

optimizeint , optional

If set to an integer from 1 (low optimization) to 10 (high optimization), the method will attempt to optimize the bounding rectangle so that it reduces its surface area. Default is 0 which will result in an axis-aligned bounding rectangle. Default is 0.

tolerancefloat , optional

The desired tolerance. Default is 0.0001.

Returns
topologic_core.Face

The bounding rectangle of the input topology.

static ByEdges(edges: list, tolerance: float = 0.0001, silent: bool = False)

Creates a face from the input list of edges.

Parameters
edgeslist

The input list of edges.

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
facetopologic_core.Face

The created face.

static ByEdgesCluster(cluster, tolerance: float = 0.0001, silent: bool = False)

Creates a face from the input cluster of edges.

Parameters
clustertopologic_core.Cluster

The input cluster of edges.

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
facetopologic_core.Face

The created face.

static ByOffset(face, offset: float = 1.0, offsetKey: str = 'offset', stepOffsetA: float = 0, stepOffsetB: float = 0, stepOffsetKeyA: str = 'stepOffsetA', stepOffsetKeyB: str = 'stepOffsetB', reverse: bool = False, bisectors: bool = False, transferDictionaries: bool = False, epsilon: float = 0.01, tolerance: float = 0.0001, silent: bool = False, numWorkers: int = None)

Creates an offset face from the input face. A positive offset value results in an offset to the interior of an anti-clockwise face.

Parameters
facetopologic_core.Face

The input face.

offsetfloat , optional

The desired offset distance. Default is 1.0.

offsetKeystr , optional

The edge dictionary key under which to find the offset value. If a value cannot be found, the offset input parameter value is used instead. Default is “offset”.

stepOffsetAfloat , optional

The amount to offset along the previous edge when transitioning between parallel edges with different offsets. Default is 0.

stepOffsetBfloat , optional

The amount to offset along the next edge when transitioning between parallel edges with different offsets. Default is 0.

stepOffsetKeyAstr , optional

The vertex dictionary key under which to find the step offset A value. If a value cannot be found, the stepOffsetA input parameter value is used instead. Default is “stepOffsetA”.

stepOffsetKeyBstr , optional

The vertex dictionary key under which to find the step offset B value. If a value cannot be found, the stepOffsetB input parameter value is used instead. Default is “stepOffsetB”.

bisectorsbool , optional

If set to True, The bisectors (seams) edges will be included in the returned wire. This will result in the returned shape to be a shell rather than a face. Default is False.

reversebool , optional

If set to True, the direction of offsets is reversed. Otherwise, it is not. Default is False.

transferDictionariesbool , optional

If set to True, the dictionaries of the original wire, its edges, and its vertices are transfered to the new wire. Otherwise, they are not. Default is False.

epsilonfloat , optional

The desired epsilon (another form of tolerance for shortest edge to remove). Default is 0.01. (This is set to a larger number as it was found to work better)

tolerancefloat , optional

The desired tolerance. Default is 0.0001.

silentbool , optional

If set to True, error and warning messages are suppressed. Default is False.

numWorkersint , optional

Number of workers run in parallel to process. If you set it to 1, no parallel processing will take place. The default is None which causes the algorithm to use twice the number of cpu cores in the host computer.

Returns
topologic_core.Face or topologic_core.Shell

The created face or shell.

static ByOffsetArea(face, area, offsetKey='offset', minOffsetKey='minOffset', maxOffsetKey='maxOffset', defaultMinOffset=0, defaultMaxOffset=1, maxIterations=1, tolerance=0.0001, silent=False, numWorkers=None)

Creates an offset face from the input face based on the input area.

Parameters
facetopologic_core.Face

The input face.

areafloat

The desired area of the created face.

offsetKeystr , optional

The edge dictionary key under which to store the offset value. Default is “offset”.

minOffsetKeystr , optional

The edge dictionary key under which to find the desired minimum edge offset value. If a value cannot be found, the defaultMinOffset input parameter value is used instead. Default is “minOffset”.

maxOffsetKeystr , optional

The edge dictionary key under which to find the desired maximum edge offset value. If a value cannot be found, the defaultMaxOffset input parameter value is used instead. Default is “maxOffset”.

defaultMinOffsetfloat , optional

The desired minimum edge offset distance. Default is 0.

defaultMaxOffsetfloat , optional

The desired maximum edge offset distance. Default is 1.

maxIterations: int , optional

The desired maximum number of iterations to attempt to converge on a solution. Default is 1.

tolerancefloat , optional

The desired tolerance. Default is 0.0001.

silentbool , optional

If set to True, error and warning messages are suppressed. Default is False.

numWorkersint , optional

Number of workers run in parallel to process. If you set it to 1, no parallel processing will take place. The default is None which causes the algorithm to use twice the number of cpu cores in the host computer.

Returns
topologic_core.Face

The created face.

static ByShell(shell, origin=None, angTolerance: float = 0.1, tolerance: float = 0.0001, silent=False)

Creates a face by merging the faces of the input shell.

Parameters
shelltopologic_core.Shell

The input shell.

angTolerancefloat , optional

The desired angular tolerance. Default is 0.1.

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.Face

The created face.

static ByThickenedWire(wire, offsetA: float = 1.0, offsetB: float = 0.0, tolerance: float = 0.0001, silent: bool = False)

Creates a face by thickening the input wire. This method assumes the wire is manifold and planar.

Parameters
wiretopologic_core.Wire

The input wire to be thickened.

offsetAfloat , optional

The desired offset to the exterior of the wire. Default is 1.0.

offsetBfloat , optional

The desired offset to the interior of the wire. Default is 0.0.

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.Face

The created face.

static ByVertices(vertices: list, tolerance: float = 0.0001, silent: bool = False)

Creates a face from the input list of vertices.

Parameters
verticeslist

The input list of vertices.

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.Face

The created face.

static ByVerticesCluster(cluster, tolerance: float = 0.0001, silent: bool = False)

Creates a face from the input cluster of vertices.

Parameters
clustertopologic_core.Cluster

The input cluster of vertices.

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.Face

The created face.

static ByWire(wire, tolerance: float = 0.0001, silent: bool = False)

Creates a face from the input closed wire.

Parameters
wiretopologic_core.Wire

The input wire.

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.Face or list

The created face. If the wire is non-planar, the method will attempt to triangulate the wire and return a list of faces.

static ByWires(externalBoundary, internalBoundaries: list = [], tolerance: float = 0.0001, silent: bool = False)

Creates a face from the input external boundary (closed wire) and the input list of internal boundaries (closed wires).

Parameters
externalBoundarytopologic_core.Wire

The input external boundary.

internalBoundarieslist , optional

The input list of internal boundaries (closed wires). Default is an empty list.

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.Face

The created face.

static ByWiresCluster(externalBoundary, internalBoundariesCluster=None, tolerance: float = 0.0001, silent: bool = False)

Creates a face from the input external boundary (closed wire) and the input cluster of internal boundaries (closed wires).

Parameters
externalBoundary topologic_core.Wire

The input external boundary (closed wire).

internalBoundariesClustertopologic_core.Cluster

The input cluster of internal boundaries (closed wires). Default is None.

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.Face

The created face.

static CHS(origin=None, radius: float = 0.5, thickness: float = 0.25, sides: int = 16, direction: list = [0, 0, 1], placement: str = 'center', tolerance: float = 0.0001, silent: bool = False)

Creates a circular hollow section (CHS).

Parameters
origintopologic_core.Vertex, optional

The location of the origin of the CHS. Default is None which results in the CHS being placed at (0, 0, 0).

radiusfloat , optional

The outer radius of the CHS. Default is 0.5.

thicknessfloat , optional

The thickness of the CHS. Default is 0.25.

directionlist , optional

The vector representing the up direction of the CHS. Default is [0, 0, 1].

placementstr , optional

The description of the placement of the origin of the CHS. This can be “center”, “lowerleft”, “upperleft”, “lowerright”, “upperright”. It is case insensitive. Default is “center”.

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.Face

The created face.

static CShape(origin=None, width=1, length=1, a=0.25, b=0.25, c=0.25, flipHorizontal=False, flipVertical=False, direction=[0, 0, 1], placement='center', tolerance=0.0001, silent=False)

Creates a C-shape.

Parameters
origintopologic_core.Vertex , optional

The location of the origin of the C-shape. Default is None which results in the C-shape being placed at (0, 0, 0).

widthfloat , optional

The overall width of the C-shape. Default is 1.0.

lengthfloat , optional

The overall length of the C-shape. Default is 1.0.

afloat , optional

The hortizontal thickness of the vertical arm of the C-shape. Default is 0.25.

bfloat , optional

The vertical thickness of the bottom horizontal arm of the C-shape. Default is 0.25.

cfloat , optional

The vertical thickness of the top horizontal arm of the C-shape. Default is 0.25.

directionlist , optional

The vector representing the up direction of the C-shape. Default is [0, 0, 1].

placementstr , optional

The description of the placement of the origin of the C-shape. This can be “center”, “lowerleft”, “upperleft”, “lowerright”, “upperright”. It is case insensitive. Default is “center”.

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.Face

The created C-shape.

static Circle(origin=None, radius: float = 0.5, sides: int = 16, fromAngle: float = 0.0, toAngle: float = 360.0, direction: list = [0, 0, 1], placement: str = 'center', tolerance: float = 0.0001)

Creates a circle.

Parameters
origintopologic_core.Vertex, optional

The location of the origin of the circle. Default is None which results in the circle being placed at (0, 0, 0).

radiusfloat , optional

The radius of the circle. Default is 1.

sidesint , optional

The number of sides of the circle. Default is 16.

fromAnglefloat , optional

The angle in degrees from which to start creating the arc of the circle. Default is 0.

toAnglefloat , optional

The angle in degrees at which to end creating the arc of the circle. Default is 360.

directionlist , optional

The vector representing the up direction of the circle. Default is [0, 0, 1].

placementstr , optional

The description of the placement of the origin of the circle. This can be “center”, “lowerleft”, “upperleft”, “lowerright”, or “upperright”. It is case insensitive. Default is “center”.

tolerancefloat , optional

The desired tolerance. Default is 0.0001.

Returns
topologic_core.Face

The created circle.

static Compactness(face, mantissa: int = 6) float

Returns the compactness measure of the input face. See https://en.wikipedia.org/wiki/Compactness_measure_of_a_shape

Parameters
facetopologic_core.Face

The input face.

mantissaint , optional

The number of decimal places to round the result to. Default is 6.

Returns
float

The compactness measure of the input face.

static CompassAngle(face, north: list = None, mantissa: int = 6, tolerance: float = 0.0001) float

Returns the horizontal compass angle in degrees between the normal vector of the input face and the input vector. The angle is measured in counter-clockwise fashion. Only the first two elements of the vectors are considered.

Parameters
facetopologic_core.Face

The input face.

northlist , optional

The second vector representing the north direction. Default is the positive YAxis ([0,1,0]).

mantissaint, optional

The length of the desired mantissa. Default is 6.

tolerancefloat , optional

The desired tolerance. Default is 0.0001.

Returns
float

The horizontal compass angle in degrees between the direction of the face and the second input vector.

static CrossShape(origin=None, width=1, length=1, a=0.25, b=0.25, c=None, d=None, flipHorizontal=False, flipVertical=False, direction=[0, 0, 1], placement='center', tolerance=0.0001, silent=False)

Creates a Cross-shape.

Parameters
origintopologic_core.Vertex , optional

The location of the origin of the T-shape. Default is None which results in the Cross-shape being placed at (0, 0, 0).

widthfloat , optional

The overall width of the Cross-shape. Default is 1.0.

lengthfloat , optional

The overall length of the Cross-shape. Default is 1.0.

afloat , optional

The hortizontal thickness of the vertical arm of the Cross-shape. Default is 0.25.

bfloat , optional

The vertical thickness of the horizontal arm of the Cross-shape. Default is 0.25.

cfloat , optional

The distance of the vertical symmetry axis measured from the left side of the Cross-shape. Default is None which results in the Cross-shape being symmetrical on the Y-axis.

dfloat , optional

The distance of the horizontal symmetry axis measured from the bottom side of the Cross-shape. Default is None which results in the Cross-shape being symmetrical on the X-axis.

directionlist , optional

The vector representing the up direction of the Cross-shape. Default is [0, 0, 1].

placementstr , optional

The description of the placement of the origin of the Cross-shape. This can be “center”, “lowerleft”, “upperleft”, “lowerright”, “upperright”. It is case insensitive. Default is “center”.

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.Face

The created Cross-shape.

static Edges(face) list

Returns the edges of the input face.

Parameters
facetopologic_core.Face

The input face.

Returns
list

The list of edges.

static Einstein(origin=None, radius: float = 0.5, direction: list = [0, 0, 1], placement: str = 'center', tolerance: float = 0.0001)

Creates an aperiodic monotile, also called an ‘einstein’ tile (meaning one tile in German, not the name of the famous physicist). See https://arxiv.org/abs/2303.10798

Parameters
origintopologic_core.Vertex , optional

The location of the origin of the tile. Default is None which results in the tiles first vertex being placed at (0, 0, 0).

radiusfloat , optional

The radius of the hexagon determining the size of the tile. Default is 0.5.

directionlist , optional

The vector representing the up direction of the ellipse. Default is [0, 0, 1].

placementstr , optional

The description of the placement of the origin of the hexagon determining the location of the tile. This can be “center”, or “lowerleft”. It is case insensitive. Default is “center”.

tolerancefloat , optional

The desired tolerance. Default is 0.0001.

Returns
topologic_core.Face

The created Einstein tile.

static Ellipse(origin=None, inputMode: int = 1, width: float = 2.0, length: float = 1.0, focalLength: float = 0.866025, eccentricity: float = 0.866025, majorAxisLength: float = 1.0, minorAxisLength: float = 0.5, sides: float = 32, fromAngle: float = 0.0, toAngle: float = 360.0, close: bool = True, direction: list = [0, 0, 1], placement: str = 'center', tolerance: float = 0.0001)

Creates an ellipse and returns all its geometry and parameters.

Parameters
origintopologic_core.Vertex , optional

The location of the origin of the ellipse. Default is None which results in the ellipse being placed at (0, 0, 0).

inputModeint , optional

The method by which the ellipse is defined. Default is 1. Based on the inputMode value, only the following inputs will be considered. The options are: 1. Width and Length (considered inputs: width, length) 2. Focal Length and Eccentricity (considered inputs: focalLength, eccentricity) 3. Focal Length and Minor Axis Length (considered inputs: focalLength, minorAxisLength) 4. Major Axis Length and Minor Axis Length (considered input: majorAxisLength, minorAxisLength)

widthfloat , optional

The width of the ellipse. Default is 2.0. This is considered if the inputMode is 1.

lengthfloat , optional

The length of the ellipse. Default is 1.0. This is considered if the inputMode is 1.

focalLengthfloat , optional

The focal length of the ellipse. Default is 0.866025. This is considered if the inputMode is 2 or 3.

eccentricityfloat , optional

The eccentricity of the ellipse. Default is 0.866025. This is considered if the inputMode is 2.

majorAxisLengthfloat , optional

The length of the major axis of the ellipse. Default is 1.0. This is considered if the inputMode is 4.

minorAxisLengthfloat , optional

The length of the minor axis of the ellipse. Default is 0.5. This is considered if the inputMode is 3 or 4.

sidesint , optional

The number of sides of the ellipse. Default is 32.

fromAnglefloat , optional

The angle in degrees from which to start creating the arc of the ellipse. Default is 0.

toAnglefloat , optional

The angle in degrees at which to end creating the arc of the ellipse. Default is 360.

closebool , optional

If set to True, arcs will be closed by connecting the last vertex to the first vertex. Otherwise, they will be left open.

directionlist , optional

The vector representing the up direction of the ellipse. Default is [0, 0, 1].

placementstr , optional

The description of the placement of the origin of the ellipse. This can be “center”, or “lowerleft”. It is case insensitive. Default is “center”.

tolerancefloat , optional

The desired tolerance. Default is 0.0001.

Returns
topologic_core.Face

The created ellipse

static ExteriorAngles(face, includeInternalBoundaries=False, mantissa: int = 6) list

Returns the exterior angles of the input face in degrees. The face must be planar.

Parameters
facetopologic_core.Face

The input face.

includeInternalBoundariesbool , optional

If set to True and if the face has internal boundaries (holes), the returned list will be a nested list where the first list is the list of exterior angles of the external boundary and the second list will contain lists of the exterior angles of each of the internal boundaries (holes). For example: [[270,270,270,270], [[270,270,270,270],[300,300,300]]]. If not, the returned list will be a simple list of interior angles of the external boundary. For example: [270,270,270,270]. Please note that that the interior angles of the internal boundaries are considered to be those interior to the original face. Thus, they are exterior to the internal boundary.

mantissaint , optional

The number of decimal places to round the result to. Default is 6.

Returns
——-
list

The list of exterior angles.

static ExternalBoundary(face, tolerance: float = 0.0001, silent=False)

Returns the external boundary (closed wire) of the input face.

Parameters
facetopologic_core.Face

The input face.

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.Wire

The external boundary of the input face.

static FacingToward(face, direction: list = [0, 0, -1], asVertex: bool = False, mantissa: int = 6, tolerance: float = 0.0001) bool

Returns True if the input face is facing toward the input direction.

Parameters
facetopologic_core.Face

The input face.

directionlist , optional

The input direction. Default is [0,0,-1].

asVertexbool , optional

If set to True, the direction is treated as an actual vertex in 3D space. Default is False.

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 face is facing toward the direction. False otherwise.

static Fillet(face, radius: float = 0, sides: int = 16, radiusKey: str = None, tolerance: float = 0.0001, silent: bool = False)

Fillets (rounds) the interior and exterior corners of the input face given the input radius. See https://en.wikipedia.org/wiki/Fillet_(mechanics)

Parameters
facetopologic_core.Face

The input face.

radiusfloat , optional

The desired radius of the fillet. Default is 0.

sidesint , optional

The number of sides (segments) of the fillet. Default is 16.

radiusKeystr , optional

If specified, the dictionary of the vertices will be queried for this key to specify the desired fillet radius. Default is None.

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.Face

The filleted face.

static Harmonize(face, tolerance: float = 0.0001, silent: bool = False)

Returns a harmonized version of the input face such that the u and v origins are always in the upperleft corner.

Parameters
facetopologic_core.Face

The input face.

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.Face

The harmonized face.

static IShape(origin=None, width=1, length=1, a=0.25, b=0.25, c=0.25, flipHorizontal=False, flipVertical=False, direction=[0, 0, 1], placement='center', tolerance=0.0001, silent=False)

Creates an I-shape.

Parameters
origintopologic_core.Vertex , optional

The location of the origin of the I-shape. Default is None which results in the I-shape being placed at (0, 0, 0).

widthfloat , optional

The overall width of the I-shape. Default is 1.0.

lengthfloat , optional

The overall length of the I-shape. Default is 1.0.

afloat , optional

The hortizontal thickness of the central vertical arm of the I-shape. Default is 0.25.

bfloat , optional

The vertical thickness of the bottom horizontal arm of the I-shape. Default is 0.25.

cfloat , optional

The vertical thickness of the top horizontal arm of the I-shape. Default is 0.25.

flipHorizontalbool , optional

if set to True, the shape is flipped horizontally. Default is False.

flipVerticalbool , optional

if set to True, the shape is flipped vertically. Default is False.

directionlist , optional

The vector representing the up direction of the I-shape. Default is [0, 0, 1].

placementstr , optional

The description of the placement of the origin of the I-shape. This can be “center”, “lowerleft”, “upperleft”, “lowerright”, “upperright”. It is case insensitive. Default is “center”.

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.Face

The created I-shape.

static InteriorAngles(face, includeInternalBoundaries: bool = False, mantissa: int = 6) list

Returns the interior angles of the input face in degrees. The face must be planar.

Parameters
facetopologic_core.Face

The input face.

includeInternalBoundariesbool , optional

If set to True and if the face has internal boundaries (holes), the returned list will be a nested list where the first list is the list of interior angles of the external boundary and the second list will contain lists of the interior angles of each of the internal boundaries (holes). For example: [[90,90,90,90], [[90,90,90,90],[60,60,60]]]. If not, the returned list will be a simple list of interior angles of the external boundary. For example: [90,90,90,90]. Please note that that the interior angles of the internal boundaries are considered to be those interior to the original face. Thus, they are exterior to the internal boundary.

mantissaint , optional

The number of decimal places to round the result to. Default is 6.

Returns
——-
list

The list of interior angles.

static InternalBoundaries(face) list

Returns the internal boundaries (closed wires) of the input face.

Parameters
facetopologic_core.Face

The input face.

Returns
list

The list of internal boundaries (closed wires).

static InternalVertex(face, tolerance: float = 0.0001, silent: bool = False)

Creates a vertex guaranteed to be inside the input face.

Parameters
facetopologic_core.Face

The input face.

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 created vertex.

static Invert(face, tolerance: float = 0.0001, silent: bool = False)

Creates a face that is an inverse (mirror) of the input face.

Parameters
facetopologic_core.Face

The input face.

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.Face

The inverted face.

static IsConvex(face, mantissa: int = 6, silent: bool = False) bool

Returns True if the input face is convex. Returns False otherwise.

Parameters
facetopologic_core.Face

The input face.

mantissaint , optional

The length of the desired mantissa. Default is 6.

silentbool , optional

If set to True, error and warning messages are suppressed. Default is False.

Returns
——-
bool

True if the nput face is convex. False otherwise.

static IsCoplanar(faceA, faceB, mantissa: int = 6, tolerance: float = 0.0001) bool

Returns True if the two input faces are coplanar. Returns False otherwise.

Parameters
faceAtopologic_core.Face

The first input face.

faceBtopologic_core.Face

The second input face

mantissaint , optional

The length of the desired mantissa. Default is 6.

tolerancefloat , optional

The desired tolerance. Default is 0.0001.

Returns
bool

True if the two input faces are coplanar. False otherwise.

static Isovist(face, vertex, obstacles: list = [], direction: list = [0, 1, 0], fov: float = 360, transferDictionaries: bool = False, metrics: bool = False, triangles: bool = False, mantissa: int = 6, tolerance: float = 0.0001, silent: bool = False)

Returns the face representing the isovist projection from the input viewpoint.

This implementation uses a fast 2D visibility algorithm: 1. The input face, holes, and obstacles are flattened to the XY plane. 2. The navigable/free-space polygon is constructed using Shapely. 3. Critical-angle rays are cast from the viewpoint to all polygon vertices. 4. The nearest boundary intersection along each ray is used to construct the visible polygon. 5. The resulting Shapely polygon is converted back to a TopologicPy Face. 6. Metrics and dictionary transfer are preserved.

This method assumes all visibility computation is carried out in 2D. The input topology may be non-horizontal because it is flattened before computation and unflattened before return.

Parameters
facetopologic_core.Face

The face representing the boundary of the isovist.

vertextopologic_core.Vertex

The vertex representing the viewpoint.

obstacleslist , optional

A list of wires representing obstacles within the face. Default is [].

directionlist, optional

The vector representing the direction of view in the XY plane. Default is [0,1,0].

fovfloat , optional

The horizontal field of view angle in degrees. Acceptable range is 1 to 360. Default is 360.

transferDictionariesbool , optional

If True, dictionaries of encountered physical edges are transferred to matching isovist edges.

metricsbool , optional

If True, isovist metrics are calculated and stored in the dictionary of the returned face.

trianglesbool , optional

If True, radial triangles from the viewpoint to isovist edges are stored as contents.

mantissaint , optional

Number of decimal places to round results to. Default is 6.

tolerancefloat , optional

Desired tolerance. Default is 0.0001.

silentbool , optional

If True, error and warning messages are suppressed. Default is False.

Returns
topologic_core.Face

The face representing the isovist projection from the input viewpoint.

static LShape(origin=None, width=1, length=1, a=0.25, b=0.25, flipHorizontal=False, flipVertical=False, direction=[0, 0, 1], placement='center', tolerance=0.0001, silent=False)

Creates an L-shape.

Parameters
origintopologic_core.Vertex , optional

The location of the origin of the L-shape. Default is None which results in the L-shape being placed at (0, 0, 0).

widthfloat , optional

The overall width of the L-shape. Default is 1.0.

lengthfloat , optional

The overall length of the L-shape. Default is 1.0.

afloat , optional

The hortizontal thickness of the vertical arm of the L-shape. Default is 0.25.

bfloat , optional

The vertical thickness of the horizontal arm of the L-shape. Default is 0.25.

directionlist , optional

The vector representing the up direction of the L-shape. Default is [0, 0, 1].

placementstr , optional

The description of the placement of the origin of the L-shape. This can be “center”, “lowerleft”, “upperleft”, “lowerright”, “upperright”. It is case insensitive. Default is “center”.

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.Face

The created L-shape.

static MedialAxis(face, resolution: int = 0, externalVertices: bool = False, internalVertices: bool = False, toLeavesOnly: bool = False, angTolerance: float = 0.1, tolerance: float = 0.0001, silent: bool = False)

Returns a wire representing an approximation of the medial axis of the input topology. See https://en.wikipedia.org/wiki/Medial_axis.

Parameters
facetopologic_core.Face

The input face.

resolutionint , optional

The desired resolution of the solution (range is 0: standard resolution to 10: high resolution). This determines the density of the sampling along each edge. Default is 0.

externalVerticesbool , optional

If set to True, the external vertices of the face will be connected to the nearest vertex on the medial axis. Default is False.

internalVerticesbool , optional

If set to True, the internal vertices of the face will be connected to the nearest vertex on the medial axis. Default is False.

toLeavesOnlybool , optional

If set to True, the vertices of the face will be connected to the nearest vertex on the medial axis only if this vertex is a leaf (end point). Otherwise, it will connect to any nearest vertex. Default is False.

angTolerancefloat , optional

The desired angular tolerance in degrees for removing collinear edges. Default is 0.1.

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.Wire

The medial axis of the input face.

static Normal(face, outputType='xyz', mantissa=6)

Returns the normal vector to the input face. A normal vector of a face is a vector perpendicular to it.

Parameters
facetopologic_core.Face

The input face.

outputTypestring , optional

The string defining the desired output. This can be any subset or permutation of “xyz”. It is case insensitive. Default is “xyz”.

mantissaint , optional

The number of decimal places to round the result to. Default is 6.

Returns
list

The normal vector to the input face.

static NormalEdge(face, length: float = 1.0, tolerance: float = 0.0001, silent: bool = False)

Returns the normal vector to the input face as an edge with the desired input length. A normal vector of a face is a vector perpendicular to it.

Parameters
facetopologic_core.Face

The input face.

lengthfloat , optional

The desired length of the normal edge. Default is 1.

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.Edge

The created normal edge to the input face. This is computed at the approximate center of the face.

static NorthArrow(origin=None, radius: float = 0.5, sides: int = 16, direction: list = [0, 0, 1], northAngle: float = 0.0, placement: str = 'center', tolerance: float = 0.0001)

Creates a north arrow.

Parameters
origintopologic_core.Vertex, optional

The location of the origin of the circle. Default is None which results in the circle being placed at (0, 0, 0).

radiusfloat , optional

The radius of the circle. Default is 1.

sidesint , optional

The number of sides of the circle. Default is 16.

directionlist , optional

The vector representing the up direction of the circle. Default is [0, 0, 1].

northAnglefloat , optional

The angular offset in degrees from the positive Y axis direction. The angle is measured in a counter-clockwise fashion where 0 is positive Y, 90 is negative X, 180 is negative Y, and 270 is positive X.

placementstr , optional

The description of the placement of the origin of the circle. This can be “center”, “lowerleft”, “upperleft”, “lowerright”, or “upperright”. It is case insensitive. Default is “center”.

tolerancefloat , optional

The desired tolerance. Default is 0.0001.

Returns
topologic_core.Face

The created circle.

static Planarize(face, origin=None, tolerance: float = 0.0001)

Planarizes the input face such that its center of mass is located at the input origin and its normal is pointed in the input direction.

Parameters
facetopologic_core.Face

The input face.

origintopologic_core.Vertex , optional

The desired vertex to use as the origin of the plane to project the face unto. If set to None, the centroidof the input face is used. Default is None.

tolerancefloat , optional

The desired tolerance. Default is 0.0001.

Returns
topologic_core.Face

The planarized face.

static PlaneEquation(face, mantissa: int = 6) dict

Returns the a, b, c, d coefficients of the plane equation of the input face. The input face is assumed to be planar.

Parameters
facetopologic_core.Face

The input face.

Returns
dict

The dictionary containing the coefficients of the plane equation. The keys of the dictionary are: [“a”, “b”, “c”, “d”].

static Project(faceA, faceB, direction: list = None, mantissa: int = 6, tolerance: float = 0.0001)

Creates a projection of the first input face unto the second input face.

Parameters
faceAtopologic_core.Face

The face to be projected.

faceBtopologic_core.Face

The face unto which the first input face will be projected.

directionlist, optional

The vector direction of the projection. If None, the reverse vector of the receiving face normal will be used. Default is None.

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
topologic_core.Face

The projected Face.

static RHS(origin=None, width: float = 1.0, length: float = 1.0, thickness: float = 0.25, outerFillet: float = 0.0, innerFillet: float = 0.0, sides: int = 16, direction: list = [0, 0, 1], placement: str = 'center', tolerance: float = 0.0001, silent: bool = False)

Creates a rectangluar hollow section (RHS).

Parameters
origintopologic_core.Vertex, optional

The location of the origin of the RHS. Default is None which results in the RHS being placed at (0, 0, 0).

widthfloat , optional

The width of the RHS. Default is 1.0.

lengthfloat , optional

The length of the RHS. Default is 1.0.

thicknessfloat , optional

The thickness of the RHS. Default is 0.25.

outerFilletfloat , optional

The outer fillet multiplication factor based on the thickness (e.g. 1t). Default is 0.

innerFilletfloat , optional

The inner fillet multiplication factor based on the thickness (e.g. 1.5t). Default is 0.

sidesint , optional

The desired number of sides of the fillets. Default is 16.

directionlist , optional

The vector representing the up direction of the RHS. Default is [0, 0, 1].

placementstr , optional

The description of the placement of the origin of the RHS. This can be “center”, “lowerleft”, “upperleft”, “lowerright”, “upperright”. It is case insensitive. Default is “center”.

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.Face

The created face.

static Rectangle(origin=None, width: float = 1.0, length: float = 1.0, direction: list = [0, 0, 1], placement: str = 'center', tolerance: float = 0.0001, silent: bool = True)

Creates a rectangle.

Parameters
origintopologic_core.Vertex, optional

The location of the origin of the rectangle. Default is None which results in the rectangle being placed at (0, 0, 0).

widthfloat , optional

The width of the rectangle. Default is 1.0.

lengthfloat , optional

The length of the rectangle. Default is 1.0.

directionlist , optional

The vector representing the up direction of the rectangle. Default is [0, 0, 1].

placementstr , optional

The description of the placement of the origin of the rectangle. This can be “center”, “lowerleft”, “upperleft”, “lowerright”, “upperright”. It is case insensitive. Default is “center”.

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.Face

The created face.

static RectangleByPlaneEquation(origin=None, width: float = 1.0, length: float = 1.0, placement: str = 'center', equation: dict = None, tolerance: float = 0.0001)
static RemoveCollinearEdges(face, angTolerance: float = 0.1, tolerance: float = 0.0001, silent: bool = False)

Removes any collinear edges in the input face.

Parameters
facetopologic_core.Face

The input face.

angTolerancefloat , optional

The desired angular tolerance. Default is 0.1.

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.Face

The created face without any collinear edges.

static Ring(origin=None, radius: float = 0.5, thickness: float = 0.25, sides: int = 16, direction: list = [0, 0, 1], placement: str = 'center', tolerance: float = 0.0001, silent: bool = False)

Creates a circular ring. This is an alias method for creating a circular hollow section (CHS).

Parameters
origintopologic_core.Vertex, optional

The location of the origin of the ring. Default is None which results in the ring being placed at (0, 0, 0).

radiusfloat , optional

The outer radius of the ring. Default is 0.5.

thicknessfloat , optional

The thickness of the ring. Default is 0.25.

directionlist , optional

The vector representing the up direction of the ring. Default is [0, 0, 1].

placementstr , optional

The description of the placement of the origin of the ring. This can be “center”, “lowerleft”, “upperleft”, “lowerright”, “upperright”. It is case insensitive. Default is “center”.

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.Face

The created face.

static SHS(origin=None, size: float = 1.0, thickness: float = 0.25, outerFillet: float = 0.0, innerFillet: float = 0.0, sides: int = 16, direction: list = [0, 0, 1], placement: str = 'center', tolerance: float = 0.0001, silent: bool = False)

Creates a square hollow section (SHS).

Parameters
origintopologic_core.Vertex, optional

The location of the origin of the SHS. Default is None which results in the SHS being placed at (0, 0, 0).

sizefloat , optional

The outer size of the SHS. Default is 1.0.

thicknessfloat , optional

The thickness of the SHS. Default is 0.25.

outerFilletfloat , optional

The outer fillet multiplication factor based on the thickness (e.g. 1t). Default is 0.

innerFilletfloat , optional

The inner fillet multiplication factor based on the thickness (e.g. 1.5t). Default is 0.

sidesint , optional

The desired number of sides of the fillets. Default is 16.

directionlist , optional

The vector representing the up direction of the SHS. Default is [0, 0, 1].

placementstr , optional

The description of the placement of the origin of the SHS. This can be “center”, “lowerleft”, “upperleft”, “lowerright”, “upperright”. It is case insensitive. Default is “center”.

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.Face

The created face.

static Simplify(face, method='douglas-peucker', tolerance=0.0001, silent=False)

Simplifies the input wire edges based on the selected algorithm: Douglas-Peucker or Visvalingam–Whyatt.

Parameters
facetopologic_core.Face

The input face.

methodstr, optional

The simplification method to use: ‘douglas-peucker’ or ‘visvalingam-whyatt’ or ‘reumann-witkam’. The default is ‘douglas-peucker’.

tolerancefloat , optional

The desired tolerance. If using the douglas-peucker method, edge lengths shorter than this amount will be removed. If using the visvalingam-whyatt method, triangulare areas less than is amount will be removed. If using the Reumann-Witkam method, the tolerance specifies the maximum perpendicular distance allowed between any point and the current line segment; points falling within this distance are discarded. The default is 0.0001.

silentbool , optional

If set to True, error and warning messages are suppressed. Default is False.

Returns
topologic_core.Face

The simplified face.

static Skeleton(face, boundary: bool = True, tolerance: float = 0.001)

Creates a straight skeleton. This method is contributed by 高熙鹏 xipeng gao <gaoxipeng1998@gmail.com> This algorithm depends on the polyskel code which is included in the library. Polyskel code is found at: https://github.com/Botffy/polyskel

Parameters
facetopologic_core.Face

The input face.

boundarybool , optional

If set to True the original boundary is returned as part of the roof. Otherwise it is not. Default is True.

tolerancefloat , optional

The desired tolerance. Default is 0.001. (This is set to a larger number than the usual 0.0001 as it was found to work better)

Returns
topologic_core.Wire

The created straight skeleton.

static Square(origin=None, size: float = 1.0, direction: list = [0, 0, 1], placement: str = 'center', tolerance: float = 0.0001)

Creates a square.

Parameters
origintopologic_core.Vertex , optional

The location of the origin of the square. Default is None which results in the square being placed at (0, 0, 0).

sizefloat , optional

The size of the square. Default is 1.0.

directionlist , optional

The vector representing the up direction of the square. Default is [0, 0, 1].

placementstr , optional

The description of the placement of the origin of the square. This can be “center”, “lowerleft”, “upperleft”, “lowerright”, or “upperright”. It is case insensitive. Default is “center”.

tolerancefloat , optional

The desired tolerance. Default is 0.0001.

Returns
topologic_core.Face

The created square.

static Squircle(origin=None, radius: float = 0.5, sides: int = 121, a: float = 2.0, b: float = 2.0, direction: list = [0, 0, 1], placement: str = 'center', angTolerance: float = 0.1, tolerance: float = 0.0001)

Creates a Squircle which is a hybrid between a circle and a square. See https://en.wikipedia.org/wiki/Squircle

Parameters
origintopologic_core.Vertex , optional

The location of the origin of the squircle. Default is None which results in the squircle being placed at (0, 0, 0).

radiusfloat , optional

The desired radius of the squircle. Default is 0.5.

sidesint , optional

The desired number of sides of the squircle. Default is 121.

afloat , optional

The “a” factor affects the x position of the points to interpolate between a circle and a square. A value of 1 will create a circle. Higher values will create a more square-like shape. Default is 2.0.

bfloat , optional

The “b” factor affects the y position of the points to interpolate between a circle and a square. A value of 1 will create a circle. Higher values will create a more square-like shape. Default is 2.0.

directionlist , optional

The vector representing the up direction of the circle. Default is [0, 0, 1].

placementstr , optional

The description of the placement of the origin of the circle. This can be “center”, “lowerleft”, “upperleft”, “lowerright”, or “upperright”. It is case insensitive. Default is “center”.

angTolerancefloat , optional

The desired angular tolerance. Default is 0.1.

tolerancefloat , optional

The desired tolerance. Default is 0.0001.

Returns
topologic_core.Face

The created squircle.

static Star(origin=None, radiusA: float = 0.5, radiusB: float = 0.2, rays: int = 8, direction: list = [0, 0, 1], placement: str = 'center', tolerance: float = 0.0001)

Creates a star.

Parameters
origintopologic_core.Vertex, optional

The location of the origin of the star. Default is None which results in the star being placed at (0, 0, 0).

radiusAfloat , optional

The outer radius of the star. Default is 1.0.

radiusBfloat , optional

The outer radius of the star. Default is 0.4.

raysint , optional

The number of star rays. Default is 5.

directionlist , optional

The vector representing the up direction of the star. Default is [0, 0, 1].

placementstr , optional

The description of the placement of the origin of the star. This can be “center”, “lowerleft”, “upperleft”, “lowerright”, or “upperright”. It is case insensitive. Default is “center”.

tolerancefloat , optional

The desired tolerance. Default is 0.0001.

Returns
topologic_core.Face

The created face.

static TShape(origin=None, width=1, length=1, a=0.25, b=0.25, flipHorizontal=False, flipVertical=False, direction=[0, 0, 1], placement='center', tolerance=0.0001, silent=False)

Creates a T-shape.

Parameters
origintopologic_core.Vertex , optional

The location of the origin of the T-shape. Default is None which results in the T-shape being placed at (0, 0, 0).

widthfloat , optional

The overall width of the T-shape. Default is 1.0.

lengthfloat , optional

The overall length of the T-shape. Default is 1.0.

afloat , optional

The hortizontal thickness of the vertical arm of the T-shape. Default is 0.25.

bfloat , optional

The vertical thickness of the horizontal arm of the T-shape. Default is 0.25.

directionlist , optional

The vector representing the up direction of the T-shape. Default is [0, 0, 1].

placementstr , optional

The description of the placement of the origin of the T-shape. This can be “center”, “lowerleft”, “upperleft”, “lowerright”, “upperright”. It is case insensitive. Default is “center”.

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.Face

The created T-shape.

static ThirdVertex(face, tolerance: float = 0.0001, silent: bool = False)

Returns a third vertex on the input face to enable rotation matrix creation.

Parameters
facetopologic_core.Face

The input face.

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.Face

The created face.

static Trapezoid(origin=None, widthA: float = 1.0, widthB: float = 0.75, offsetA: float = 0.0, offsetB: float = 0.0, length: float = 1.0, direction: list = [0, 0, 1], placement: str = 'center', tolerance: float = 0.0001)

Creates a trapezoid.

Parameters
origintopologic_core.Vertex, optional

The location of the origin of the trapezoid. Default is None which results in the trapezoid being placed at (0, 0, 0).

widthAfloat , optional

The width of the bottom edge of the trapezoid. Default is 1.0.

widthBfloat , optional

The width of the top edge of the trapezoid. Default is 0.75.

offsetAfloat , optional

The offset of the bottom edge of the trapezoid. Default is 0.0.

offsetBfloat , optional

The offset of the top edge of the trapezoid. Default is 0.0.

lengthfloat , optional

The length of the trapezoid. Default is 1.0.

directionlist , optional

The vector representing the up direction of the trapezoid. Default is [0, 0, 1].

placementstr , optional

The description of the placement of the origin of the trapezoid. This can be “center”, or “lowerleft”. It is case insensitive. Default is “center”.

tolerancefloat , optional

The desired tolerance. Default is 0.0001.

Returns
topologic_core.Face

The created trapezoid.

static Triangulate(face, mode: int = 0, meshSize: float = None, mantissa: int = 6, tolerance: float = 0.0001, silent: bool = False) list

Triangulates the input face and returns a list of faces.

Parameters
facetopologic_core.Face

The input face.

modeint , optional

The desired mode of meshing algorithm. Several options are available: 0: Classic 1: MeshAdapt 3: Initial Mesh Only 5: Delaunay 6: Frontal-Delaunay 7: BAMG 8: Fontal-Delaunay for Quads 9: Packing of Parallelograms All options other than 0 (Classic) use the gmsh library. See https://gmsh.info/doc/texinfo/gmsh.html#Mesh-options WARNING: The options that use gmsh can be very time consuming and can create very heavy geometry.

meshSizefloat , optional

The desired size of the mesh when using the “mesh” option. If set to None, it will be calculated automatically and set to 10% of the overall size of the face. default is None.

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

The list of triangles of the input face.

static TrimByWire(face, wire, reverse: bool = False)

Trims the input face by the input wire.

Parameters
facetopologic_core.Face

The input face.

wiretopologic_core.Wire

The input wire.

reversebool , optional

If set to True, the effect of the trim will be reversed. Default is False.

Returns
topologic_core.Face

The resulting trimmed face.

static VertexByParameters(face, u: float = 0.5, v: float = 0.5)

Creates a vertex at the u and v parameters of the input face.

Parameters
facetopologic_core.Face

The input face.

ufloat , optional

The u parameter of the input face. Default is 0.5.

vfloat , optional

The v parameter of the input face. Default is 0.5.

Returns
vertextopologic vertex

The created vertex.

static VertexParameters(face, vertex, outputType: str = 'uv', mantissa: int = 6) list

Returns the u and v parameters of the input face at the location of the input vertex.

Parameters
facetopologic_core.Face

The input face.

vertextopologic_core.Vertex

The input vertex.

outputTypestring , optional

The string defining the desired output. This can be any subset or permutation of “uv”. It is case insensitive. Default is “uv”.

mantissaint , optional

The number of decimal places to round the result to. Default is 6.

Returns
list

The list of u and/or v as specified by the outputType input.

static Vertices(face) list

Returns the vertices of the input face.

Parameters
facetopologic_core.Face

The input face.

Returns
list

The list of vertices.

static Wire(face)

Returns the external boundary (closed wire) of the input face.

Parameters
facetopologic_core.Face

The input face.

Returns
topologic_core.Wire

The external boundary of the input face.

static Wires(face) list

Returns the wires of the input face.

Parameters
facetopologic_core.Face

The input face.

Returns
list

The list of wires.