Contents
On this page
Geometry module.
triellipt.geom.line(startpoint, endpoint)
Creates a line between two points.
Parameters
startpoint : complex
endpoint : complex
Returns
Line
triellipt.geom.hyperb(axes, ksis, etas)
Creates a hyperbolic curve.
Parameters
axes : (float, float)
(a, b).
ksis : (float, float)
ksi parameter (in [-1, 1]).
etas : (float, float)
eta parameter (≥0).
Returns
Hyperb
triellipt.geom.elliparc(center, axes, phis, tilt=0)
Creates an elliptic arc.
Parameters
center : (float, float)
axes : (float, float)
phis : (float, float)
tilt : float = 0
Returns
EllipArc
triellipt.geom.bezier2(point0, point1, point2)
Creates a quadratic Bezier curve.
Parameters
point0 : complex
point1 : complex
point2 : complex
Returns
Bezier2
triellipt.geom.bezier3(point0, point1, point2, point3)
Creates a cubic Bezier curve.
Parameters
point0 : complex
point1 : complex
point2 : complex
point3 : complex
Returns
Bezier3
triellipt.geom.makeloop(*curves)
Creates a loop of connected curves.
Parameters
curves : *one-of-the-curves
Returns
CurvesLoop
triellipt.geom.makerect(corner, dims)
Creates a rectangle as a loop.
Parameters
corner : (float, float)
dims : (float, float)
Returns
CurvesLoop
triellipt.geom.makeellip(center, axes, tilt=0)
Creates a closed ellipse as a loop.
Parameters
center : (float, float)
axes : (float, float)
tilt : float = 0
Returns
CurvesLoop
triellipt.geom.makecycle(path)
Creates a cyclic path.
Parameters
path : flat-complex-array
Returns
CycPath
class triellipt.geom.Curve()
Base class for parametric curves on [0, 1].
Curve.getpath(self, *args)
Picks points on the curve.
Parameters
args : *float
Returns
flat-complex-array
Curve.linspace(self, nparts)
Splits the curve uniformly in the parameter space.
Parameters
nparts : int
Returns
flat-complex-array
Curve.partition(self, nparts, ratio=1)
Splits the curve into segments based on length.
Parameters
nparts : int
ratio : float = 1
Returns
flat-complex-array
Curve.length(self, *, places=4, maxitr=10)
Estimates the curve length iteratively.
Parameters
places : int = 4
maxitr : int = 10
Returns
float
class triellipt.geom.CurvesLoop(curves=None)
Loop of connected curves.
Attributes
curves : tuple
Properties
| Name | Description |
|---|---|
startpoints |
Curves start points. |
endpoints |
Curves end points. |
CurvesLoop.discretize(self, *params)
Discretizes the curves loop.
Parameters
params : *(nparts, ratio)
Curve().partition()
Returns
PathsMap
class triellipt.geom.PathMap(nodes=None)
Polygonal path with colored nodes.
Properties
| Name | Description |
|---|---|
colors |
Nodes colors. |
numbers |
Nodes numbers. |
points |
Nodes positions (complex). |
points2d |
Nodes positions (xy-rows). |
PathMap.togeo(self, geopath, seeds) → None
Dumps path to the geo file.
Parameters
geopath : str
.geo file.
seeds : dict
PathMap.atcolors(self, *colors)
Fetches a subpath with the specified colors.
Parameters
colors : *int
Returns
PathMap
PathMap.repaint(self, color, newcolor)
Changes the specified color to the new one.
PathMap.rshift(self, color1, color2)
Shifts the contact of two colors to the right by one node.
PathMap.lshift(self, color1, color2)
Shifts the contact of two colors to the left by one node.
class triellipt.geom.CycPath(nodes=None)
Cyclic polygonal path.
Properties
| Name | Description |
|---|---|
points |
Nodes positions. |
numbers |
Nodes numbers. |
CycPath.angles(self)
Provides rotation angles of edges.
Returns
flat-float-array
CycPath.dissect(self, angle)
Splits the cycle based on rotation angle.
Parameters
angle : float
Returns
PathMap
Copyright © 2023, Igor Semenov.