Skip to content

Commit

Permalink
Update Abstract module inline documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Onur R. Bingol committed Feb 9, 2018
1 parent 9bf836f commit 7f67c04
Showing 1 changed file with 146 additions and 4 deletions.
150 changes: 146 additions & 4 deletions geomdl/Abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ def order(self, value):
@property
@abc.abstractmethod
def degree(self):
""" Curve degree.
:getter: Gets the curve degree
:setter: Sets the curve degree
"""
return False

@degree.setter
Expand All @@ -54,6 +59,11 @@ def degree(self, value):
@property
@abc.abstractmethod
def knotvector(self):
""" Knot vector.
:getter: Gets the knot vector
:setter: Sets the knot vector
"""
return False

@knotvector.setter
Expand All @@ -64,6 +74,11 @@ def knotvector(self, value):
@property
@abc.abstractmethod
def ctrlpts(self):
""" Control points.
:getter: Gets the control points
:setter: Sets the control points
"""
return False

@ctrlpts.setter
Expand All @@ -74,11 +89,22 @@ def ctrlpts(self, value):
@property
@abc.abstractmethod
def curvepts(self):
""" Curve points.
:getter: Coordinates of the evaluated surface points
"""
return False

@property
@abc.abstractmethod
def delta(self):
""" Evaluation delta.
.. note:: The delta value is 0.1 by default.
:getter: Gets the delta value
:setter: Sets the delta value
"""
return self._delta

@delta.setter
Expand All @@ -90,11 +116,13 @@ def delta(self, value):
def vis(self):
""" Visualization component.
.. note:: The visualization component is completely optional to use.
.. note::
The visualization component is completely optional to use. ``render()`` method should also be implemented,
if the visualization component is planned to be used in the implementation.
:getter: Gets the visualization component
:setter: Sets the visualization component
:type: float
"""
return self._vis_component

Expand All @@ -120,10 +148,30 @@ def _check_variables(self):

@abc.abstractmethod
def curvept(self, u=-1, check_vars=True, get_ctrlpts=False):
""" Evaluates the curve at the given parameter value.
:param u: parameter
:type u: float
:param check_vars: flag to disable variable checking (only for internal eval functions)
:type check_vars: bool
:param get_ctrlpts: flag to add a list of control points associated with the curve evaluation to return value
:param get_ctrlpts: bool
:return: evaluated curve point at the given knot value
"""
pass

@abc.abstractmethod
def evaluate(self):
def evaluate(self, start=0.0, stop=1.0):
""" Evaluates the curve in the given interval.
The ``start`` and ``stop`` parameters allow evaluation of a curve segment in the range *[start, stop]*, i.e.
the curve will also be evaluated at the ``stop`` parameter value.
:param start: start parameter, defaults to zero
:type start: float
:param stop: stop parameter, defaults to one
:type stop: float
"""
pass


Expand Down Expand Up @@ -182,6 +230,12 @@ def order_v(self, value):
@property
@abc.abstractmethod
def degree_u(self):
""" Surface degree for U direction.
:getter: Gets the surface degree for U direction
:setter: Sets the surface degree for U direction
:type: integer
"""
return False

@degree_u.setter
Expand All @@ -192,6 +246,12 @@ def degree_u(self, value):
@property
@abc.abstractmethod
def degree_v(self):
""" Surface degree for V direction.
:getter: Gets the surface degree for V direction
:setter: Sets the surface degree for V direction
:type: integer
"""
return False

@degree_v.setter
Expand All @@ -202,6 +262,11 @@ def degree_v(self, value):
@property
@abc.abstractmethod
def knotvector_u(self):
""" Knot vector for U direction.
:getter: Gets the knot vector for U direction
:setter: Sets the knot vector for U direction
"""
return False

@knotvector_u.setter
Expand All @@ -212,6 +277,11 @@ def knotvector_u(self, value):
@property
@abc.abstractmethod
def knotvector_v(self):
""" Knot vector for V direction.
:getter: Gets the knot vector for V direction
:setter: Sets the knot vector for V direction
"""
return False

@knotvector_v.setter
Expand All @@ -222,6 +292,16 @@ def knotvector_v(self, value):
@property
@abc.abstractmethod
def ctrlpts(self):
""" 1-D control points.
.. note::
The v index varies first. That is, a row of v control points for the first u value is found first.
Then, the row of v control points for the next u value.
:getter: Gets the control points
:setter: Sets the control points
"""
return False

@ctrlpts.setter
Expand All @@ -232,6 +312,11 @@ def ctrlpts(self, value):
@property
@abc.abstractmethod
def ctrlpts2d(self):
""" 2-D control points.
:getter: Gets the control points in U and V directions
:setter: Sets the control points in U and V directions
"""
return False

@ctrlpts2d.setter
Expand All @@ -241,6 +326,11 @@ def ctrlpts2d(self, value):

@property
def ctrlpts_size_u(self):
""" Size of the control points array in U-direction.
:getter: Gets number of control points in U-direction
:setter: Sets number of control points in U-direction
"""
return self._control_points_size_u

@ctrlpts_size_u.setter
Expand All @@ -253,6 +343,11 @@ def ctrlpts_size_u(self, value):

@property
def ctrlpts_size_v(self):
""" Size of the control points array in V-direction.
:getter: Gets number of control points in V-direction
:setter: Sets number of control points in V-direction
"""
return self._control_points_size_v

@ctrlpts_size_v.setter
Expand All @@ -266,11 +361,22 @@ def ctrlpts_size_v(self, value):
@property
@abc.abstractmethod
def surfpts(self):
""" Surface points.
:getter: Coordinates of evaluated surface points
"""
return False

@property
@abc.abstractmethod
def delta(self):
""" Evaluation delta.
.. note:: The delta value is 0.1 by default.
:getter: Gets the delta value
:setter: Sets the delta value
"""
return self._delta

@delta.setter
Expand All @@ -280,6 +386,16 @@ def delta(self, value):

@property
def vis(self):
""" Visualization component.
.. note::
The visualization component is completely optional to use. ``render()`` method should also be implemented,
if the visualization component is planned to be used in the implementation.
:getter: Gets the visualization component
:setter: Sets the visualization component
"""
return self._vis_component

@vis.setter
Expand All @@ -303,8 +419,34 @@ def _check_variables(self):

@abc.abstractmethod
def surfpt(self, u=-1, v=-1, check_vars=True, get_ctrlpts=False):
""" Evaluates the surface at the given (u,v) parameters.
:param u: parameter in the U direction
:type u: float
:param v: parameter in the V direction
:type v: float
:param check_vars: flag to disable variable checking (only for internal eval functions)
:type check_vars: bool
:param get_ctrlpts: flag to add a list of control points associated with the surface evaluation to return value
:param get_ctrlpts: bool
"""
pass

@abc.abstractmethod
def evaluate(self):
def evaluate(self, start_u=0.0, stop_u=1.0, start_v=0.0, stop_v=1.0):
""" Evaluates the surface in the given (u,v) intervals.
The ``start_u``, ``start_v`` and ``stop_u`` and ``stop_v`` parameters allow evaluation of a surface segment
in the range *[start_u, stop_u][start_v, stop_v]* i.e. the surface will also be evaluated at the ``stop_u``
and ``stop_v`` parameter values.
:param start_u: u parameter to start evaluation
:type start_u: float
:param stop_u: u parameter to stop evaluation
:type stop_u: float
:param start_v: v parameter to start evaluation
:type start_v: float
:param stop_v: v parameter to stop evaluation
:type stop_v: float
"""
pass

0 comments on commit 7f67c04

Please sign in to comment.