Obtaining 3-d polygon in Matlab, by picking points.
2 ビュー (過去 30 日間)
古いコメントを表示
I need to plot am extensive framework of 3d polygons in Matlab. putting point values and then drawing is a very cumbersome task. Is there any way that I can do this thing by either picking points in 3-d (like in paintbrush) ? Or any other alternate software and then export in matlab?
0 件のコメント
回答 (3 件)
Shivaputra Narke
2014 年 2 月 2 日
NumOfPoints=10; hax=gca; axis([0 10 0 5]) [x y] =ginput(NumOfPoints); plot(x,y);
2 件のコメント
Shivaputra Narke
2014 年 2 月 2 日
Yes you can do it for 3-D also but you have to write 'ButtonDownFcn' for axes that you are going to use.That involves pretty much lengthy code.
for your second question that is viewing selected points...
use following code,
NumOfPoints=10; hax=gca; axis([0 10 0 5]) ; hold on; allX=zeros(1,NumOfPoints); allY=zeros(1,NumOfPoints); vertices=[]; for i=1:NumOfPoints [x y] =ginput(1); plot(x,y,'ro'); vertices=[vertices;x y]; end cla; plot(vertices(:,1),vertices(:,2));
Shivaputra Narke
2014 年 2 月 2 日
Hope this help you... use following code... function MainPlotPoly global POINTS POINTS=[]; hax=gca; axis([0 10 0 10 -5 5]) set(hax,'NextPlot','add'); grid on; set(hax,'ButtonDownFcn',@PlotPoly);
function PlotPoly(varargin)
global POINTS Cp=get(varargin{1},'CurrentPoint'); POINTS=[POINTS;Cp]; plot3(POINTS(:,1),POINTS(:,2),POINTS(:,3),'Marker','O');
0 件のコメント
Matt J
2014 年 2 月 2 日
編集済み: Matt J
2014 年 2 月 2 日
You can use PLOTREGION, possibly in conjunction with VERT2LCON , if you don't know the polyhedron in inequality form.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Data Exploration についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!