muspan.objects#

The muspan.objects module provides structure for creating with objects in the MuSpAn package.

MuSpAn objects

class Point(domain, vertex)#

Bases: object

A class used to represent a Point in a given domain.

Parameters:
domainmuspan.domain

The domain the point will be added to.

vertexint

The vertex ID that defines the point.

Attributes:
object_IDint

Unique identifier for the point, assigned as domain’s max_ID + 1.

object_typestr

Type of the object, which is ‘point’.

object_dimensionint

Dimension of the object, which is 0 for a point.

in_collectionslist

List of collections that this point is part of.

verticeslist

List containing a single vertex that defines the point.

top_level_componentsdict

Dictionary containing the top-level components of the point.

parentslist

List of parent objects.

childrenlist

List of child objects.

centroidany

The centroid of the point, derived from the domain’s vertices.

zorderint

Z-order of the point, used for rendering purposes.

Methods

__init__(domain, vertex)

Initializes the Point with the given domain and vertex.

__str__()

Returns a string representation of the Point.

class Line(domain, vertices)#

Bases: object

A class used to represent a Line object.

Parameters:
domainmuspan.domain

The domain the line will be added to.

verticeslist

List of vertex IDs that form the line.

Attributes:
object_IDint

Unique identifier for the line object.

object_typestr

Type of the object, which is ‘line’.

object_dimensionint

Dimension of the object, which is 1.

in_collectionslist

List of collections the line belongs to.

verticeslist

List of vertices that form the line.

top_level_componentsdict

Dictionary containing top-level components of the line.

parentslist

List of parent objects.

childrenlist

List of child objects.

lengthfloat

Length of the line.

centroidnumpy.ndarray

Coordinates of the centroid of the line.

zorderint

Z-order for rendering the line.

Methods

__init__(domain, vertices)

Initializes the Line object with given point cloud and vertices.

__str__()

Returns a string representation of the Line object.

class Shape(domain, vertices, internal_vertices=[])#

Bases: object

A class used to represent a 2D Shape within a given domain.

Parameters:
domainmuspan.domain

The domain the shape will be added to.

verticeslist

List of indices of external boundary vertices.

internal_verticeslist, optional

List of lists of indices of internal boundary vertices. Default is an empty list.

Attributes:
object_IDint

Unique identifier for the shape within the domain.

object_typestr

Type of the object, always ‘shape’ for this class.

object_dimensionint

Dimension of the object, always 2 for this class.

in_collectionslist

List of collections this shape is part of.

verticeslist

List of indices of external boundary vertices.

internal_verticeslist

List of lists of indices of internal boundary vertices.

top_level_componentsdict

Dictionary containing top-level components of the shape.

parentslist

List of parent objects.

childrenlist

List of child objects.

bounded_areafloat

Area bounded by the external boundary.

areafloat

Actual area of the shape, accounting for internal boundaries.

centroidnumpy.ndarray

Coordinates of the centroid of the shape.

bounding_spheresdict

Dictionary containing information about the bounding spheres.

minimum_enclosed_sphere_radiusfloat

Radius of the minimum enclosed sphere.

zorderint

Z-order for rendering the shape.

Methods

__init__(domain, vertices, internal_vertices=[])

Initializes the Shape object with the given domain, vertices, and internal vertices.

__str__()

Returns a string representation of the Shape object.