Skip to content

Commit

Permalink
Add splitting and decomposition docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Onur R. Bingol committed Feb 12, 2018
1 parent 727c2a7 commit cf11d84
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 0 deletions.
Binary file added docs/images/split_curve2d_translate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/split_curve3d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/split_decompose_circle1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/split_decompose_circle2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/split_decompose_surface1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/split_decompose_surface2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/split_surface_combined.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/split_surface_multi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/split_surface_translate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ This documentation is organized into a couple sections:
examples
file_formats
visualization
visualization_splitting

.. _modules:

Expand Down
67 changes: 67 additions & 0 deletions docs/visualization_splitting.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Splitting and Decomposition
^^^^^^^^^^^^^^^^^^^^^^^^^^^

NURBS-Python is also capable of splitting the curves and the surfaces, as well as applying Bézier decomposition.
Splitting of 2D/3D curves can be achieved via ``split()`` method. For the surfaces, there are 2 different splitting
methods, ``split_u()`` for splitting the surface in U-direction and ``split_v()`` for V-direction. Bézier decomposition
can be applied via ``decompose()`` method for all curve and surface classes. Please refer to the documentation for more
details.

The following figures are generated from the examples provided in the Examples_ repository.

Splitting
=========

The following 2D curve is split at ``u = 0.6`` and applied translation by the tangent vector via ``translate()`` method.

.. image:: images/split_curve2d_translate.png
:alt: 3D curve splitting example with translation

Splitting can also be applied to 3D curves (split at ``u = 0.3``) without any translation.

.. image:: images/split_curve3d.png
:alt: 3D curve splitting example

Surface splitting is also possible. The following figure compares splitting at ``u = 0.5`` and ``v = 0.5``.

.. image:: images/split_surface_combined.png
:alt: Surface split combined

Surfaces can also be translated too before or after splitting operation. The following figure illustrates translation
after splitting the surface at ``u = 0.5``.

.. image:: images/split_surface_translate.png
:alt: Surface split and translation

Multiple splitting is also possible for all curves and surfaces. The following figure describes multi splitting in
surfaces. The initial surface is split at ``u = 0.25`` and then, one of the resultant surfaces is split at ``v = 0.75``,
finally resulting 3 surfaces.

.. image:: images/split_surface_multi.png
:alt: Surface multi split

Bézier Decomposition
====================

The following figures illustrate Bézier cecomposition capabilities of NURBS-Python. Let's start with the most obvious
one, a full circle with 9 control points. It also is possible to directly generate this shape via ``geomdl.shapes``
module.

.. image:: images/split_decompose_circle1.png
:alt: 2D curve decomposition 1

The following is a circle-like shape generated with 7 control points as illustrated on page 301 of *The NURBS Book*
(2nd Edition) by Piegl and Tiller. There is also an option to generate this shape via ``geomdl.shapes`` module.

.. image:: images/split_decompose_circle2.png
:alt: 2D curve decomposition 2

The following figures illustrate the possibility of Bézier decomposition in B-Spline and NURBS surfaces.

.. image:: images/split_decompose_surface1.png
:alt: B-Spline surface decomposition

.. image:: images/split_decompose_surface2.png
:alt: NURBS surface decomposition

.. _Examples: https://github.com/orbingol/NURBS-Python_Examples

0 comments on commit cf11d84

Please sign in to comment.