Skip to content

Commit

Permalink
Update to support newer version of CadQuery + OCP v.7.6+ which also r…
Browse files Browse the repository at this point in the history
…equires python 3.8+
  • Loading branch information
michaelgale committed Jan 12, 2023
1 parent 54e32fb commit 1c9883a
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 25 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ branches:

matrix:
include:
- name: "Python 3.7 - linux"
env: PYTHON_VERSION=3.7
os: linux
- name: "Python 3.8 - linux"
env: PYTHON_VERSION=3.8
os: linux
- name: "Python 3.9 - linux"
env: PYTHON_VERSION=3.9
os: linux
- name: "Python 3.10 - linux"
env: PYTHON_VERSION=3.10
os: linux
- name: "Lint"
env: PYTHON_VERSION=3.8
os: linux
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# CQ-Kit

![https://pypi.org/project/cqkit/](https://img.shields.io/pypi/v/cqkit.svg)
![python version](https://img.shields.io/static/v1?label=python&message=3.6%2B&color=blue&style=flat&logo=python)
![python version](https://img.shields.io/static/v1?label=python&message=3.8%2B&color=blue&style=flat&logo=python)
![https://github.com/CadQuery/cadquery](https://img.shields.io/static/v1?label=dependencies&message=CadQuery%202.0%2B&color=blue&style=flat)
![https://github.com/michaelgale/cq-kit/blob/master/LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
Expand Down Expand Up @@ -48,7 +48,7 @@ If you want to create a fresh anaconda environment with **CadQuery** and **CQ-Ki
$ python setup.py install
```

Substitute your desired python `$VERSION` with 3.6, 3.7, or 3.8 and optionally replace `$MY_NAME` with a different desired environment name than the default of `cadquery` specified in `environment.yml`.
Substitute your desired python `$VERSION` with 3.8, 3.9, or 3.10 and optionally replace `$MY_NAME` with a different desired environment name than the default of `cadquery` specified in `environment.yml`.

## Basic Usage

Expand Down Expand Up @@ -417,6 +417,7 @@ es = SharedVerticesWithObjectSelector(face1)
## Releases
v.0.4.0 - First release on PyPI
v.0.5.0 - Update requires python v.3.8+ and OCP v.7.6+ CadQuery 2.1+
## Authors
Expand Down
2 changes: 1 addition & 1 deletion cqkit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# fmt: off
__project__ = 'cqkit'
__version__ = '0.4.1'
__version__ = '0.5.0'
# fmt: on

VERSION = __project__ + "-" + __version__
Expand Down
10 changes: 5 additions & 5 deletions cqkit/cq_discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ def triangle_mesh_solid(solid, lin_tol=1e-2, ang_tol=0.5):
face = mesh_face.wrapped
location = TopLoc_Location()
facing = bt.Triangulation(face, location)
tri = facing.Triangles()
tri = facing.InternalTriangles()
num_tri = facing.NbTriangles()
vtx = facing.Nodes()
vtx = facing.InternalNodes()
txf = face.Location().Transformation()
rev = (
True
Expand All @@ -140,9 +140,9 @@ def triangle_mesh_solid(solid, lin_tol=1e-2, ang_tol=0.5):
ci = [0, 2, 1] if rev else [0, 1, 2]
for j in ci:
pt = [
vtx.Value(idx[j]).Transformed(txf).X(),
vtx.Value(idx[j]).Transformed(txf).Y(),
vtx.Value(idx[j]).Transformed(txf).Z(),
vtx.Value(idx[j] - 1).Transformed(txf).X(),
vtx.Value(idx[j] - 1).Transformed(txf).Y(),
vtx.Value(idx[j] - 1).Transformed(txf).Z(),
]
if pt not in vertices:
vertices.append(pt)
Expand Down
11 changes: 7 additions & 4 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,25 @@ channels:
- conda-forge
- defaults
dependencies:
- python>=3.6
- python>=3.8
- ipython
- ocp>=7.5.1
- numpy=1.23
- ocp>=7.6.*
- pyparsing>=2.1.9
- sphinx=3.2.1
- sphinx=5.0.1
- sphinx_rtd_theme
- sphinx-autodoc-typehints
- black=19.10b0
- codecov
- click=8.0.4
- pytest
- pytest-cov
- ezdxf
- ipython
- typing_extensions
- nptyping
- nptyping=2.0.1
- pip
- pip:
- "--editable=."
- sphinxcadquery
- multimethod>=1.7,<2.0
12 changes: 2 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import setuptools

PACKAGE_NAME = "cqkit"
MINIMUM_PYTHON_VERSION = "3.6"

loc = os.path.abspath(os.path.dirname(__file__))

Expand Down Expand Up @@ -37,12 +36,6 @@
required.append(line)


def check_python_version():
"""Exit when the Python version is too low."""
if sys.version < MINIMUM_PYTHON_VERSION:
sys.exit("Python {0}+ is required.".format(MINIMUM_PYTHON_VERSION))


def read_package_variable(key, filename="__init__.py"):
"""Read the value of a variable from the package without importing."""
module_path = os.path.join(PACKAGE_NAME, filename)
Expand All @@ -65,15 +58,14 @@ def build_description():
return readme + "\n" + changelog


check_python_version()

setuptools.setup(
name=read_package_variable("__project__"),
version=read_package_variable("__version__"),
description="A python library of CadQuery tools and helpers for building 3D CAD models.",
url="https://github.com/michaelgale/cq-kit",
author="Michael Gale",
author_email="[email protected]",
python_requires=">=3.8",
packages=setuptools.find_packages(),
long_description=build_description(),
long_description_content_type="text/markdown",
Expand All @@ -82,7 +74,7 @@ def build_description():
"Development Status :: 3 - Alpha",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.8",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
],
Expand Down

0 comments on commit 1c9883a

Please sign in to comment.