pylib.geometry module

2D geometry objects.

Date

2019-12-21

class CS(x=[1, 0, 0], y=[0, 1, 0], z=[0, 0, 1])[source]

Bases: mathematics.matrix

Coordinate system

get_coordinates()[source]

Get coordinates in 3d space

static x90()[source]
static xm90()[source]
static y90()[source]
static ym90()[source]
class Circle(radius=1, n=10)[source]

Bases: pylib.geometry.Polygon

Circle a closed wireframe object in local coordinate system

class Direction(x=1, y=0, z=0)[source]

Bases: mathematics.vector

Direction in local coordinate system

class Line(point1=vector([-1, 0, 0]), point2=vector([1, 0, 0]))[source]

Bases: pylib.geometry.Wireframe

Line a open wireframe object in local coordinate system

class Point(x=0, y=0, z=0)[source]

Bases: mathematics.vector

Point in local coordinate system

class Polygon(*points)[source]

Bases: pylib.geometry.Wireframe

Polygon as closed wireframe object in local coordinate system

class Wireframe(*points, closed=False)[source]

Bases: object

Open and closed wireframe object in local coordinate system

This class create its own points (copy).

ch_cs(cs)[source]
points()[source]

Get coordinates in 3d space

rotate_x(theta)[source]
rotate_y(theta)[source]
rotate_z(theta)[source]
scale(sx, sy=None, sz=None)[source]
translate(tx, ty, tz)[source]
xyz()[source]
class World[source]

Bases: object

World-space with world-space coordinates

add(*objects)[source]
bounding_box()[source]
center()[source]
ch_cs(cs)[source]
cs(cs=None)[source]
objects()[source]
rotate_x(theta)[source]
rotate_y(theta)[source]
rotate_z(theta)[source]
scale(sx, sy=None, sz=None)[source]
space_diagonal()[source]
translate(tx, ty, tz)[source]