Skip to content

Commit 2b77263

Browse files
authored
Merge branch 'main' into install
2 parents 821d0ba + b49ad2c commit 2b77263

Some content is hidden

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

45 files changed

+1180
-503
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.12.2
2+
current_version = 1.13.2
33
message = Bump version to {new_version}
44
commit = True
55
tag = True

CHANGELOG.md

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,57 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
* Added `compas_plotters.artists.NetworkArtist.draw_nodelabels`.
13+
* Added `compas_plotters.artists.NetworkArtist.draw_edgelabels`.
14+
* Added `compas_plotters.Plotter.fontsize`.
15+
* Added `INSTALLED_VERSION` variable to `compas_rhino.install` to interally inform rhino version context post-installation steps.
16+
17+
### Changed
18+
19+
* Fixed bug in inheritance of `compas_plotters.artists.NetworkArtist`.
20+
* Changed `compas_plotters.artists.MeshArtist.draw_edges` to ignore edge direction for assignment of edge colors and widths.
21+
* Changed `compas_plotters.artists.MeshArtist.draw_vertexlabels` to use `compas_plotters.Plotter.fontsize`.
22+
* Changed `compas_plotters.artists.MeshArtist.draw_edgelabels` to use `compas_plotters.Plotter.fontsize`.
23+
* Changed `compas_plotters.artists.MeshArtist.draw_facelabels` to use `compas_plotters.Plotter.fontsize`.
24+
25+
### Removed
26+
27+
28+
## [1.13.2] 2021-12-11
29+
30+
### Added
31+
32+
* Added `compas_ghpython.fetch_ghio_lib` to simplify the loading of Grasshopper's IO library for extension developers.
33+
34+
### Changed
35+
36+
### Removed
37+
38+
39+
## [1.13.1] 2021-12-11
40+
41+
### Added
42+
43+
### Changed
44+
45+
* Fixed bug in `Grasshopper` plugin path on Windows.
46+
* Fixed bug in `Grasshopper` `UserObjects` uninstall.
47+
48+
### Removed
49+
50+
51+
## [1.13.0] 2021-12-10
52+
53+
### Added
54+
1255
* Added `compas_rhino.DEFAULT_VERSION`.
1356
* Added `clean` option to `compas_rhino.install` to remove existing symlinks if they cannot be imported from the current environment.
14-
* Added `INSTALLED_VERSION` variable to `compas_rhino.install` to interally inform rhino version context post-installation steps.
57+
* Added basic implementation of `compas.datastructures.Assembly`.
58+
* Added `compas.is_grasshopper`.
59+
* Added `compas.GH`.
60+
* Added `compas.artists.Artist.CONTEXT`.
61+
* Added `compas.artists.Artist.AVAILABLE_CONTEXTS`.
62+
* Added `compas.artists.artist.register_artists` pluggable.
1563

1664
### Changed
1765

@@ -20,15 +68,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2068
* Fixed error in parameter list of `compas_rhino.geometry.curves.new_nurbscurve`.
2169
* Fixed error in parameter list of `compas_rhino.geometry.curves.new_nurbscurve_from_interpolation`.
2270
* Fixed error in parameter list of `compas_rhino.geometry.curves.new_nurbscurve_from_step`.
23-
2471
* Changed `compas_rhino.install` to remove broken symlinks.
2572
* Changed `compas_rhino.install` to reinstall broken symlinks if they can be imported from the current environment.
2673
* Changed `compas_rhino.uninstall` to remove broken symlinks.
2774
* Changed `compas_rhino.install_plugin` to remove broken symlinks.
2875
* Changed default Rhino version for installation to `7.0`.
76+
* Fixed bug in `compas_ghpython` related to importing `Grasshopper` prematurely.
77+
* Changed `compas.artists.Artist.ITEM_ARTIST` to context-based dict.
78+
* Changed `compas_rhino.__init__.py` functions.
79+
* Changed `compas_ghpython.__init__.py` functions.
80+
* Renamed `compas_ghpython.get_grasshopper_plugin_path` to `compas_ghpython.get_grasshopper_managedplugin_path`.
2981

3082
### Removed
3183

84+
* Removed `compas.artists.artist.new_artist` pluggable.
85+
3286

3387
## [1.12.2] 2021-11-30
3488

@@ -242,6 +296,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
242296
* Added `compas_rhino.geometry.RhinoCylinder`.
243297
* Added `compas_rhino.geometry.RhinoPolyline`.
244298
* Added `compas_rhino.geometry.RhinoSphere`.
299+
* Added basic implementation of `compas.datastructures.Assembly`.
245300
* Added `meshes` method to artists of `compas.robots.RobotModel`.
246301
* Added `FrameArtist` class to `compas_blender`.
247302

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def patched_m2r2_setup(app):
3636
copyright = "Block Research Group - ETH Zurich"
3737
author = "Tom Van Mele"
3838

39-
release = "1.12.2"
39+
release = "1.13.2"
4040
version = ".".join(release.split(".")[0:2])
4141

4242
master_doc = "index"

docs/tutorial/assembly.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
**********
2+
Assemblies
3+
**********
4+
5+
.. rst-class:: lead
6+
7+
The :class:`Assembly` data structure provides functionality for modelling and managing
8+
the connections between the individual components of an ... assembly.
9+
Each component is either a part defined by geometrical objects, or another assembly.
10+
11+
12+
Basic Usage
13+
===========
14+
15+
.. code-block:: python
16+
17+
from compas.datastructures import Part
18+
from compas.datastructures import Assembly
19+
from compas.geometry import Box
20+
21+
assembly = Assembly()
22+
23+
24+
Find Parts
25+
==========
26+
27+
.. code-block:: python
28+
29+
pass
30+
31+
32+
Access Data
33+
===========
34+
35+
.. code-block:: python
36+
37+
pass

docs/tutorial/assembly_blocks.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
from math import radians
2+
3+
from compas.datastructures import Assembly
4+
from compas.datastructures import Part
5+
from compas.geometry import Box
6+
from compas.geometry import Cylinder
7+
from compas.geometry import Circle
8+
from compas.geometry import Plane
9+
from compas.geometry import Translation
10+
from compas.geometry import Rotation
11+
from compas.geometry import Frame
12+
13+
from compas_view2.app import App
14+
15+
assembly = Assembly()
16+
17+
a = Part(name='A',
18+
geometry=Box.from_width_height_depth(1, 1, 1))
19+
20+
b = Part(name='B',
21+
frame=Frame([0, 0, 1], [1, 0, 0], [0, 1, 0]),
22+
shape=Box.from_width_height_depth(1, 1, 1),
23+
features=[(Cylinder(Circle(Plane.worldXY(), 0.2), 1.0), 'difference')])
24+
25+
b.transform(Rotation.from_axis_and_angle([0, 0, 1], radians(45)))
26+
b.transform(Translation.from_vector([0, 0, 1]))
27+
28+
assembly.add_part(a)
29+
assembly.add_part(b)
30+
31+
assembly.add_connection(a, b)
32+
33+
viewer = App()
34+
viewer.add(b.geometry)
35+
viewer.add(b.frame)
36+
viewer.show()

docs/tutorial/assembly_robot.py

Whitespace-only changes.

docs/tutorial/assembly_splines.py

Whitespace-only changes.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def read(*names, **kwargs):
2525

2626
setup(
2727
name='COMPAS',
28-
version='1.12.2',
28+
version='1.13.2',
2929
description='The COMPAS framework',
3030
long_description=long_description,
3131
long_description_content_type='text/markdown',

src/compas/__init__.py

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -21,57 +21,6 @@
2121
compas.topology
2222
compas.utilities
2323
24-
Utility functions
25-
=================
26-
27-
JSON handling
28-
-------------
29-
30-
.. autofunction:: json_dump
31-
32-
.. autofunction:: json_dumps
33-
34-
.. autofunction:: json_load
35-
36-
.. autofunction:: json_loads
37-
38-
Precision
39-
---------
40-
41-
.. autofunction:: set_precision
42-
43-
.. autodata:: PRECISION
44-
45-
Execution context
46-
-----------------
47-
48-
.. autofunction:: is_windows
49-
50-
.. autofunction:: is_linux
51-
52-
.. autofunction:: is_osx
53-
54-
.. autofunction:: is_mono
55-
56-
.. autofunction:: is_ironpython
57-
58-
.. autofunction:: is_rhino
59-
60-
.. autofunction:: is_blender
61-
62-
.. autodata:: WINDOWS
63-
64-
.. autodata:: LINUX
65-
66-
.. autodata:: OSX
67-
68-
.. autodata:: MONO
69-
70-
.. autodata:: IPY
71-
72-
.. autodata:: RHINO
73-
74-
.. autodata:: BLENDER
7524
7625
"""
7726
from __future__ import print_function
@@ -82,7 +31,7 @@
8231
from distutils.version import LooseVersion
8332

8433
import compas._os
85-
from compas._os import is_windows, is_linux, is_osx, is_mono, is_ironpython, is_rhino, is_blender
34+
from compas._os import is_windows, is_linux, is_osx, is_mono, is_ironpython, is_rhino, is_blender, is_grasshopper # noqa: F401
8635
from compas.data import json_dump, json_dumps, json_load, json_loads
8736

8837

@@ -91,7 +40,7 @@
9140
__license__ = 'MIT License'
9241
__email__ = '[email protected]'
9342

94-
__version__ = '1.12.2'
43+
__version__ = '1.13.2'
9544

9645
version = LooseVersion(compas.__version__)
9746
versionstring = version.vstring.split('-')[0]

src/compas/_os.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ class NotADirectoryError(Exception):
3737
'is_mono',
3838
'is_ironpython',
3939
'is_rhino',
40-
'is_blender'
40+
'is_blender',
41+
'is_grasshopper'
4142
]
4243

4344

@@ -100,17 +101,24 @@ def is_rhino():
100101
import Rhino # noqa : F401
101102
except ImportError:
102103
return False
103-
else:
104-
return True
104+
return True
105+
106+
107+
def is_grasshopper():
108+
try:
109+
import Rhino
110+
import scriptcontext
111+
except ImportError:
112+
return False
113+
return not isinstance(scriptcontext.doc, Rhino.RhinoDoc)
105114

106115

107116
def is_blender():
108117
try:
109118
import bpy # noqa : F401
110119
except ImportError:
111120
return False
112-
else:
113-
return True
121+
return True
114122

115123

116124
if is_windows():

0 commit comments

Comments
 (0)