diff --git a/docs/build/html/_images/class_diagram.svg b/docs/build/html/_images/class_diagram.svg
new file mode 100644
index 0000000..59afc29
--- /dev/null
+++ b/docs/build/html/_images/class_diagram.svg
@@ -0,0 +1,267 @@
+
\ No newline at end of file
diff --git a/docs/build/html/_modules/pylib/data.html b/docs/build/html/_modules/pylib/data.html
index 7b9a972..af51f1f 100644
--- a/docs/build/html/_modules/pylib/data.html
+++ b/docs/build/html/_modules/pylib/data.html
@@ -344,6 +344,26 @@
except:return''
+
[docs]defstrs_between(text,left,right):
+ """Get text between two pattern.
+
+ Text can be multi-line.
+
+ :param text: text to search in
+ :type text: str
+ :param left: left pattern
+ :type left: str
+ :param right: right pattern
+ :type right: str
+
+ :returns: text between the left and right pattern
+ :rtype: str
+ """
+ try:
+ returnre.findall(left+'(.+?)'+right,text,re.DOTALL)
+ except:
+ return''
+
[docs]defstr_to_list(string,delimiter=';\n',newline_replacement=''):r"""Converts a string with block information into a list.
diff --git a/docs/build/html/_modules/pylib/data_step_std.html b/docs/build/html/_modules/pylib/data_step_std.html
index 8aa8d8c..ffb1af3 100644
--- a/docs/build/html/_modules/pylib/data_step_std.html
+++ b/docs/build/html/_modules/pylib/data_step_std.html
@@ -35,6 +35,7 @@
Source code for pylib.data_step_std
#!/usr/bin/env python# -*- coding: utf-8 -*-
+# pylint: disable=invalid-name,too-few-public-methods"""STEP Standard structure.:Date: 2020-01-03
@@ -85,26 +86,135 @@
# parentheses, separated by comma ",":# STEP Standard TYPE LIST: first index is 1.# STEP Standard TYPE ARRAY: first index is 0.
+fromenumimportEnum
-
[docs]defBOOLEAN_to_bool(boolean):
- ifboolean==".T.":
+#
+# EXPRESS simple data types
+# TODO: BINARY, NUMBER
+#
+
+
[docs]classSTRING(str):
+ """EXPRESS Type STRING
+
+ This is the most often used simple type. EXPRESS strings can be
+ of any length and can contain any character (ISO 10646/Unicode).
+ """
+
+
[docs]classINTEGER(int):
+ """EXPRESS Type INTEGER
+
+ EXPRESS integers can have in principle any length, but most
+ implementations restricted them to a signed 32 bit value.
+ """
+
+
[docs]classREAL(float):
+ """EXPRESS Type REAL
+
+ Ideally an EXPRESS real value is unlimited in accuracy and size.
+ But in practice a real value is represented by a floating point
+ value of type double.
+ """
+
+
[docs]defBOOLEAN(value):
+ """EXPRESS Type BOOLEAN with values TRUE and FALSE
+
+ :param value: either ``.T.`` for a True value or ``.F.`` for a
+ False value
+ :type value: str
+ :raises: TypeError
+ """
+ ifvalue==".T.":returnTrue
- elifboolean==".F.":
+ ifvalue==".F.":returnFalse
- returnboolean
+ raiseValueError
+
+
[docs]defLOGICAL(value):
+ """EXPRESS Type LOGICAL with values TRUE and FALSE and in addition
+ UNKNOWN
+
+ :param value: either ``.T.`` for a True value or ``.F.`` for a
+ False value
+ :type value: str
+ """
+ # TODO: how does the UNKNOWN value look like?
+ ifvalue==".T.":
+ returnTrue
+ ifvalue==".F.":
+ returnFalse
+ returnNone
+
+#
+# EXPRESS aggregation data types
+# BAG unordered -> ?
+# TODO: find a data type for BAG?
+# TODO: test if BAG have unset members?
+#
+
+
[docs]classSET(set):
+ """EXPRESS Type SET
+
+ SET are unordered. Contain a particular value more than once, is
+ not allowed. It is not possible to contain unset members.
+
+ :param value: value
+ :type value: str
+ :param dtype:
+ :type dtype:
+
+ :rtype: set
+ """
+ # TODO: test for unset members?
+
+
[docs]classLIST(tuple):
+ """EXPRESS Type LIST
+
+ LIST are ordered. It is not possible to contain unset members.
+
+ :param value: value
+ :type value: str
+ :param dtype:
+ :type dtype:
+
+ :rtype: tuple
+ """
+ # TODO: test for unset members?
+
+
[docs]classARRAY(tuple):
+ """EXPRESS Type ARRAY
+
+ ARRAY are ordered. An ARRAY is the only aggregate that may
+ contain unset members.
+
+ :param value: value
+ :type value: str
+ :param dtype:
+ :type dtype:
+
+ :rtype: tuple
+ """
+
+
+#
+# STEP functions
+#
[docs]defdimension_of(item):"""STEP Standard FUNCTION dimension_of
- :param item: STEP Standard TYPE GEOMETRIC_REPRESENTATION_ITEM
+ :param item: :type item: GEOMETRIC_REPRESENTATION_ITEM :returns: dim
- :rtype: int or None
+ :rtype: Union[int, None]
- :ivar dim: STEP Standard TYPE dimension_count (INTEGER).
+ :var dim: dimension_count dimension_count > 0
- :vartype dim: int
+ :vartype dim: INTEGER .. seealso:: https://www.steptools.com/stds/stp_aim/html/t_dimension_of.html
@@ -170,19 +280,19 @@
"""STEP Standard FUNCTION list_to_array :param lis: STEP Standard TYPE LIST [0:?] OF GENERIC
- :type lis: tuple
- :param low: STEP Standard TYPE INTEGER
- :type low: int
- :param u: STEP Standard TYPE INTEGER
- :type u: int
+ :type lis: tuple[GENERIC, ...]
+ :param low:
+ :type low: INTEGER
+ :param u:
+ :type u: INTEGER :returns: res
- :rtype: tuple or None
+ :rtype: Union[tuple, None]
- :param n: STEP Standard TYPE INTEGER
- :type n: int
- :ivar res: STEP Standard TYPE ARRAY [low:u] OF GENERIC
- :vartype res: tuple
+ :var n:
+ :vartype n: INTEGER
+ :var res: STEP Standard TYPE ARRAY [low:u] OF GENERIC
+ :vartype res: tuple[GENERIC, ...] .. seealso:: https://www.steptools.com/stds/stp_aim/html/t_list_to_array.html
@@ -226,12 +336,12 @@
[docs]defboolean_choose(b,choice1,choice2):"""STEP Standard FUNCTION boolean_choose
- :param b: STEP Standard TYPE BOOLEAN
- :type b: bool
- :param choice1: STEP Standard TYPE GENERIC
- :type choice1: object
- :param choice2: STEP Standard TYPE GENERIC
- :type choice2: object
+ :param b:
+ :type b: BOOLEAN
+ :param choice1:
+ :type choice1: GENERIC
+ :param choice2:
+ :type choice2: GENERIC :returns: STEP STEP Standard TYPE GENERIC :rtype: object
@@ -258,14 +368,14 @@
Check if the path is a connected curve set.
- :param a_path: STEP Standard TYPE path
+ :param a_path: :type a_path: PATH :returns: p
- :rtype: object
+ :rtype: LOGICAL
- :ivar p: STEP STEP Standard TYPE LOGICAL
- :vartype item: bool
+ :var p:
+ :vartype item: LOGICAL .. seealso:: https://www.steptools.com/stds/stp_aim/html/t_path_head_to_tail.html
@@ -294,19 +404,83 @@
returnp
-
[docs]classREPRESENTATION_ITEM():
+# STEP Standard Type Enumeration
+# Enumeration values are simple strings such as red, green, and blue
+# for an rgb-enumeration. In the case that an enumeration type is
+# declared extensible it can be extended in other schemas.
+
+# Python note: Starting with 1 because 0 is False in a boolean sense
+
+
[docs]classVERTEX_POINT(VERTEX):"""STEP Standard ENTITY vertex_point Explicit Attributes
- :param name: STEP Standard TYPE label (STRING)
- :type name: str
+ :param name: label
+ :type name: STRING :param vertex_geometry: point :type vertex_geometry: POINT Derived Attributes
- :param dim: STEP Standard TYPE dimension_count (INTEGER)
- :type dim: int
+ :ivar dim: dimension_count
+ :vartype dim: INTEGER .. seealso:: https://www.steptools.com/stds/stp_aim/html/t_vertex_point.html
@@ -442,15 +610,15 @@
Explicit Attributes
- :param name: STEP Standard TYPE label (STRING)
- :type name: str
+ :param name: label
+ :type name: STRING :param direction_ratios: STEP Standard LIST OF REAL
- :type direction_ratios: tuple
+ :type direction_ratios: LIST[REAL, ...] Derived Attributes
- :param dim: STEP Standard TYPE dimension_count (INTEGER)
- :type dim: int
+ :ivar dim: dimension_count
+ :vartype dim: INTEGER .. seealso:: https://www.steptools.com/stds/stp_aim/html/t_direction.html
@@ -464,17 +632,17 @@
Explicit Attributes
- :param name: STEP Standard TYPE label (STRING)
- :type name: str
+ :param name: label
+ :type name: STRING :param orientation: :type orientation: DIRECTION :param magnitude: length_measure
- :type magnitude: float
+ :type magnitude: REAL Derived Attributes
- :param dim: STEP Standard TYPE dimension_count (INTEGER)
- :type dim: int
+ :ivar dim: dimension_count
+ :vartype dim: INTEGER .. seealso:: https://www.steptools.com/stds/stp_aim/html/t_vector.html
@@ -489,8 +657,8 @@
Explicit Attributes
- :param name: STEP Standard TYPE label (STRING)
- :type name: str
+ :param name: label
+ :type name: STRING :param edge_start: start point :type edge_start: VERTEX :param edge_end: end point
@@ -509,27 +677,25 @@
Explicit Attributes
- :param name: STEP Standard TYPE label (STRING)
- :type name: str
+ :param name: label
+ :type name: STRING Derived Attributes
- :param dim: STEP Standard TYPE dimension_count (INTEGER)
- :type dim: int
+ :ivar dim: dimension_count
+ :vartype dim: INTEGER .. seealso:: https://www.steptools.com/stds/stp_aim/html/t_curve.html
- """
- def__init__(self,name):
- super().__init__(name)
+ """
[docs]classLINE(CURVE):"""STEP Standard ENTITY line Explicit Attributes
- :param name: STEP Standard TYPE label (STRING)
- :type name: str
+ :param name: label
+ :type name: STRING :param pnt: :type pnt: CARTESIAN_POINT :param dir:
@@ -537,8 +703,8 @@
Derived Attributes
- :param dim: STEP Standard TYPE dimension_count (INTEGER)
- :type dim: int
+ :ivar dim: dimension_count
+ :vartype dim: INTEGER .. seealso:: https://www.steptools.com/stds/stp_aim/html/t_line.html
@@ -553,25 +719,27 @@
Explicit Attributes
- :param name: STEP Standard TYPE label (STRING)
- :type name: str
+ :param name: label
+ :type name: STRING :param curve_3d: :type curve_3d: CURVE
- :param associated_geometry:
- :type associated_geometry: list of pcurve_or_surface
- :param master_representation:
- :type master_representation: preferred_surface_curve_representation
+ :param associated_geometry: STEP Standard TYPE LIST OF
+ pcurve_or_surface (SELECT) <<TODO>>
+ :type associated_geometry: LIST[Union[PCURVE, SURFACE], ...]
+ :param master_representation: <<TODO>>
+ :type master_representation: PREFERRED_SURFACE_CURVE_REPRESENTATION Derived Attributes
- :param dim: STEP Standard TYPE dimension_count (INTEGER)
- :type dim: int
- :param basis_surface:
- :type basis_surface: SET OF surface
+ :ivar dim: dimension_count
+ :vartype dim: INTEGER
+ :ivar basis_surface: <<TODO>>
+ :vartype basis_surface: SET[SURFACE, ...] .. seealso:: https://www.steptools.com/stds/stp_aim/html/t_surface_curve.html """
+ # TODO: type associated_geometry master_representation basis_surfacedef__init__(self,name,curve_3d,associated_geometry,master_representation):self.curve_3d=curve_3dself.associated_geometry=associated_geometry
@@ -583,53 +751,63 @@
Explicit Attributes
- :param name: STEP Standard TYPE label (STRING)
- :type name: str
+ :param name: label
+ :type name: STRING :param curve_3d: :type curve_3d: CURVE
- :param associated_geometry:
- :type associated_geometry: list of pcurve_or_surface
- :param master_representation:
- :type master_representation: preferred_surface_curve_representation
+ :param associated_geometry: STEP Standard TYPE LIST OF
+ pcurve_or_surface (SELECT) <<TODO>>
+ :type associated_geometry: LIST[Union[PCURVE, SURFACE], ...]
+ :param master_representation: <<TODO>>
+ :type master_representation: PREFERRED_SURFACE_CURVE_REPRESENTATION Derived Attributes
- :param dim: STEP Standard TYPE dimension_count (INTEGER)
- :type dim: int
- :param basis_surface:
- :type basis_surface: SET OF surface
+ :ivar dim: dimension_count
+ :vartype dim: INTEGER
+ :ivar basis_surface: <<TODO>>
+ :vartype basis_surface: SET[SURFACE, ...] .. seealso:: https://www.steptools.com/stds/stp_aim/html/t_seam_curve.html
- """
- def__init__(self,name,curve_3d,associated_geometry,master_representation):
- super().__init__(name,curve_3d,associated_geometry,master_representation)
+ """
[docs]classEDGE_CURVE(EDGE):"""STEP Standard ENTITY edge_curve Explicit Attributes
- :param name: STEP Standard TYPE label (STRING)
- :type name: str
+ :param name: label
+ :type name: STRING :param edge_start: start point :type edge_start: VERTEX :param edge_end: end point :type edge_end: VERTEX :param edge_geometry: curve :type edge_geometry: CURVE
- :param same_sense: STEP Standard TYPE BOOLEAN
- :type same_sense: str
+ :param same_sense: <<TODO>>
+ :type same_sense: BOOLEAN Derived Attributes
- :param dim: STEP Standard TYPE dimension_count (INTEGER)
- :type dim: int
+ :ivar dim: dimension_count
+ :vartype dim: INTEGER
- Definition from ISO/CD 10303-42:1992: An edge curve is a special subtype of edge which has its geometry fully defined. The geometry is defined by associating the edge with a curve which may be unbounded. As the topological and geometric directions may be opposed, an indicator (same sense) is used to identify whether the edge and curve directions agree or are opposed. The Boolean value indicates whether the curve direction agrees with (TRUE) or is in the opposite direction (FALSE) to the edge direction. Any geometry associated with the vertices of the edge shall be consistent with the edge geometry.
+ Definition from ISO/CD 10303-42:1992: An edge curve is a special
+ subtype of edge which has its geometry fully defined. The
+ geometry is defined by associating the edge with a curve which
+ may be unbounded. As the topological and geometric directions may
+ be opposed, an indicator (same sense) is used to identify whether
+ the edge and curve directions agree or are opposed. The Boolean
+ value indicates whether the curve direction agrees with (TRUE) or
+ is in the opposite direction (FALSE) to the edge direction. Any
+ geometry associated with the vertices of the edge shall be
+ consistent with the edge geometry. Informal propositions
- 1. The domain of the edge curve is formally defined to be the domain of its edge geometry as trimmed by the vertices. This domain does not include the vertices.
+ 1. The domain of the edge curve is formally defined to be the
+ domain of its edge geometry as trimmed by the vertices. This
+ domain does not include the vertices. 2. An edge curve has non-zero finite extent. 3. An edge curve is a manifold. 4. An edge curve is arcwise connected.
@@ -639,9 +817,16 @@
Attribute definitions EdgeGeometry
- The curve which defines the shape and spatial location of the edge. This curve may be unbounded and is implicitly trimmed by the vertices of the edge; this defines the edge domain. Multiple edges can reference the same curve.
+ The curve which defines the shape and spatial location of the
+ edge. This curve may be unbounded and is implicitly trimmed
+ by the vertices of the edge; this defines the edge domain.
+ Multiple edges can reference the same curve. SameSense
- This logical flag indicates whether (TRUE), or not (FALSE) the senses of the edge and the curve defining the edge geometry are the same. The sense of an edge is from the edge start vertex to the edge end vertex; the sense of a curve is in the direction of increasing parameter.
+ This logical flag indicates whether (TRUE), or not (FALSE)
+ the senses of the edge and the curve defining the edge
+ geometry are the same. The sense of an edge is from the edge
+ start vertex to the edge end vertex; the sense of a curve is
+ in the direction of increasing parameter. .. seealso:: https://www.steptools.com/stds/stp_aim/html/t_edge_curve.html
@@ -649,7 +834,7 @@
"""def__init__(self,name,edge_start,edge_end,edge_geometry,same_sense):self.edge_geometry=edge_geometry
- self.same_sense=BOOLEAN_to_bool(same_sense)
+ self.same_sense=BOOLEAN(same_sense)super().__init__(name,edge_start,edge_end)
[docs]classPATH(TOPOLOGICAL_REPRESENTATION_ITEM):"""STEP Standard ENTITY path Explicit Attributes
- :param name: STEP Standard TYPE label (STRING)
- :type name: str
- :param edge_list: STEP Standard TYPE LIST OF oriented_edge (ENTITY)
- :type edge_list: tuple
+ :param name: label
+ :type name: STRING
+ :param edge_list:
+ :type edge_list: LIST[ORIENTED_EDGE, ...] .. seealso:: https://www.steptools.com/stds/stp_aim/html/t_path.html
@@ -1008,18 +1178,17 @@
self.edge_list=edge_listsuper().__init__(name)ifnotpath_head_to_tail(self):
- self=None
- print('no path')
+ raiseValueError(edge_list+'is not a path')
[docs]classEDGE_LOOP(PATH,LOOP):"""STEP Standard ENTITY edge_loop Explicit Attributes
- :param name: STEP Standard TYPE label (STRING)
- :type name: str
- :param edge_list: STEP Standard TYPE LIST OF oriented_edge (ENTITY)
- :type edge_list: tuple
+ :param name: label
+ :type name: STRING
+ :param edge_list:
+ :type edge_list: LIST[ORIENTED_EDGE, ...] .. seealso:: https://www.steptools.com/stds/stp_aim/html/t_edge_loop.html
@@ -1030,8 +1199,7 @@
self.ne=len(self.edge_list)ifself.edge_list[0].edge_start!=self.edge_list[self.ne-1].edge_end:
- self=None
- print('no edge_loop')
+ raiseValueError(edge_list+'is not a loop')
diff --git a/docs/build/html/_modules/pylib/function.html b/docs/build/html/_modules/pylib/function.html
index 59bcbe4..764dd50 100644
--- a/docs/build/html/_modules/pylib/function.html
+++ b/docs/build/html/_modules/pylib/function.html
@@ -159,10 +159,10 @@
[docs]defcosine_wave(A=1,k=1,f=1,phi=0,D=0,degree=False):r"""A cosine wave is said to be sinusoidal, because,
- :math:`\cos(x) = \sin(x + \pi/2)`, which is also a sine wave with a
- phase-shift of π/2 radians. Because of this head start, it is often
- said that the cosine function leads the sine function or the sine
- lags the cosine.
+ :math:`\cos(x) = \sin(x + \pi/2)`, which is also a sine wave with
+ a phase-shift of π/2 radians. Because of this head start, it is
+ often said that the cosine function leads the sine function or
+ the sine lags the cosine. :param A: amplitude :type A: float or int
@@ -195,22 +195,25 @@
[docs]defb_spline_basis(knots,knot_span,degree):r"""Cox-de Boor algorithm / recursion formula.
- Calculate the i-th B-spline basis function of degree p: N_{i,p}(u)
+ Calculate the i-th B-spline basis function of degree p:
+ :math:`N_{i,p}(u)` :param knots: Knot vector U. m + 1 non-decreasing numbers / knots,
- :math:`u_0 <= u_1 <= u_2 <= ... <= u_m`
+ :math:`u_0 \le u_1 \le u_2 \le \dots \le u_m` :type knots: list :param knot_span: i-th knot span :type knot_span: int :param degree: degree of B-spline basis function :type degree: int
- :returns: B-spline basis function using variable, u \in [u_0, u_m]
+ :returns: B-spline basis function using variable,
+ :math:`u \in [u_0, u_m]` :rtype: function .. math::
- N_{i,0}(u) &= \begin{cases} 1 & \text{if } u_i \le u \lt u_{i+1} \\
- 0 & \text{otherwise}\end{cases} \\
+ N_{i,0}(u) &= \begin{cases}
+ 1 & \text{if } u_i \le u \lt u_{i+1} \\
+ 0 & \text{otherwise}\end{cases} \\ N_{i,p}(u) &= \frac{u - u_i}{u_{i+p} - u_i} N_{i,p-1}(u) + \frac{u_{i+p+1} - u}{u_{i+p+1} - u_{i+1}} N_{i+1,p-1}(u)
@@ -277,10 +280,10 @@
:param control_points: control points P, n + 1 control points :type control_points: list :param knots: Knot vector U. m + 1 non-decreasing numbers / knots,
- :math:`u_0 <= u_1 <= u_2 <= ... <= u_m`
+ :math:`u_0 \le u_1 \le u_2 \le \dots \le u_m` :type knots: list
- :returns: B-spline curve using variable, u \in [u_0, u_m]
+ :returns: B-spline curve using variable, :math:`u \in [u_0, u_m]` :rtype: function .. math::
@@ -291,10 +294,11 @@
* the curve will not touch the first and last legs of the control polyline * the knot vector does not have any particular structure
- * for degree p, intervals [u_0, u_p) and [u_{n-p}, u_n) will not
- have "full support" of basis functions and are ignored when a
- B-spline curve is open. For open B-spline curves, the domain
- is inteval [u_p, u_{n-p}]
+ * for degree p, intervals :math:`[u_0, u_p)` and
+ :math:`[u_{n-p}, u_n)` will not have "full support" of basis
+ functions and are ignored when a B-spline curve is open. For
+ open B-spline curves, the domain is inteval
+ :math:`[u_p, u_{n-p}]` * clamped B-spline curves, nonperiodic B-spline curves
@@ -307,7 +311,7 @@
* the start and the end of the generated curve join together forming a closed loop
- * repeating some knots and control points # TODO: which?
+ * repeating some knots and control points (TODO: which?) * uniform B-spline curves
@@ -448,9 +452,9 @@
* * * * *
- >>> x, y = hyotrochoid(20, 6, 6)[:2]
- >>> x, y, _ = hyotrochoid(20, 6, 6)
- >>> x, y, interval = hyotrochoid(20, 6, 6)
+ >>> x, y = hypotrochoid(20, 6, 6)[:2]
+ >>> x, y, _ = hypotrochoid(20, 6, 6)
+ >>> x, y, interval = hypotrochoid(20, 6, 6) .. seealso:: :meth:`pylib.mathematics.lcm`
diff --git a/docs/build/html/_modules/pylib/geometry2d.html b/docs/build/html/_modules/pylib/geometry2d.html
index 7324af0..01c1c83 100644
--- a/docs/build/html/_modules/pylib/geometry2d.html
+++ b/docs/build/html/_modules/pylib/geometry2d.html
@@ -473,7 +473,7 @@
>>> x, y = line((0, 0), (1, 0)) >>> print(x, y)
- ((0, 1), (0, 0))
+ (0, 1) (0, 0) """p1x,p1y=point1p2x,p2y=point2
diff --git a/docs/build/html/_modules/pylib/helper.html b/docs/build/html/_modules/pylib/helper.html
index cf376b3..ad1817e 100644
--- a/docs/build/html/_modules/pylib/helper.html
+++ b/docs/build/html/_modules/pylib/helper.html
@@ -58,18 +58,18 @@
:Example:
- >>> with timeit('section_test'):
- ... # code
- section_test took 0.006 ms
-
::
+ with timeit('section_test'):
+ # code
+ section_test took 0.006 ms
+
@timeit('func') def func(): # code
- >>> func()
- func took 0.006 ms
+ func()
+ func took 0.006 ms """def__init__(self,description=None):self.description=description
diff --git a/docs/build/html/_modules/pylib/mathematics.html b/docs/build/html/_modules/pylib/mathematics.html
index 3b10655..7545246 100644
--- a/docs/build/html/_modules/pylib/mathematics.html
+++ b/docs/build/html/_modules/pylib/mathematics.html
@@ -114,7 +114,7 @@
>>> m = vector([1, 2, 3]) >>> m *= vector([3, 3, 3]) >>> print(v)
- [[3, 3, 3], [6, 6, 6], [9, 9, 9]]
+ 18 """
[docs]def__getitem__(self,index):
@@ -124,7 +124,7 @@
:Example: >>> v = vector([1, 2, 3, 4, 5])
- >>> v[1:3]
+ >>> print(v[1:3]) [2, 3] >>> v = vector([1, 2, 3, 4, 5]) >>> v[3]
@@ -440,12 +440,15 @@
:Example:
+ >>> import random
+ >>> random.seed(1) >>> v = vector.random(3) >>> print(v)
- [0.9172905912930438, 0.8908124278322492, 0.5256002790725927]
+ [0.13436424411240122, 0.8474337369372327, 0.763774618976614]
+ >>> random.seed(1) >>> v = vector.random(3, 1, 2) >>> print(v)
- [1.2563665665080803, 1.9270454509964547, 1.2381672401270487]
+ [1.134364244112401, 1.8474337369372327, 1.7637746189766141] """importrandomdl=lmax-lmin
@@ -673,8 +676,7 @@
:Example:
- >>> m = matrix([[1, 2, 3, 0], [4, 5, 6, 0], [7, 8, 9, 0], \
- [0, 0, 0, 0]])
+ >>> m = matrix([[1, 2, 3, 0], [4, 5, 6, 0], [7, 8, 9, 0], [0, 0, 0, 0]]) >>> print(m[:]) [[1, 2, 3, 0], [4, 5, 6, 0], [7, 8, 9, 0], [0, 0, 0, 0]] >>> print(m[2])
@@ -737,20 +739,16 @@
:Example:
- >>> m = matrix([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], \
- [0, 0, 0, 1]]) * 5
+ >>> m = matrix([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [0, 0, 0, 1]]) * 5 >>> print(m) [[5, 10, 15, 20], [25, 30, 35, 40], [45, 50, 55, 60], [0, 0, 0, 5]]
- >>> m = matrix([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], \
- [0, 0, 0, 1]]) * 5.
+ >>> m = matrix([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [0, 0, 0, 1]]) * 5. >>> print(m) [[5.0, 10.0, 15.0, 20.0], [25.0, 30.0, 35.0, 40.0], [45.0, 50.0, 55.0, 60.0], [0.0, 0.0, 0.0, 5.0]]
- >>> v = matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) * \
- vector([12, 12, 13])
+ >>> v = matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) * vector([12, 12, 13]) >>> print(v) [75, 186, 297]
- >>> m = matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) * \
- matrix([[12, 12, 13], [14, 15, 16], [17, 18, 19]])
+ >>> m = matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) * matrix([[12, 12, 13], [14, 15, 16], [17, 18, 19]]) >>> print(m) [[91, 96, 102], [220, 231, 246], [349, 366, 390]]
@@ -784,12 +782,10 @@
:Example:
- >>> m = 5 * matrix([[1, 2, 3, 4], [5, 6, 7, 8], \
- [9, 10, 11, 12], [0, 0, 0, 1]])
+ >>> m = 5 * matrix([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [0, 0, 0, 1]]) >>> print(m) [[5, 10, 15, 20], [25, 30, 35, 40], [45, 50, 55, 60], [0, 0, 0, 5]]
- >>> m = 5. * matrix([[1, 2, 3, 4], [5, 6, 7, 8], \
- [9, 10, 11, 12], [0, 0, 0, 1]])
+ >>> m = 5. * matrix([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [0, 0, 0, 1]]) >>> print(m) [[5.0, 10.0, 15.0, 20.0], [25.0, 30.0, 35.0, 40.0], [45.0, 50.0, 55.0, 60.0], [0.0, 0.0, 0.0, 5.0]]
diff --git a/docs/build/html/_modules/pylib/numerical/integration.html b/docs/build/html/_modules/pylib/numerical/integration.html
index e041dbe..87e02f2 100644
--- a/docs/build/html/_modules/pylib/numerical/integration.html
+++ b/docs/build/html/_modules/pylib/numerical/integration.html
@@ -132,7 +132,7 @@
numerical solution
- >>> f = lambda(x): x**2
+ >>> f = lambda x: x**2 >>> trapez(f, 0, 1, 1) 0.5 >>> trapez(f, 0, 1, 10)
diff --git a/docs/build/html/_sources/index.rst.txt b/docs/build/html/_sources/index.rst.txt
index 08341a4..59b5175 100644
--- a/docs/build/html/_sources/index.rst.txt
+++ b/docs/build/html/_sources/index.rst.txt
@@ -7,7 +7,7 @@ Welcome to pylib's documentation!
=================================
.. toctree::
- :maxdepth: 2
+ :maxdepth: 6
:caption: Contents:
modules
@@ -22,15 +22,20 @@ Indices and tables
* :ref:`search`
+``data_step_std``
+-----------------
+.. image:: _static/class_diagram.svg
+ :target: _images/class_diagram.svg
-tui
----
-pylib/tui.py is the main module for tui 'terminal user interface' programs.
+``tui``
+-------
-* curses package (for Windows install windows-curses) is the underlying main
- package to build terminal programs. The curses package can also be used
- directly.
+``pylib/tui.py`` is the main module for tui 'textual user interface' programs.
+
+* ``curses`` package (for Windows install ``windows-curses``) is the underlying
+ main package to build terminal programs. The ``curses`` package can also be
+ used directly.
* Windows (Anaconda):
@@ -38,9 +43,9 @@ pylib/tui.py is the main module for tui 'terminal user interface' programs.
* ``python -m pip install windows-curses``
* https://github.com/zephyrproject-rtos/windows-curses
-* drawille package is used to draw with braille characters (dottet and quasi-
- line charts). Make sure you use a font with Unicode Braille characters. For
- Windows e. g.: NSimSun, MS Gothic.
+* ``drawille`` package is used to draw with braille characters (dottet and
+ quasi-line charts). Make sure you use a font with Unicode Braille characters.
+ For Windows e. g.: NSimSun, MS Gothic.
* Install: ``python -m pip install drawille``
* Windows (Anaconda):
@@ -48,6 +53,5 @@ pylib/tui.py is the main module for tui 'terminal user interface' programs.
* ``C:\PathToAnaconda3\condabin\conda.bat activate base``
* ``python -m pip install drawille``
-* drawblock.py is used to draw with block characters (histogram).
-
-example/tui.py is an example script to build a terminal program.
+* ``drawblock`` is used to draw with block characters (histogram).
+* ``example/tui.py`` is an example script to build a terminal program.
diff --git a/docs/build/html/_static/class_diagram.svg b/docs/build/html/_static/class_diagram.svg
new file mode 100644
index 0000000..59afc29
--- /dev/null
+++ b/docs/build/html/_static/class_diagram.svg
@@ -0,0 +1,267 @@
+
\ No newline at end of file
diff --git a/docs/build/html/genindex.html b/docs/build/html/genindex.html
index 44c41db..2c688b5 100644
--- a/docs/build/html/genindex.html
+++ b/docs/build/html/genindex.html
@@ -47,11 +47,13 @@
| G
| H
| I
+ | K
| L
| M
| N
| O
| P
+ | Q
| R
| S
| T
@@ -156,15 +158,17 @@
pylib/tui.py is the main module for tui ‘textual user interface’ programs.
-
curses package (for Windows install windows-curses) is the underlying main
-package to build terminal programs. The curses package can also be used
-directly.
+
curses package (for Windows install windows-curses) is the underlying
+main package to build terminal programs. The curses package can also be
+used directly.
Windows (Anaconda):
@@ -69,9 +106,9 @@ directly.
-
drawille package is used to draw with braille characters (dottet and quasi-
-line charts). Make sure you use a font with Unicode Braille characters. For
-Windows e. g.: NSimSun, MS Gothic.
+
drawille package is used to draw with braille characters (dottet and
+quasi-line charts). Make sure you use a font with Unicode Braille characters.
+For Windows e. g.: NSimSun, MS Gothic.
Install: python-mpipinstalldrawille
Windows (Anaconda):
@@ -82,9 +119,9 @@ Windows e. g.: NSimSun, MS Gothic.
-
drawblock.py is used to draw with block characters (histogram).
+
drawblock is used to draw with block characters (histogram).
+
example/tui.py is an example script to build a terminal program.
-
example/tui.py is an example script to build a terminal program.
diff --git a/docs/build/html/objects.inv b/docs/build/html/objects.inv
index 9c1d24c..25c475b 100644
Binary files a/docs/build/html/objects.inv and b/docs/build/html/objects.inv differ
diff --git a/docs/build/html/pylib.data.html b/docs/build/html/pylib.data.html
index 29b1069..9b7b876 100644
--- a/docs/build/html/pylib.data.html
+++ b/docs/build/html/pylib.data.html
@@ -318,6 +318,28 @@ removed from the resulting list.
+
diff --git a/docs/build/html/pylib.data_step.html b/docs/build/html/pylib.data_step.html
index 6b912cf..6bed7ae 100644
--- a/docs/build/html/pylib.data_step.html
+++ b/docs/build/html/pylib.data_step.html
@@ -187,7 +187,28 @@ inside a parenthesis and then split the string at the commas.
diff --git a/docs/build/html/pylib.data_step_std.html b/docs/build/html/pylib.data_step_std.html
index e9accee..b6fa0b3 100644
--- a/docs/build/html/pylib.data_step_std.html
+++ b/docs/build/html/pylib.data_step_std.html
@@ -56,6 +56,26 @@ Product data representation and exchange – Part 21:
Implementation methods: Clear text encoding of the exchange
structure
+
Definition from ISO/CD 10303-42:1992: An edge curve is a special subtype of edge which has its geometry fully defined. The geometry is defined by associating the edge with a curve which may be unbounded. As the topological and geometric directions may be opposed, an indicator (same sense) is used to identify whether the edge and curve directions agree or are opposed. The Boolean value indicates whether the curve direction agrees with (TRUE) or is in the opposite direction (FALSE) to the edge direction. Any geometry associated with the vertices of the edge shall be consistent with the edge geometry.
+
Definition from ISO/CD 10303-42:1992: An edge curve is a special
+subtype of edge which has its geometry fully defined. The
+geometry is defined by associating the edge with a curve which
+may be unbounded. As the topological and geometric directions may
+be opposed, an indicator (same sense) is used to identify whether
+the edge and curve directions agree or are opposed. The Boolean
+value indicates whether the curve direction agrees with (TRUE) or
+is in the opposite direction (FALSE) to the edge direction. Any
+geometry associated with the vertices of the edge shall be
+consistent with the edge geometry.
Informal propositions
-
The domain of the edge curve is formally defined to be the domain of its edge geometry as trimmed by the vertices. This domain does not include the vertices.
+
The domain of the edge curve is formally defined to be the
+domain of its edge geometry as trimmed by the vertices. This
+domain does not include the vertices.
An edge curve has non-zero finite extent.
An edge curve is a manifold.
An edge curve is arcwise connected.
@@ -418,9 +504,16 @@ cartesian_point (ENTITY)
Attribute definitions
-
EdgeGeometry
The curve which defines the shape and spatial location of the edge. This curve may be unbounded and is implicitly trimmed by the vertices of the edge; this defines the edge domain. Multiple edges can reference the same curve.
+
EdgeGeometry
The curve which defines the shape and spatial location of the
+edge. This curve may be unbounded and is implicitly trimmed
+by the vertices of the edge; this defines the edge domain.
+Multiple edges can reference the same curve.
-
SameSense
This logical flag indicates whether (TRUE), or not (FALSE) the senses of the edge and the curve defining the edge geometry are the same. The sense of an edge is from the edge start vertex to the edge end vertex; the sense of a curve is in the direction of increasing parameter.
+
SameSense
This logical flag indicates whether (TRUE), or not (FALSE)
+the senses of the edge and the curve defining the edge
+geometry are the same. The sense of an edge is from the edge
+start vertex to the edge end vertex; the sense of a curve is
+in the direction of increasing parameter.
@@ -441,8 +534,8 @@ cartesian_point (ENTITY)
Parameters
-
name (str) – STEP Standard TYPE label (STRING)
-
edge_list (tuple) – STEP Standard TYPE LIST OF oriented_edge (ENTITY)
Ideally an EXPRESS real value is unlimited in accuracy and size.
+But in practice a real value is represented by a floating point
+value of type double.
the curve will not touch the first and last legs of the
control polyline
the knot vector does not have any particular structure
-
for degree p, intervals [u_0, u_p) and [u_{n-p}, u_n) will not
-have “full support” of basis functions and are ignored when a
-B-spline curve is open. For open B-spline curves, the domain
-is inteval [u_p, u_{n-p}]
+
for degree p, intervals \([u_0, u_p)\) and
+\([u_{n-p}, u_n)\) will not have “full support” of basis
+functions and are ignored when a B-spline curve is open. For
+open B-spline curves, the domain is inteval
+\([u_p, u_{n-p}]\)
A cosine wave is said to be sinusoidal, because,
-\(\cos(x) = \sin(x + \pi/2)\), which is also a sine wave with a
-phase-shift of π/2 radians. Because of this head start, it is often
-said that the cosine function leads the sine function or the sine
-lags the cosine.
+\(\cos(x) = \sin(x + \pi/2)\), which is also a sine wave with
+a phase-shift of π/2 radians. Because of this head start, it is
+often said that the cosine function leads the sine function or
+the sine lags the cosine.
diff --git a/docs/build/html/pylib.geometry.html b/docs/build/html/pylib.geometry.html
index 4b7d0c6..b8b66ed 100644
--- a/docs/build/html/pylib.geometry.html
+++ b/docs/build/html/pylib.geometry.html
@@ -420,7 +420,28 @@ The Wireframe class create its own points (copy).
diff --git a/docs/build/html/pylib.helper.html b/docs/build/html/pylib.helper.html
index 27d29ea..83be967 100644
--- a/docs/build/html/pylib.helper.html
+++ b/docs/build/html/pylib.helper.html
@@ -90,18 +90,16 @@ used for the print-out
Example
-
>>> withtimeit('section_test'):
-... # code
-section_test took 0.006 ms
-