topologicpy.Core module

class topologicpy.Core.Core

Bases: object

Thin facade over the active topology kernel backend.

The default backend is TopologicCoreBackend. Use Core.SetBackend to replace it with another backend object that exposes the same namespace shape.

Methods

Backend()

Returns the active backend.

Call(namespace, attribute, *args, **kwargs)

Dynamically calls a method or callable attribute on a backend namespace.

HasAttribute(namespace, attribute)

Returns True if the active backend namespace exposes the requested attribute.

HasNamespace(name)

Returns True if the active backend exposes the requested namespace.

InstanceAttribute(obj, attributeName)

Returns an instance attribute from a backend-native object.

InstanceCall(obj, methodName, *args, **kwargs)

Calls an instance method on a backend-native object.

Namespace(name)

Returns a backend namespace by name.

Namespaces()

Returns the public namespace names exposed by the active backend.

RawModule()

Returns the raw module of the active backend if available.

ResetBackend()

Resets the active backend to a new TopologicCoreBackend instance.

SetBackend(backend)

Sets the active Core backend.

Aperture

Cell

CellComplex

CellComplexUtility

CellUtility

Cluster

ClusterUtility

Context

Dictionary

DoubleAttribute

Edge

EdgeUtility

Face

FaceUtility

Graph

GraphUtility

IntAttribute

ListAttribute

Shell

ShellUtility

StringAttribute

Topology

TopologyUtility

Vertex

VertexUtility

Wire

WireUtility

Aperture = <Core namespace proxy: Aperture>
static Backend() Any

Returns the active backend. If none has been set, creates the default TopologicCoreBackend.

static Call(namespace: str, attribute: str, *args, **kwargs) Any

Dynamically calls a method or callable attribute on a backend namespace.

Cell = <Core namespace proxy: Cell>
CellComplex = <Core namespace proxy: CellComplex>
CellComplexUtility = <Core namespace proxy: CellComplexUtility>
CellUtility = <Core namespace proxy: CellUtility>
Cluster = <Core namespace proxy: Cluster>
ClusterUtility = <Core namespace proxy: ClusterUtility>
Context = <Core namespace proxy: Context>
Dictionary = <Core namespace proxy: Dictionary>
DoubleAttribute = <Core namespace proxy: DoubleAttribute>
Edge = <Core namespace proxy: Edge>
EdgeUtility = <Core namespace proxy: EdgeUtility>
Face = <Core namespace proxy: Face>
FaceUtility = <Core namespace proxy: FaceUtility>
Graph = <Core namespace proxy: Graph>
GraphUtility = <Core namespace proxy: GraphUtility>
static HasAttribute(namespace: str, attribute: str) bool

Returns True if the active backend namespace exposes the requested attribute.

static HasNamespace(name: str) bool

Returns True if the active backend exposes the requested namespace.

static InstanceAttribute(obj, attributeName: str)

Returns an instance attribute from a backend-native object.

static InstanceCall(obj, methodName: str, *args, **kwargs)

Calls an instance method on a backend-native object.

IntAttribute = <Core namespace proxy: IntAttribute>
ListAttribute = <Core namespace proxy: ListAttribute>
static Namespace(name: str) Any

Returns a backend namespace by name.

static Namespaces() List[str]

Returns the public namespace names exposed by the active backend.

static RawModule() Any

Returns the raw module of the active backend if available.

static ResetBackend() Any

Resets the active backend to a new TopologicCoreBackend instance.

static SetBackend(backend: Any) Any

Sets the active Core backend.

Parameters
backendobject

A backend object exposing topologic_core-like namespaces such as Vertex, Edge, Wire, Face, TopologyUtility, etc.

Returns
object

The backend that was set.

Shell = <Core namespace proxy: Shell>
ShellUtility = <Core namespace proxy: ShellUtility>
StringAttribute = <Core namespace proxy: StringAttribute>
Topology = <Core namespace proxy: Topology>
TopologyUtility = <Core namespace proxy: TopologyUtility>
Vertex = <Core namespace proxy: Vertex>
VertexUtility = <Core namespace proxy: VertexUtility>
Wire = <Core namespace proxy: Wire>
WireUtility = <Core namespace proxy: WireUtility>
class topologicpy.Core.TopologicCoreBackend

Bases: object

Default backend that exposes the topologic_core namespaces directly.

This class deliberately mirrors topologic_core as closely as possible. Any missing namespaces are set to None so that Core can fail gracefully with a clear message when accessed.

Methods

Namespaces()

Returns the public namespace names exposed by this backend.

RawModule()

Returns the raw imported topologic_core module.

Namespaces() List[str]

Returns the public namespace names exposed by this backend.

RawModule() Any

Returns the raw imported topologic_core module.