Skip to content

Commit

Permalink
Support plotting a vector Plucker objects
Browse files Browse the repository at this point in the history
  • Loading branch information
petercorke committed Nov 18, 2018
1 parent 6806698 commit 7e4494a
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions Plucker.m
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@
% PLOT AND DISPLAY
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function plot(pl, varargin)
function plot(lines, varargin)
%Plucker.plot Plot a line
%
% PL.plot(OPTIONS) plots the Plucker line within the current plot volume.
Expand Down Expand Up @@ -586,14 +586,21 @@ function plot(pl, varargin)

%U = pl.Q - pl.P;
%line.p = pl.P; line.v = unit(U);
P = pl.intersect_volume(bounds);

if isempty(P)
error('RTB:Plucker', 'line does not intersect the plot volume');
else
plot3(P(1,:), P(2,:), P(3,:), varargin{:});
ish = ishold();
hold on
for pl=lines
P = pl.intersect_volume(bounds);

if isempty(P)
warning('RTB:Plucker', 'line does not intersect the plot volume');
else
plot3(P(1,:), P(2,:), P(3,:), varargin{:});
end
end
if ~ish
hold off
end

end


Expand Down

0 comments on commit 7e4494a

Please sign in to comment.