• 大小: 119KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-01-03
  • 语言: Matlab
  • 标签:

资源简介

可以实现任意多边形定点参数输入然后使用SutherlandHodgeman等算法进行多边形被矩形截

资源截图

代码片段和文件信息

function p0=findmiddlepoint(p1p2zonepoint)
p0=(p1+p2)/2;   %find the middle point;
codep0=getzonecode(zonepointp0);
codep1=getzonecode(zonepointp1);
codep2=getzonecode(zonepointp2);
while codep0~=0     %if the middle point is not in the area continue to find it
    p0=(p1+p2)/2;   %find the middle point;
    codep0=getzonecode(zonepointp0);
    if codep0==0    %this point is in the area break;
        break;
    else    %this p0 is not in the area
        judge1=bitand(codep0codep1);
        if judge1~=0     %means the p1 can be replaced by p0
            p1=p0;
        else p2=p0;
        end
    end
end
        

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      66048  2007-11-09 00:35  polygon_cut\Cyrus-Beck算法截取线段.vsd

     文件        647  2007-11-09 14:55  polygon_cut\findmiddlepoint.asv

     文件        647  2007-11-09 17:07  polygon_cut\findmiddlepoint.m

     文件        558  2007-11-09 16:12  polygon_cut\getzonecode.m

     文件        833  2007-11-09 16:48  polygon_cut\intersectp.asv

     文件        838  2007-11-09 16:48  polygon_cut\intersectp.m

     文件       9736  2007-11-09 21:36  polygon_cut\Polygoncutter.asv

     文件       4197  2007-11-09 21:14  polygon_cut\Polygoncutter.fig

     文件       9790  2007-11-09 22:03  polygon_cut\Polygoncutter.m

     文件      58880  2007-11-09 01:07  polygon_cut\Sutherland-Hodgman多边形剪裁流程框图.vsd

     文件       1361  2007-11-09 19:55  polygon_cut\Sutherland_Hodgeman_Algorithum.asv

     文件       1361  2007-11-09 19:55  polygon_cut\Sutherland_Hodgeman_Algorithum.m

     文件      74752  2007-11-09 16:53  polygon_cut\中点法截取线段流程图.vsd

     文件      29696  2007-11-09 21:43  polygon_cut\计算机图形学第三次作业Readme.doc

     目录          0  2007-11-13 18:25  polygon_cut

     文件        218  2007-06-05 03:14  www.pudn.com.txt

----------- ---------  ---------- -----  ----

               259562                    16


评论

共有 条评论

相关资源