@@ -1062,7 +1062,7 @@ def intersect_volume(self, bounds):
1062
1062
# PLOT AND DISPLAY
1063
1063
# ------------------------------------------------------------------------- #
1064
1064
1065
- def plot (self , * pos , bounds = None , axis = None , ** kwargs ):
1065
+ def plot (self , * pos , bounds = None , ax = None , ** kwargs ):
1066
1066
"""
1067
1067
Plot a line
1068
1068
@@ -1087,23 +1087,17 @@ def plot(self, *pos, bounds=None, axis=None, **kwargs):
1087
1087
1088
1088
:seealso: Plucker.intersect_volume
1089
1089
"""
1090
- if axis is None :
1090
+ if ax is None :
1091
1091
ax = plt .gca ()
1092
- else :
1093
- ax = axis
1094
1092
1093
+ print (ax )
1095
1094
if bounds is None :
1096
1095
bounds = np .r_ [ax .get_xlim (), ax .get_ylim (), ax .get_zlim ()]
1097
1096
else :
1098
1097
bounds = base .getvector (bounds , 6 )
1099
1098
ax .set_xlim (bounds [:2 ])
1100
1099
ax .set_ylim (bounds [2 :4 ])
1101
1100
ax .set_zlim (bounds [4 :6 ])
1102
-
1103
- # print(bounds)
1104
-
1105
- #U = self.Q - self.P;
1106
- #line.p = self.P; line.v = unit(U);
1107
1101
1108
1102
lines = []
1109
1103
for line in self :
@@ -1194,21 +1188,21 @@ def _repr_pretty_(self, p, cycle):
1194
1188
# z = L1([1 5 2 6 3 4]) * L2([5 1 6 2 4 3])';
1195
1189
# end
1196
1190
1197
- #
1198
- # function z = intersect(self1, pl2)
1199
- # Plucker.intersect Line intersection
1200
- #
1201
- # PL1.intersect(self2) is zero if the lines intersect. It is positive if PL2
1202
- # passes counterclockwise and negative if PL2 passes clockwise. Defined as
1203
- # looking in direction of PL1
1204
- #
1205
- # ---------->
1206
- # o o
1207
- # ---------->
1208
- # counterclockwise clockwise
1209
- #
1210
- # z = dot(self1.w, pl1.v) + dot(self2.w, pl2.v);
1211
- # end
1191
+ def side ( self , other ):
1192
+ """
1193
+ Plucker side operator
1194
+
1195
+ :param other: second line
1196
+ :type other: Line3
1197
+ :return: permuted dot product
1198
+ :rtype: float
1199
+
1200
+ This permuted dot product operator is zero whenever the lines intersect or are parallel.
1201
+ """
1202
+ if not isinstance ( other , Line3 ):
1203
+ raise ValueError ( 'argument must be a Line3' )
1204
+
1205
+ return np . dot ( self . A [[ 0 , 4 , 1 , 5 , 2 , 3 ]], other . A [ 4 , 0 , 5 , 1 , 3 , 2 ])
1212
1206
1213
1207
# Static factory methods for constructors from exotic representations
1214
1208
0 commit comments