Skip to content

Commit 7b432c0

Browse files
committed
Merge remote-tracking branch 'compas-dev/main' into main
2 parents 781c40c + 02c5a76 commit 7b432c0

File tree

307 files changed

+4098
-3700
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

307 files changed

+4098
-3700
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.14.1
2+
current_version = 1.15.0
33
message = Bump version to {new_version}
44
commit = True
55
tag = True

CHANGELOG.md

Lines changed: 66 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,64 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
### Removed
1717

1818

19+
## [1.15.0] 2022-03-22
20+
21+
### Added
22+
23+
* Added descriptor support to `compas.colors.Color`.
24+
* Added descriptor protocol metaclass to `compas.artists.Artist`.
25+
* Added `compas.artists.colordict.ColorDict` descriptor.
26+
* Added `allclose` to doctest fixtures.
27+
* Added `compas.colors.Color.coerce` to construct a color out og hex, RGB1, and RGB255 inputs.
28+
* Added `compas.datastructures.Network.from_pointcloud`.
29+
* Added `compas.datastructures.VolMesh.from_meshgrid`.
30+
* Added `vertices_where`, `vertices_where_predicate`, `edges_where`, `edges_where_predicate` to `compas.datastructures.HalfFace`.
31+
* Added `faces_where`, `faces_where_predicate`, `cells_where`, `cells_where_predicate` to `compas.datastructures.HalfFace`.
32+
* Added `VolMeshArtist` to registered Blender artists.
33+
* Added `3.1` to supported versions for Blender installer.
34+
* Added `compas.artist.NoArtistContextError`.
35+
36+
### Changed
37+
38+
* Changed `compas.geometry.surfaces.nurbs.from_fill` to accept up to 4 curves as input.
39+
* Changed `compas_rhino.artists.MeshArtist.draw` to draw the mesh only.
40+
* Changed `compas_blender.artists.MeshArtist.draw` to draw the mesh only.
41+
* Changed `compas_ghpython.artists.MeshArtist.draw` to draw the mesh only.
42+
* Changed `compas_rhino.artists.MeshArtist.draw_vertexlabels` to use the colors of the vertex color dict.
43+
* Changed `compas_rhino.artists.MeshArtist.draw_edgelabels` to use the colors of the edge color dict.
44+
* Changed `compas_rhino.artists.MeshArtist.draw_facelabels` to use the colors of the face color dict.
45+
* Changed `compas_blender.artists.MeshArtist.draw_vertexlabels` to use the colors of the vertex color dict.
46+
* Changed `compas_blender.artists.MeshArtist.draw_edgelabels` to use the colors of the edge color dict.
47+
* Changed `compas_blender.artists.MeshArtist.draw_facelabels` to use the colors of the face color dict.
48+
* Changed `compas_ghpython.artists.MeshArtist.draw_vertexlabels` to use the colors of the vertex color dict.
49+
* Changed `compas_ghpython.artists.MeshArtist.draw_edgelabels` to use the colors of the edge color dict.
50+
* Changed `compas_ghpython.artists.MeshArtist.draw_facelabels` to use the colors of the face color dict.
51+
* Fixed `compas_blender.uninstall`.
52+
* Changed `planarity` to optional requirement on all platforms.
53+
* Changed `numba` to optional requirement on all platforms.
54+
* Changed raw github content path for `compas.get`.
55+
* Changed `compas.datastructures.Graph.nodes_where` to accept conditions as kwargs.
56+
* Changed `compas.datastructures.Graph.edges_where` to accept conditions as kwargs.
57+
* Changed `compas.datastructures.Halfedge.vertices_where` to accept conditions as kwargs.
58+
* Changed `compas.datastructures.Halfedge.edges_where` to accept conditions as kwargs.
59+
* Changed `compas.datastructures.Halfedge.faces_where` to accept conditions as kwargs.
60+
* Changed `compas.datastructures.Halfface.vertices_where` to accept conditions as kwargs.
61+
* Changed `compas.datastructures.Halfface.edges_where` to accept conditions as kwargs.
62+
* Changed `compas.datastructures.Halfface.faces_where` to accept conditions as kwargs.
63+
* Changed `compas.datastructures.Halfface.cells_where` to accept conditions as kwargs.
64+
* Fixed `compas_blender.artists.VolMeshArtist.draw` and `compas_blender.artists.VolMeshArtist.draw_cells`.
65+
* Fixed `compas_ghpython.artists.VolMeshArtist.draw` and `compas_ghpython.artists.VolMeshArtist.draw_cells`.
66+
* Fixed `compas_rhino.artists.VolMeshArtist.draw` and `compas_rhino.artists.VolMeshArtist.draw_cells`.
67+
* Improved error messages when artist instance cannot be created.
68+
* Fixed exception when calculating geometry of `compas.datastructures.Part` without features.
69+
* Fixed bug in `compas_rhino.conversions.RhinoCurve.to_compas`.
70+
* Fixed bug in `compas_rhino.conversions.RhinoSurface.to_compas`.
71+
72+
### Removed
73+
74+
* Removed `compas.numerical.drx`.
75+
76+
1977
## [1.14.1] 2022-02-16
2078

2179
### Added
@@ -87,14 +145,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
87145

88146
### Removed
89147

90-
* Removed `compas.geometry.Collection`
91-
* Removed `compas.geometry.CollectionNumpy`
92-
* Removed `compas.geometry.PointCollection`
93-
* Removed `compas.geometry.PointCollectionNumpy`
94-
* Removed `compas.interop`
148+
* Removed `compas.geometry.Collection`.
149+
* Removed `compas.geometry.CollectionNumpy`.
150+
* Removed `compas.geometry.PointCollection`.
151+
* Removed `compas.geometry.PointCollectionNumpy`.
152+
* Removed `compas.interop`.
95153
* Removed `numba`; `compas.numerical.drx` will be moved to a dedicated extension package.
96154
* Removed `ezdxf` (unused).
97155
* Removed `laspy` (unused).
156+
* Removed `compas_rhino.artists.MeshArtist.draw_mesh`.
157+
* Removed `compas_blender.artists.MeshArtist.draw_mesh`.
98158

99159
## [1.13.3] 2021-12-17
100160

@@ -473,6 +533,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
473533
* Added `kwargs` to all child classes of `compas.data.Data`.
474534
* Added grasshopper component for drawing a frame.
475535
* Added `draw_origin` and `draw_axes`.
536+
* Added `compas.PY2`.
476537

477538
### Changed
478539

conftest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import math
44
import numpy
55

6+
from compas.geometry import allclose
7+
68

79
def pytest_ignore_collect(path):
810
if "rhino" in str(path):
@@ -34,3 +36,8 @@ def add_math(doctest_namespace):
3436
@pytest.fixture(autouse=True)
3537
def add_np(doctest_namespace):
3638
doctest_namespace["np"] = numpy
39+
40+
41+
@pytest.fixture(autouse=True)
42+
def add_allclose(doctest_namespace):
43+
doctest_namespace["allclose"] = allclose

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def patched_m2r2_setup(app):
4040
copyright = "Block Research Group - ETH Zurich"
4141
author = "Tom Van Mele"
4242

43-
release = "1.14.1"
43+
release = "1.15.0"
4444
version = ".".join(release.split(".")[0:2])
4545

4646
master_doc = "index"
@@ -74,7 +74,7 @@ def patched_m2r2_setup(app):
7474
"sphinx.ext.graphviz",
7575
"matplotlib.sphinxext.plot_directive",
7676
"m2r2",
77-
"nbsphinx",
77+
# "nbsphinx",
7878
"sphinx.ext.autodoc.typehints",
7979
"tabs"
8080
]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from compas.datastructures import Mesh
2+
from compas.artists import Artist
3+
from compas.colors import Color
4+
5+
mesh = Mesh.from_meshgrid(10, 10)
6+
7+
Artist.clear()
8+
9+
artist = Artist(mesh)
10+
artist.draw_faces(color={face: Color.pink() for face in mesh.face_sample(size=17)})
11+
12+
Artist.redraw()
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from compas.geometry import Pointcloud
2+
from compas.datastructures import Network
3+
from compas.artists import Artist
4+
from compas.colors import Color
5+
6+
network = Network.from_pointcloud(Pointcloud.from_bounds(8, 5, 3, 53))
7+
8+
node = network.node_sample(size=1)[0]
9+
nbrs = network.neighbors(node)
10+
edges = network.connected_edges(node)
11+
12+
Artist.clear()
13+
14+
artist = Artist(network)
15+
artist.draw(
16+
nodecolor={n: Color.pink() for n in [node] + nbrs},
17+
edgecolor={e: Color.pink() for e in edges}
18+
)
19+
20+
Artist.redraw()
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import random
2+
from compas.geometry import Box, Sphere, Cylinder, Cone, Capsule, Torus, Polyhedron
3+
from compas.geometry import Plane, Circle, Pointcloud
4+
from compas.geometry import Translation
5+
from compas.artists import Artist
6+
from compas.colors import Color
7+
8+
shapes = [
9+
Box.from_width_height_depth(1, 1, 1),
10+
Sphere([0, 0, 0], 0.3),
11+
Cylinder(Circle(Plane([0, 0, 0], [0, 0, 1]), 0.3), 1.0),
12+
Cone(Circle(Plane([0, 0, 0], [0, 0, 1]), 0.3), 1.0),
13+
Capsule([[0, 0, 0], [1, 0, 0]], 0.2),
14+
Torus(Plane([0, 0, 0], [0, 0, 1]), 1.0, 0.3),
15+
Polyhedron.from_platonicsolid(12)
16+
]
17+
18+
cloud = Pointcloud.from_bounds(8, 5, 3, len(shapes))
19+
20+
Artist.clear()
21+
22+
for point, shape in zip(cloud, shapes):
23+
shape.transform(Translation.from_vector(point))
24+
artist = Artist(shape)
25+
artist.draw(color=Color.from_i(random.random()))
26+
27+
Artist.redraw()
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from compas.datastructures import VolMesh
2+
from compas.artists import Artist
3+
from compas.colors import Color
4+
5+
mesh = VolMesh.from_meshgrid(dx=10, nx=10)
6+
7+
Artist.clear()
8+
9+
artist = Artist(mesh)
10+
artist.draw_cells(color={cell: Color.pink() for cell in mesh.cell_sample(size=83)})
11+
12+
Artist.redraw()

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ isort
1212
m2r2
1313
nbsphinx
1414
pydocstyle
15-
pytest >=3.2
15+
pytest <7.1
1616
sphinx_compas_theme >=0.15.18
1717
sphinx >=3.4
1818
twine

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ matplotlib >= 2.2, < 3.1; python_version >= '3.5' and python_version <= '3.7' an
1010
matplotlib >= 3.1; python_version >= '3.8' and sys_platform == 'win32'
1111
matplotlib >= 2.2; python_version >= '3.5' and sys_platform != 'win32'
1212
networkx
13-
numba
13+
# numba
1414
numpy >= 1.15.4
1515
pillow
16-
planarity ; sys_platform != 'win32'
16+
# planarity ; sys_platform != 'win32'
1717
pycollada
1818
schema
1919
scipy >= 1.1

0 commit comments

Comments
 (0)