Skip to content

Commit da911f1

Browse files
committed
fix index bug in splines
1 parent 1be9da6 commit da911f1

5 files changed

Lines changed: 10 additions & 4 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Trimesh is a pure Python (2.7- 3.3+) library for loading and using [triangular m
88

99
The API is mostly stable, but this should not be relied on and is not guaranteed; install a specific version if you plan on deploying something using trimesh as a backend.
1010

11-
Pull requests are hugely appreciated and responded to promptly! If you'd like to contribute, here is an [up to date list of potential enhancements](https://github.com/mikedh/trimesh/issues/199) although things not on that list are also welcome. Also, some [general advice for writing mesh code in Python and Numpy.](https://github.com/mikedh/trimesh/blob/master/trimesh/io/README.md)
11+
Pull requests are highly appreciated and are responded to promptly! If you'd like to contribute, here is an [up to date list of potential enhancements](https://github.com/mikedh/trimesh/issues/199) although things not on that list are also welcome. Also, some [general advice for writing mesh code in Python and Numpy.](https://github.com/mikedh/trimesh/blob/master/trimesh/io/README.md)
1212

1313

1414
## Basic Installation
@@ -17,13 +17,13 @@ The minimal requirements to import trimesh are
1717
[numpy](http://www.numpy.org/), [scipy](http://www.scipy.org) and
1818
[networkx](https://networkx.github.io). Installing other packages mentioned adds functionality but is **not required**.
1919

20-
For the easiest install with only these minimal dependencies (slower ray queries, no vector path handling, mesh creation, viewer, etc):
20+
For the easiest install with only these minimal dependencies:
2121

2222
```bash
2323
pip install trimesh
2424
```
2525

26-
For more functionality, the easiest way to get a full `trimesh` install is a [conda environment](https://conda.io/miniconda.html):
26+
For more functionality, like faster ray queries (`pyembree`), vector path handling (`shapely` and `rtree`), preview windows (`pyglet`), faster cache checks (`xxhash`) and more, the easiest way to get a full `trimesh` install is a [conda environment](https://conda.io/miniconda.html):
2727

2828
```bash
2929
# this will install all soft dependencies available on your current platform

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
'msgpack',
5858
'pillow',
5959
'requests',
60+
'xxhash',
6061
'colorlog'],
6162
'all': ['lxml',
6263
'pyglet',

trimesh/path/curve.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def discretize_bspline(control,
8282
ipl = np.linspace(knots[0], knots[-1], count)
8383
discrete = splev(ipl, [knots, control.T, degree])
8484
discrete = np.column_stack(discrete)
85+
8586
return discrete
8687

8788

trimesh/path/path.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,10 @@ def merge_vertices(self):
467467
digits=digits)
468468
self.vertices = self.vertices[unique]
469469
for entity in self.entities:
470+
# don't screw up control- point- knot relationship
471+
if type(entity).__name__ in 'BSpline Bezier':
472+
entity.points = inverse[entity.points]
473+
continue
470474
# if we merged duplicate vertices, the entity may contain
471475
# multiple references to the same vertex
472476
entity.points = grouping.merge_runs(inverse[entity.points])

trimesh/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '2.33.41'
1+
__version__ = '2.33.42'

0 commit comments

Comments
 (0)