Skip to content

Commit

Permalink
Merge pull request #8 from compmec/dev
Browse files Browse the repository at this point in the history
v1.1.0 - refactor - change package name
  • Loading branch information
carlos-adir authored Apr 14, 2024
2 parents fa30f72 + 391c075 commit ed77e1f
Show file tree
Hide file tree
Showing 33 changed files with 335 additions and 280 deletions.
39 changes: 19 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
[![Python Versions][pyversions-img]][pyversions-url]
[![License: MIT][license-img]][license-url]

![compmec-nurbs logo](docs/source/img/logo.svg)
![pynurbs logo](docs/source/img/logo.svg)

A object-oriented python package for parametrized geometry which supports [Custom objects](https://compmec-nurbs.readthedocs.io/en/latest/rst/custom_objects.html).
A pure object-oriented python package for parametrized geometry which supports [Custom objects](https://pynurbs.readthedocs.io/en/latest/rst/custom_objects.html).

For now, it supports only 1D-objects (curves).

## Features

Expand All @@ -34,14 +33,14 @@ For now, it supports only 1D-objects (curves).
This library is available in [PyPI][pypi-url]. To install it

```
pip install compmec-nurbs
pip install pynurbs
```

For more details, refer to the [documentation][docs-url].

## Documentation

The documentation can be found at [compmec-nurbs.readthedocs.io][docs-url]
The documentation can be found at [pynurbs.readthedocs.io][docs-url]


## Contribute
Expand All @@ -53,19 +52,19 @@ Please use the [Issues][issues-url] or refer to the email ```[email protected]
<!-- Badges: -->

[nurbswiki-url]: https://pt.wikipedia.org/wiki/NURBS
[lintblack-img]: https://github.com/compmec/nurbs/actions/workflows/black.yaml/badge.svg
[lintblack-url]: https://github.com/compmec/nurbs/actions/workflows/black.yaml
[docs-img]: https://readthedocs.org/projects/compmec-nurbs/badge/?version=latest
[docs-url]: https://compmec-nurbs.readthedocs.io/en/latest/?badge=latest
[pypi-img]: https://img.shields.io/pypi/v/compmec-nurbs
[pypi-url]: https://pypi.org/project/compmec-nurbs/
[build-img]: https://github.com/compmec/nurbs/actions/workflows/build.yaml/badge.svg
[build-url]: https://github.com/compmec/nurbs/actions/workflows/build.yaml
[coverage-img]: https://codecov.io/gh/compmec/nurbs/branch/main/graph/badge.svg?token=vfGMPe9W3I
[coverage-url]: https://codecov.io/gh/compmec/nurbs
[pyversions-img]: https://img.shields.io/pypi/pyversions/compmec-nurbs.svg?style=flat-square
[pyversions-url]: https://pypi.org/project/compmec-nurbs/
[lintblack-img]: https://github.com/compmec/pynurbs/actions/workflows/black.yaml/badge.svg
[lintblack-url]: https://github.com/compmec/pynurbs/actions/workflows/black.yaml
[docs-img]: https://readthedocs.org/projects/pynurbs/badge/?version=latest
[docs-url]: https://pynurbs.readthedocs.io/en/latest/?badge=latest
[pypi-img]: https://img.shields.io/pypi/v/pynurbs
[pypi-url]: https://pypi.org/project/pynurbs/
[build-img]: https://github.com/compmec/pynurbs/actions/workflows/build.yaml/badge.svg
[build-url]: https://github.com/compmec/pynurbs/actions/workflows/build.yaml
[coverage-img]: https://codecov.io/gh/compmec/pynurbs/branch/main/graph/badge.svg?token=vfGMPe9W3I
[coverage-url]: https://codecov.io/gh/compmec/pynurbs
[pyversions-img]: https://img.shields.io/pypi/pyversions/pynurbs.svg?style=flat-square
[pyversions-url]: https://pypi.org/project/pynurbs/
[license-img]: https://img.shields.io/pypi/l/ansicolortags.svg
[license-url]: https://github.com/compmec/nurbs/blob/main/LICENSE.md
[pypi-url]: https://pypi.org/project/compmec-nurbs/
[issues-url]: https://github.com/compmec/nurbs/issues
[license-url]: https://github.com/compmec/pynurbs/blob/main/LICENSE.md
[pypi-url]: https://pypi.org/project/pynurbs/
[issues-url]: https://github.com/compmec/pynurbs/issues
22 changes: 11 additions & 11 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
import os
import sys

sys.path.insert(0, os.path.abspath("../../src/compmec/"))
from compmec.nurbs import __version__ as ver
sys.path.insert(0, os.path.abspath("../../src"))
from pynurbs import __version__ as ver

autodoc_mock_imports = []

# -- Project information -----------------------------------------------------

project = "compmec-nurbs"
project = "pynurbs"
copyright = "2023, Carlos Adir"
author = "Carlos Adir"

Expand Down Expand Up @@ -115,7 +115,7 @@
# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = "compmec-nurbs-doc"
htmlhelp_basename = "pynurbs-doc"


# -- Options for LaTeX output ------------------------------------------------
Expand All @@ -141,8 +141,8 @@
latex_documents = [
(
master_doc,
"compmec-nurbs.tex",
"compmec-nurbs Documentation",
"pynurbs.tex",
"pynurbs Documentation",
"Carlos Adir",
"manual",
),
Expand All @@ -153,7 +153,7 @@

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual nurbs).
man_pages = [(master_doc, "compmec-nurbs", "compmec-nurbs Documentation", [author], 1)]
man_pages = [(master_doc, "pynurbs", "pynurbs Documentation", [author], 1)]


# -- Options for Texinfo output ----------------------------------------------
Expand All @@ -164,10 +164,10 @@
texinfo_documents = [
(
master_doc,
"compmec-nurbs",
"compmec-nurbs Documentation",
"pynurbs",
"pynurbs Documentation",
author,
"compmec-nurbs",
"pynurbs",
"Parametric geometry 2D library",
"Miscellaneous",
),
Expand All @@ -192,7 +192,7 @@
# directory where function granular galleries are stored
"backreferences_dir": None,
# Modules for which function level galleries are created. In
"doc_module": "compmec-nurbs",
"doc_module": "pynurbs",
"image_scrapers": ("matplotlib",),
"first_notebook_cell": ("%matplotlib inline\n"),
}
Expand Down
8 changes: 4 additions & 4 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.. image:: img/logo.svg
:width: 100 %
:alt: compmec-nurbs
:alt: pynurbs
:align: center

Documentation
=============

**compmec-nurbs** is a python package for geometry parametrization that provides easy-to-use data structures to describe parametric curves and allows the use of :ref:`custom-objects`.
**pynurbs** is a python package for geometry parametrization that provides easy-to-use data structures to describe parametric curves and allows the use of :ref:`custom-objects`.

.. toctree::
:maxdepth: 2
Expand Down Expand Up @@ -50,9 +50,9 @@ Support
-------

Raise an issue on the `GitHub issue tracker
<https://github.com/compmec/nurbs/issues>`_ or contact me at
<https://github.com/pynurbs/issues>`_ or contact me at
`[email protected] <mailto:[email protected]>`_.
If you have a request for a feature to be added to the *compmec-nurbs* package, please don't hesitate to get in touch
If you have a request for a feature to be added to the *pynurbs* package, please don't hesitate to get in touch

License
-------
Expand Down
2 changes: 1 addition & 1 deletion docs/source/requirements_docs.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
numpy
compmec-nurbs>=1.0.0
pynurbs>=1.0.0
sphinx
sphinx-rtd-theme
sphinx-gallery
Expand Down
34 changes: 17 additions & 17 deletions docs/source/rst/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ As direct example, we present a simple code to plot a spline curve
.. code-block:: python
import numpy as np
from compmec.nurbs import GeneratorKnotVector, Curve
from pynurbs import GeneratorKnotVector, Curve
# Define the knotvector (0, 0, 0, 0.5, 1, 1, 1)
knotvector = GeneratorKnotVector.uniform(degree = 2, npts = 4)
Expand Down Expand Up @@ -63,7 +63,7 @@ Use ``curve(nodes)`` is the same as ``curve.eval(nodes)``
import numpy as np
from matplotlib import pyplot as plt
from compmec.nurbs import GeneratorKnotVector, Curve
from pynurbs import GeneratorKnotVector, Curve
# Create the curve
knotvector = GeneratorKnotVector.uniform(2, 4)
Expand Down Expand Up @@ -104,7 +104,7 @@ The steps to construct a **rational bspline curve** is the same as to construct
import numpy as np
from matplotlib import pyplot as plt
from compmec.nurbs import GeneratorKnotVector, Curve
from pynurbs import GeneratorKnotVector, Curve
knotvector = GeneratorKnotVector.uniform(2, 4)
ctrlpoints = np.array([(2, 4), (1, 1), (3, 2), (0, 3)])
Expand All @@ -129,7 +129,7 @@ Two of the main features are ``knot_insert`` and ``knot_remove``, which don't mo
.. code-block:: python
import numpy as np
from compmec.nurbs import GeneratorKnotVector, Curve
from pynurbs import GeneratorKnotVector, Curve
knotvector = GeneratorKnotVector.uniform(2, 4)
ctrlpoints = np.array([(2, 4), (1, 1), (3, 2), (0, 3)])
Expand All @@ -147,7 +147,7 @@ Trying to remove non-possible knots raises a ``ValueError``
.. code-block:: python
import numpy as np
from compmec.nurbs import GeneratorKnotVector, Curve
from pynurbs import GeneratorKnotVector, Curve
knotvector = GeneratorKnotVector.uniform(2, 4)
ctrlpoints = np.array([(2, 4), (1, 1), (3, 2), (0, 3)])
Expand All @@ -163,7 +163,7 @@ It's possible to force knot removal by changing the value of ``tolerance`` or se
.. code-block:: python
import numpy as np
from compmec.nurbs import GeneratorKnotVector, Curve
from pynurbs import GeneratorKnotVector, Curve
knotvector = GeneratorKnotVector.uniform(2, 4)
ctrlpoints = np.array([(2, 4), (1, 1), (3, 2), (0, 3)])
Expand All @@ -189,7 +189,7 @@ Other two of the main features are ``degree_increase`` and ``degree_decrease`` w
.. code-block:: python
import numpy as np
from compmec.nurbs import GeneratorKnotVector, Curve
from pynurbs import GeneratorKnotVector, Curve
knotvector = GeneratorKnotVector.uniform(2, 4)
ctrlpoints = np.array([(2, 4), (1, 1), (3, 2), (0, 3)])
Expand All @@ -207,7 +207,7 @@ You can also change the value of ``tolerance`` or set it to ``None`` (infinite t
.. code-block:: python
import numpy as np
from compmec.nurbs import GeneratorKnotVector, Curve
from pynurbs import GeneratorKnotVector, Curve
knotvector = [0, 0, 0, 0, 1/3, 1/3, 1/3, 2/3, 2/3, 2/3, 1, 1, 1, 1]
ctrlpoints = [(1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0),
Expand Down Expand Up @@ -238,7 +238,7 @@ It's usefull when there are unecessary knots caused by **knot insertion** or **d
.. code-block:: python
import numpy as np
from compmec.nurbs import GeneratorKnotVector, Curve
from pynurbs import GeneratorKnotVector, Curve
knotvector = GeneratorKnotVector.uniform(2, 4)
ctrlpoints = np.array([(2, 4), (1, 1), (3, 2), (0, 3)])
Expand Down Expand Up @@ -266,7 +266,7 @@ It's possible to ``split`` and unite curves.
.. code-block:: python
import numpy as np
from compmec.nurbs import GeneratorKnotVector, Curve
from pynurbs import GeneratorKnotVector, Curve
knotvector = GeneratorKnotVector.uniform(2, 4)
ctrlpoints = np.array([(2, 4), (1, 1), (3, 2), (0, 3)])
Expand Down Expand Up @@ -303,7 +303,7 @@ The ``Curve``'s objects allow operations using the symbols ``+``, ``-``, ``*``,

.. code-block:: python
from compmec.nurbs import GeneratorKnotVector, Curve
from pynurbs import GeneratorKnotVector, Curve
knotvector = GeneratorKnotVector.uniform(2, 4)
curveA = Curve(knotvector, [1, 4, -2, 3])
Expand Down Expand Up @@ -343,7 +343,7 @@ The ``Curve``'s objects has the functions ``fit_curve``, ``fit_function`` and ``

.. code-block:: python
from compmec.nurbs import Curve
from pynurbs import Curve
# Create knot vector
knotvector = (0, 0, 0.5, 1, 1)
Expand Down Expand Up @@ -373,8 +373,8 @@ It's possible to derivate a curve

.. code-block:: python
from compmec.nurbs import Curve
from compmec.nurbs.calculus import Derivate
from pynurbs import Curve
from pynurbs.calculus import Derivate
# Create knot vector
knotvector = (0, 0, 0, 0.2, 0.5, 0.7, 1, 1, 1)
Expand Down Expand Up @@ -409,7 +409,7 @@ Since it's possible to have more than one parameters :math:`u^{\star}` with equa

.. code-block:: python
from compmec.nurbs import Curve, Projection
from pynurbs import Curve, Projection
# Create knot vector
knotvector = (0, 0, 0, 0.2, 0.5, 0.7, 1, 1, 1)
Expand Down Expand Up @@ -444,8 +444,8 @@ Finds all the pairs :math:`\left(u^{\star}, \ v^{\star} \right)` such :math:`\|
.. code-block:: python
import numpy as np
from compmec.nurbs import Curve
from compmec.nurbs.advanced import Intersection
from pynurbs import Curve
from pynurbs.advanced import Intersection
# Create first curve
pointsa = [(2, 1), (2, -1), (-1, -2), (1, -2)]
Expand Down
16 changes: 8 additions & 8 deletions docs/source/rst/basisfunction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Use example
import numpy as np
from matplotlib import pyplot as plt
from compmec.nurbs import GeneratorKnotVector, Function
from pynurbs import GeneratorKnotVector, Function
degree = 2
knotvector = GeneratorKnotVector.bezier(degree)
Expand Down Expand Up @@ -119,7 +119,7 @@ Although above the function :math:`B_{i,p}(u)` is described only by :math:`p`, b
import numpy as np
from matplotlib import pyplot as plt
from compmec.nurbs import GeneratorKnotVector, Function
from pynurbs import GeneratorKnotVector, Function
prop_cycle = plt.rcParams['axes.prop_cycle']
colors = prop_cycle.by_key()['color']
Expand Down Expand Up @@ -168,7 +168,7 @@ Use example
import numpy as np
from matplotlib import pyplot as plt
from compmec.nurbs import GeneratorKnotVector, Function
from pynurbs import GeneratorKnotVector, Function
degree, npts = 2, 5
knotvector = GeneratorKnotVector.uniform(degree, npts)
Expand Down Expand Up @@ -246,7 +246,7 @@ Use example
import numpy as np
from matplotlib import pyplot as plt
from compmec.nurbs import GeneratorKnotVector, Function
from pynurbs import GeneratorKnotVector, Function
prop_cycle = plt.rcParams['axes.prop_cycle']
colors = prop_cycle.by_key()['color']
Expand Down Expand Up @@ -297,7 +297,7 @@ Use example
import numpy as np
from matplotlib import pyplot as plt
from compmec.nurbs import GeneratorKnotVector, Function
from pynurbs import GeneratorKnotVector, Function
degree, npts = 2, 5
knotvector = GeneratorKnotVector.uniform(degree, npts)
Expand Down Expand Up @@ -390,7 +390,7 @@ Use example
import numpy as np
from matplotlib import pyplot as plt
from compmec.nurbs import GeneratorKnotVector, Function
from pynurbs import GeneratorKnotVector, Function
prop_cycle = plt.rcParams['axes.prop_cycle']
colors = prop_cycle.by_key()['color']
Expand Down Expand Up @@ -483,7 +483,7 @@ We start with the bezier of degree 3
import numpy as np
from matplotlib import pyplot as plt
from compmec.nurbs import GeneratorKnotVector, Function
from pynurbs import GeneratorKnotVector, Function
prop_cycle = plt.rcParams['axes.prop_cycle']
colors = prop_cycle.by_key()['color']
Expand Down Expand Up @@ -574,7 +574,7 @@ We do it by inserting the knot :math:`0.25` many times by starting with a bezier
import numpy as np
from matplotlib import pyplot as plt
from compmec.nurbs import GeneratorKnotVector, Function
from pynurbs import GeneratorKnotVector, Function
prop_cycle = plt.rcParams['axes.prop_cycle']
colors = prop_cycle.by_key()['color']
Expand Down
4 changes: 2 additions & 2 deletions docs/source/rst/curve.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ You find a simple example bellow with a curve of degree 2 and 4
import numpy as np
from matplotlib import pyplot as plt
from compmec.nurbs import GeneratorKnotVector, Curve
from pynurbs import GeneratorKnotVector, Curve
# Define curve
knotvector = GeneratorKnotVector.uniform(degree = 2, npts = 4)
Expand Down Expand Up @@ -44,7 +44,7 @@ For example, take fractional knots.
.. code-block:: python
from fractions import Fraction
from compmec.nurbs import KnotVector
from pynurbs import KnotVector
zero, half, one = Fraction(0), Fraction(1, 2), Fraction(1)
vector = [zero, zero, half, one, one]
Expand Down
Loading

0 comments on commit ed77e1f

Please sign in to comment.