Skip to content

Commit f8ac59b

Browse files
committed
rename draw_geometry to create_geometry
1 parent 47d4caa commit f8ac59b

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
524524
* Integrated mixin functionality and removed mixins.
525525
* Meshes are now initially hidden in `compas_blender.artists.RobotModelArtist`.
526526
* `compas_blender.artists.RobotModelArtist.draw_visual` and `compas_blender.artists.RobotModelArtist.draw_collision` now show those meshes.
527+
* Renamed the method `draw_geometry` of `compas.robots.base_artist.RobotModelBaseArtist` to `create_geometry`.
527528

528529
### Removed
529530

src/compas/robots/base_artist/_artist.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ def transform(self, geometry, transformation):
2222
Parameters
2323
----------
2424
geometry : object
25-
A CAD-specific (i.e. native) geometry object as returned by :meth:`draw_geometry`.
25+
A CAD-specific (i.e. native) geometry object as returned by :meth:`create_geometry`.
2626
transformation : `Transformation`
2727
**COMPAS** transformation to update the geometry object.
2828
"""
2929
raise NotImplementedError
3030

31-
def draw_geometry(self, geometry, name=None, color=None):
31+
def create_geoemetry(self, geometry, name=None, color=None):
3232
"""Draw a **COMPAS** geometry in the respective CAD environment.
3333
3434
Note
@@ -60,7 +60,7 @@ class BaseRobotModelArtist(AbstractRobotModelArtist):
6060
6161
There are two methods that implementers of this base class should provide, one
6262
is concerned with the actual creation of geometry in the native format of the
63-
CAD environment (:meth:`draw_geometry`) and the other is one to apply a transformation
63+
CAD environment (:meth:`create_geometry`) and the other is one to apply a transformation
6464
to geometry (:meth:`transform`).
6565
6666
Attributes
@@ -117,7 +117,7 @@ def detach_tool_model(self):
117117
def create(self, link=None, context=None):
118118
"""Recursive function that triggers the drawing of the robot model's geometry.
119119
120-
This method delegates the geometry drawing to the :meth:`draw_geometry`
120+
This method delegates the geometry drawing to the :meth:`create_geometry`
121121
method. It transforms the geometry based on the saved initial
122122
transformation from the robot model.
123123
@@ -150,7 +150,7 @@ def create(self, link=None, context=None):
150150
else:
151151
mesh_name_components = [self.model.name, mesh_type, context, link.name, str(i)]
152152
mesh_name = '.'.join(mesh_name_components)
153-
native_mesh = self.draw_geometry(mesh, name=mesh_name, color=color)
153+
native_mesh = self.create_geoemetry(mesh, name=mesh_name, color=color)
154154

155155
self.transform(native_mesh, item.init_transformation)
156156

src/compas_blender/artists/robotmodelartist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __init__(self, model, layer=None):
2727
def transform(self, native_mesh, transformation):
2828
native_mesh.matrix_world @= mathutils.Matrix(transformation.matrix)
2929

30-
def draw_geometry(self, geometry, name=None, color=None):
30+
def create_geoemetry(self, geometry, name=None, color=None):
3131
# Imported colors take priority over a the parameter color
3232
if 'mesh_color.diffuse' in geometry.attributes:
3333
color = geometry.attributes['mesh_color.diffuse']

src/compas_ghpython/artists/robotmodelartist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def __init__(self, model):
3030
def transform(self, native_mesh, transformation):
3131
xtransform(native_mesh, transformation)
3232

33-
def draw_geometry(self, geometry, name=None, color=None):
33+
def create_geoemetry(self, geometry, name=None, color=None):
3434
if color:
3535
color = rgb_to_rgb(color[0], color[1], color[2])
3636
vertices, faces = geometry.to_vertices_and_faces()

src/compas_rhino/artists/robotmodelartist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def transform(self, native_mesh, transformation):
4343
T = xform_from_transformation(transformation)
4444
native_mesh.Transform(T)
4545

46-
def draw_geometry(self, geometry, name=None, color=None):
46+
def create_geoemetry(self, geometry, name=None, color=None):
4747
# Imported colors take priority over a the parameter color
4848
if 'mesh_color.diffuse' in geometry.attributes:
4949
color = geometry.attributes['mesh_color.diffuse']

0 commit comments

Comments
 (0)