On 19 November 2011 00:40, Tobias Andersson <xyzto...@hotmail.com> wrote:
> First of all, hi everyone! I'm new here and hope that this is the right way
> to post bug reports. Otherwise, please inform me how to do it.
> Now, I installed octclip to find intersections between polygons and found an
> odd behaviour when sections of different polygons follow the same line.
> Also, Strange results are returned when a section "touches" a point in the
> other polygon.
> The problem is that the result in the first example should be one polygon
> and that the result in the second example should be a polygon without the
> duplicate point [2.4 2.4].
> I thank you for updating the package or advising me if I think wrong on how
> the functionality should be.
>
>
> Two example codes are shown below so that you can rerun the script
> yourselves:
> 1. Sections of different polygons follow the same line:
> % This is a script to generate a polygon and plot it in a figure and find
> intersection
> polygons(1).p = [ 2.2 2.2;
>     3.4 3.4;
>     6.3 3.4;
>     5.3 2.8;
>     3.3 2.4];
> polygons(2).p = [ 1.2 2.2;
>     3.4 3.4;
>     5.3 3.4;
>     5.3 2.8;
>   4.4 2.3;
>     3.3 1.7]+5;
> polygons(2).p = polygons(2).p + [1*ones(size(polygons(2).p,1),1)
> 0*ones(size(polygons(2).p,1),1)];
> plot(polygons(1).p(:,1),polygons(1).p(:,2),'*-');
> hold on
> plot(polygons(1).p([end 1],1),polygons(1).p([end 1],2),'*-');
>
> plot(polygons(2).p(:,1),polygons(2).p(:,2),'*-.k');
> plot(polygons(2).p([end 1],1),polygons(2).p([end 1],2),'*:k');
> hold off
> [X,Y,nPol,nInt,nPert] = _oc_polybool(polygons(2).p,polygons(1).p,'AND');
> fprintf('runPolygonShowNonIntersecting.m\n')
> fprintf('Numbers of polygons found: %i\n',nPol)
>
>
> 2. A section "touches" a point in the other polygon:
> % This is a script to generate a polygon and plot it in a figure and find
> intersection
> polygons(1).p = [ 2.2 2.2;
>     3.4 3.4;
>     6.3 3.4;
>     5.3 2.8;
>     3.3 2.4];
> polygons(2).p = [ 1.2 2.2;
>     3.4 3.4;
>     5.3 3.4;
>     5.3 2.8;
>   4.4 2.3;
>     3.3 1.7]+0.2;
> polygons(2).p = polygons(2).p + [1*ones(size(polygons(2).p,1),1)
> 0*ones(size(polygons(2).p,1),1)];
> plot(polygons(1).p(:,1),polygons(1).p(:,2),'*-');
> hold on
> plot(polygons(1).p([end 1],1),polygons(1).p([end 1],2),'*-');
>
> plot(polygons(2).p(:,1),polygons(2).p(:,2),'*-.k');
> plot(polygons(2).p([end 1],1),polygons(2).p([end 1],2),'*:k');
> hold off
> [X,Y,nPol,nInt,nPert] = _oc_polybool(polygons(2).p,polygons(1).p,'AND');
> fprintf('runPolygonShowNonIntersecting.m\n')
> fprintf('Numbers of polygons found: %i\n',nPol)

Hi Tobias

do you think you can submit a patch? Anyway, I'm also sending this
e-mail to the dev who wrote this function, he's probably the best
person to fix anything about the package.

Carnë

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to