Skip to content

Commit f28cdb8

Browse files
authored
Merge pull request #1339 from compas-dev/remove-indexed-attribute-access
Remove remaining indexed attribute access and related references in docstrings of functional API
2 parents b33feef + 05d8a4f commit f28cdb8

File tree

12 files changed

+62
-117
lines changed

12 files changed

+62
-117
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4040
* Removed default implementation of `compas.geometry.trimesh_geodistance` since nonexistent.
4141
* Removed `compas.utilities.geometric_key` and replaced it by `compas.tolerance.TOL.geometric_key`.
4242
* Removed `compas.utilities.geometric_key_xy` and replaced it by `compas.tolerance.TOL.geometric_key_xy`.
43+
* Removed indexed attribute access from all geometry classes except `Point`, `Vector`, `Line`, `Polygon`, `Polyline`.
4344

4445
## [2.1.0] 2024-03-01
4546

src/compas/geometry/_core/_algebra.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2347,7 +2347,7 @@ def matrix_from_orthogonal_projection(plane):
23472347
23482348
Parameters
23492349
----------
2350-
plane : [point, normal] | :class:`compas.geometry.Plane`
2350+
plane : [point, normal]
23512351
The plane to project onto.
23522352
23532353
Returns
@@ -2380,7 +2380,7 @@ def matrix_from_parallel_projection(plane, direction):
23802380
23812381
Parameters
23822382
----------
2383-
plane : [point, normal] | :class:`compas.geometry.Plane`
2383+
plane : [point, normal]
23842384
The plane to project onto.
23852385
direction : [float, float, float] | :class:`compas.geometry.Vector`
23862386
Direction of the projection.
@@ -2417,7 +2417,7 @@ def matrix_from_perspective_projection(plane, center_of_projection):
24172417
24182418
Parameters
24192419
----------
2420-
plane : [point, normal] | :class:`compas.geometry.Plane`
2420+
plane : [point, normal]
24212421
The plane to project onto.
24222422
center_of_projection : [float, float, float] | :class:`compas.geometry.Point`
24232423
The camera view point.

src/compas/geometry/_core/angles.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,9 @@ def angle_planes(a, b, deg=False):
384384
385385
Parameters
386386
----------
387-
a : [point, vector] | :class:`compas.geometry.Plane`
387+
a : [point, vector]
388388
The first plane.
389-
b : [point, vector] | :class:`compas.geometry.Plane`
389+
b : [point, vector]
390390
The second plane.
391391
deg : bool, optional
392392
If True, returns the angle in degrees.

src/compas/geometry/_core/distance.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ def distance_point_plane(point, plane):
298298
----------
299299
point : [float, float, float] | :class:`compas.geometry.Point`
300300
Point coordinates.
301-
plane : [point, vector] | :class:`compas.geometry.Plane`
301+
plane : [point, vector]
302302
A point and a vector defining a plane.
303303
304304
Returns
@@ -353,7 +353,7 @@ def distance_point_plane_signed(point, plane):
353353
----------
354354
point : [float, float, float] | :class:`compas.geometry.Point`
355355
Point coordinates.
356-
plane : [point, vector] | :class:`compas.geometry.Plane`
356+
plane : [point, vector]
357357
A point and a vector defining a plane.
358358
359359
Returns
@@ -838,7 +838,7 @@ def closest_point_on_plane(point, plane):
838838
----------
839839
point : [float, float, float] | :class:`compas.geometry.Point`
840840
XYZ coordinates of point.
841-
plane : [point, vector] | :class:`compas.geometry.Plane`
841+
plane : [point, vector]
842842
The base point and normal defining the plane.
843843
844844
Returns

src/compas/geometry/_core/predicates_2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ def is_point_in_circle_xy(point, circle):
451451
----------
452452
point : [float, float, float] | :class:`compas.geometry.Point`
453453
XY(Z) coordinates of a point (Z will be ignored).
454-
circle : [[point, vector], float] | :class:`compas.geometry.Circle`
454+
circle : [[point, vector], float]
455455
Center and radius of the circle on the XY plane.
456456
457457
Returns

src/compas/geometry/_core/predicates_3.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,9 @@ def is_parallel_plane_plane(plane1, plane2, tol=None):
237237
238238
Parameters
239239
----------
240-
plane1 : [point, vector] | :class:`compas.geometry.Plane`
240+
plane1 : [point, vector]
241241
Plane 1.
242-
plane2 : [point, vector] | :class:`compas.geometry.Plane`
242+
plane2 : [point, vector]
243243
Plane 2.
244244
tol : float, optional
245245
A tolerance for verifying parallelity of the plane normals.
@@ -333,9 +333,9 @@ def is_perpendicular_plane_plane(plane1, plane2, tol=None):
333333
334334
Parameters
335335
----------
336-
plane1 : [point, vector] | :class:`compas.geometry.Plane`
336+
plane1 : [point, vector]
337337
Plane 1.
338-
plane2 : [point, vector] | :class:`compas.geometry.Plane`
338+
plane2 : [point, vector]
339339
Plane 2.
340340
tol : float, optional
341341
A tolerance for verifying perpendicularity of the plane normals.
@@ -425,7 +425,7 @@ def is_polyhedron_convex(polyhedron):
425425
426426
Parameters
427427
----------
428-
polyhedron : [sequence[point], sequence[sequence[int]]] | :class:`compas.geometry.Polyhedron`
428+
polyhedron : [sequence[point], sequence[sequence[int]]]
429429
A polyhedron defined by a sequence of points
430430
and a sequence of faces, with each face defined as a sequence of indices into the sequence of points.
431431
@@ -480,7 +480,7 @@ def is_point_on_plane(point, plane, tol=None):
480480
----------
481481
point : [float, float, float] | :class:`compas.geometry.Point`
482482
A point.
483-
plane : [point, vector] | :class:`compas.geometry.Plane`
483+
plane : [point, vector]
484484
A plane.
485485
tol : float, optional
486486
Tolerance for comparing the distance between the point and the plane to zero.
@@ -812,7 +812,7 @@ def is_point_in_polyhedron(point, polyhedron, tol=None):
812812
----------
813813
point : [float, float, float] | :class:`compas.geometry.Point`
814814
The test point.
815-
polyhedron : [sequence[point], sequence[sequence[int]]] | :class:`compas.geometry.Polyhedron`.
815+
polyhedron : [sequence[point], sequence[sequence[int]]]
816816
The polyhedron defined by a sequence of points
817817
and a sequence of faces, with each face defined as a sequence of indices into the sequence of points.
818818
@@ -836,7 +836,7 @@ def is_point_infrontof_plane(point, plane, tol=None):
836836
----------
837837
point : [float, float, float] | :class:`compas.geometry.Point`
838838
A point.
839-
plane : [point, vector] | :class:`compas.geometry.Plane`
839+
plane : [point, vector]
840840
A plane.
841841
tol : float, optional
842842
A tolerance for membership verification.
@@ -858,7 +858,7 @@ def is_point_behind_plane(point, plane, tol=None):
858858
----------
859859
point : [float, float, float] | :class:`compas.geometry.Point`
860860
A point.
861-
plane : [point, normal] | :class:`compas.geometry.Plane`
861+
plane : [point, normal]
862862
A plane.
863863
tol : float, optional
864864
A tolerance for membership verification.
@@ -1025,7 +1025,7 @@ def is_point_behind_plane(point, plane, tol=None):
10251025
# ----------
10261026
# line : [point, point] | :class:`compas.geometry.Line`
10271027
# A line.
1028-
# plane : [point, vector] | :class:`compas.geometry.Plane`
1028+
# plane : [point, vector]
10291029
# A plane.
10301030
# tol : float, optional
10311031
# A tolerance for intersection verification.
@@ -1056,7 +1056,7 @@ def is_point_behind_plane(point, plane, tol=None):
10561056
# ----------
10571057
# segment : [point, point] | :class:`compas.geometry.Line`
10581058
# A line segment.
1059-
# plane : [point, vector] | :class:`compas.geometry.Plane`
1059+
# plane : [point, vector]
10601060
# A plane.
10611061
# tol : float, optional
10621062
# A tolerance for intersection verification.
@@ -1091,9 +1091,9 @@ def is_point_behind_plane(point, plane, tol=None):
10911091

10921092
# Parameters
10931093
# ----------
1094-
# plane1 : [point, vector] | :class:`compas.geometry.Plane`
1094+
# plane1 : [point, vector]
10951095
# A plane.
1096-
# plane2 : [point, vector] | :class:`compas.geometry.Plane`
1096+
# plane2 : [point, vector]
10971097
# A plane.
10981098
# tol : float, optional
10991099
# A tolerance for intersection verification.

src/compas/geometry/_core/tangent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def tangent_points_to_circle_xy(circle, point):
1010
1111
Parameters
1212
----------
13-
circle : [plane, float] | :class:`compas.geometry.Circle`
13+
circle : [plane, float]
1414
Plane and radius of the circle.
1515
point : [float, float] or [float, float, float] | :class:`compas.geometry.Point`
1616
XY(Z) coordinates of a point in the xy plane.

src/compas/geometry/_core/transformations.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def homogenize_and_flatten_frames(frames):
139139
140140
Parameters
141141
----------
142-
frames : sequence[[point, vector, vector] | :class:`compas.geometry.Frame`]
142+
frames : sequence[[point, vector, vector]]
143143
144144
Returns
145145
-------
@@ -245,7 +245,7 @@ def transform_frames(frames, T):
245245
246246
Parameters
247247
----------
248-
frames : sequence[[point, vector, vector] | :class:`compas.geometry.Frame`]
248+
frames : sequence[[point, vector, vector]]
249249
A list of frames to be transformed.
250250
T : list[list[float]] | :class:`compas.geometry.Transformation`
251251
The transformation to apply on the frames.
@@ -272,7 +272,7 @@ def world_to_local_coordinates(frame, xyz):
272272
273273
Parameters
274274
----------
275-
frame : [point, vector, vector] | :class:`compas.geometry.Frame`
275+
frame : [point, vector, vector]
276276
The local coordinate system.
277277
xyz : array-like[[float, float, float] | :class:`compas.geometry.Point`]
278278
The global coordinates of the points to convert.
@@ -302,7 +302,7 @@ def local_to_world_coordinates(frame, xyz):
302302
303303
Parameters
304304
----------
305-
frame : [point, vector, vector] | :class:`compas.geometry.Frame`
305+
frame : [point, vector, vector]
306306
The local coordinate system.
307307
xyz : array-like[[float, float, float] | :class:`compas.geometry.Point`]
308308
The global coordinates of the points to convert.
@@ -714,7 +714,7 @@ def mirror_point_plane(point, plane):
714714
----------
715715
point : list[float]
716716
XYZ coordinates of mirror point.
717-
plane : [point, vector] | :class:`compas.geometry.Plane`
717+
plane : [point, vector]
718718
Base point and normal defining the mirror plane.
719719
720720
Returns
@@ -734,7 +734,7 @@ def mirror_points_plane(points, plane):
734734
----------
735735
points : sequence[[float, float, float] | :class:`compas.geometry.Point`]
736736
List of points to mirror.
737-
plane : [point, vector] | :class:`compas.geometry.Plane`
737+
plane : [point, vector]
738738
Base point and normal defining the mirror plane.
739739
740740
Returns
@@ -760,7 +760,7 @@ def project_point_plane(point, plane):
760760
----------
761761
point : [float, float, float] | :class:`compas.geometry.Point`
762762
XYZ coordinates of the point.
763-
plane : [point, vector] | :class:`compas.geometry.Plane`
763+
plane : [point, vector]
764764
Base point and normal vector defining the projection plane.
765765
766766
Returns
@@ -802,7 +802,7 @@ def project_points_plane(points, plane):
802802
----------
803803
points : sequence[[float, float, float] | :class:`compas.geometry.Point`]
804804
List of points.
805-
plane : [point, vector] | :class:`compas.geometry.Plane`
805+
plane : [point, vector]
806806
Base point and normal vector defining the projection plane.
807807
808808
Returns
@@ -951,7 +951,7 @@ def reflect_line_plane(line, plane, tol=None):
951951
----------
952952
line : [point, point] | :class:`compas.geometry.Line`
953953
Two points defining the line.
954-
plane : [point, vector] | :class:`compas.geometry.Plane`
954+
plane : [point, vector]
955955
Base point and normal vector of the plane.
956956
tol : float, optional
957957
A tolerance for finding the intersection between the line and the plane.
@@ -1066,11 +1066,11 @@ def orient_points(points, reference_plane, target_plane):
10661066
10671067
Parameters
10681068
----------
1069-
points : sequence[[float, float, float] | :class:`compas.geometry.Point`]s
1069+
points : sequence[[float, float, float] | :class:`compas.geometry.Point`]
10701070
XYZ coordinates of the points.
1071-
reference_plane : [point, vector] | :class:`compas.geometry.Plane`
1071+
reference_plane : [point, vector]
10721072
Base point and normal defining a reference plane.
1073-
target_plane : [point, vector] | :class:`compas.geometry.Plane`
1073+
target_plane : [point, vector]
10741074
Base point and normal defining a target plane.
10751075
10761076
Returns

src/compas/geometry/_core/transformations_numpy.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def transform_frames_numpy(frames, T):
6969
7070
Parameters
7171
----------
72-
frames : sequence[[point, vector, vector] | :class:`compas.geometry.Frame`]
72+
frames : sequence[[point, vector, vector]]
7373
A list of frames to be transformed.
7474
T : :class:`compas.geometry.Transformation`
7575
The transformation to apply on the frames.
@@ -97,7 +97,7 @@ def world_to_local_coordinates_numpy(frame, xyz):
9797
9898
Parameters
9999
----------
100-
frame : [point, vector, vector] | :class:`compas.geometry.Frame`
100+
frame : [point, vector, vector]
101101
The local coordinate system.
102102
xyz : array-like[[float, float, float] | :class:`compas.geometry.Point`]
103103
The global coordinates of the points to convert.
@@ -130,7 +130,7 @@ def local_to_world_coordinates_numpy(frame, rst):
130130
131131
Parameters
132132
----------
133-
frame : [point, vector, vector] | :class:`compas.geometry.Frame`
133+
frame : [point, vector, vector]
134134
The local coordinate system.
135135
rst : array-like[[float, float, float] | :class:`compas.geometry.Point`]
136136
The coordinates of the points wrt the local coordinate system.
@@ -231,7 +231,7 @@ def homogenize_and_flatten_frames_numpy(frames):
231231
232232
Parameters
233233
----------
234-
frames : array_like[[point, vector, vector] | :class:`compas.geometry.Frame`]
234+
frames : array_like[[point, vector, vector]]
235235
The input frames.
236236
237237
Returns

0 commit comments

Comments
 (0)