2D Geometric Shapes

py_fort_myrmidon.Shape

class py_fort_myrmidon.Shape

A Generic class for a Shape

property ShapeType

the type of the shape

Type:

(py_fort_myrmidon.Shape.Type)

class Type

Enum for the type of a Shape

Members:

CIRCLE : int: a circle

CAPSULE : int: a capsule

POLYGON : int: a polygon

property name

py_fort_myrmidon.Circle

class py_fort_myrmidon.Circle

Represents a circle

property Center

the center of the circle (float64, size [2,1])

Type:

numpy.ndarray

property Radius

the radius of the circle

Type:

float

py_fort_myrmidon.Capsule

class py_fort_myrmidon.Capsule

Represents a capsule

A capsule is the region inside and between two given circles.

property C1

the center of the first circle (float64, size [2,1])

Type:

numpy.ndarray

property C2

the center of the second circle (float64, size [2,1])

Type:

numpy.ndarray

property R1

the radius of the first circle

Type:

float

property R2

the radius of the second circle

Type:

float

py_fort_myrmidon.Polygon

class py_fort_myrmidon.Polygon

Represents a closed polygon.

Represents a closed polygon from a list of vertices. The polygon is always considered closed. i.e. [[1,1],[-1,1],[-1,-1],[1,-1]] is a closed square.

Note

Order matters as [[1,1],[-1,-1],[1,-1],[-1,1]] represents an hourglass.

Example

square = py_fort_myrmidon.Polygon(Vertices = [[1,1],[-1,1],[-1,-1],[1,-1]])
hourglass = py_fort_myrmidon.Polygon(Vertices = [[1,1],[-1,-1],[1,-1],[-1,1]])
property Vertices

a list of the polygon vertices (float64 , size [2,1])

Type:

List[numpy.ndarray]