octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #63221] Function PolyBool crashes Octave with


From: Gerrard Hickson
Subject: [Octave-bug-tracker] [bug #63221] Function PolyBool crashes Octave with certain polygon input combinations
Date: Sun, 16 Oct 2022 03:58:54 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?63221>

                 Summary: Function PolyBool crashes Octave with certain
polygon input combinations
                 Project: GNU Octave
               Submitter: ghick
               Submitted: Sun 16 Oct 2022 07:58:52 AM UTC
                Category: Octave Forge Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: Gerrard Hickson
        Originator Email: 
             Open/Closed: Open
                 Release: 7.2.0
         Discussion Lock: Any
        Operating System: Microsoft Windows


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Sun 16 Oct 2022 07:58:52 AM UTC By: Gerrard Hickson <ghick>
Certain combination of polygon verticies cause crashes when using the polybool
function.

The code below is an adaption from the function documentation, and this causes
a crash.

clc
clf
pkg load octclip

%subject polygon
  clSub = [0.0 0.0
           40.0 0.0
           40.0 10.0
           0.0 10.0
           0.0 0.0];
  %clipper polygon
  clClip = [0.0 0.0
            6.0 0.0
            6.0 2.0
            0.0 3.0
            0.0 0.0];
  %limits for the plots
  clXLim = [1.5 11.75];
  clYLim = [0.5  8.50];



  %compute A-B
  [pA,detA] = oc_polybool(clSub,clClip,'ab');

  %plotting
  figure(1);
  %plot window for original data
  subplot(2,1,1);
  plot(clSub(:,1),clSub(:,2),clClip(:,1),clClip(:,2));
  axis('equal');
  %xlim(clXLim);
  %ylim(clYLim);
  title('Original polygons');
  legend('Subject polygon','Clipper polygon','location','southeast');

  %plot window for A-B
  subplot(2,1,2);
  hold('on');
  for i=1:size(detA.poly,1)
      pS = detA.poly(i,1);
      pE = detA.poly(i,2);
      fill(pA(pS:pE,1),pA(pS:pE,2),'r');
  end
  %hold('off');


The code below does NOT cause a crash. Not that only 1 value has changed. That
is the value in position 4,2 of clSub.


clc
clf
pkg load octclip

%subject polygon
  clSub = [0.0 0.0
           40.0 0.0
           40.0 10.0
           0.0 3.0
           0.0 0.0];
  %clipper polygon
  clClip = [0.0 0.0
            6.0 0.0
            6.0 2.0
            0.0 3.0
            0.0 0.0];
  %limits for the plots
  clXLim = [1.5 11.75];
  clYLim = [0.5  8.50];



  %compute A-B
  [pA,detA] = oc_polybool(clSub,clClip,'ab');

  %plotting
  figure(1);
  %plot window for original data
  subplot(2,1,1);
  plot(clSub(:,1),clSub(:,2),clClip(:,1),clClip(:,2));
  axis('equal');
  %xlim(clXLim);
  %ylim(clYLim);
  title('Original polygons');
  legend('Subject polygon','Clipper polygon','location','southeast');

  %plot window for A-B
  subplot(2,1,2);
  hold('on');
  for i=1:size(detA.poly,1)
      pS = detA.poly(i,1);
      pE = detA.poly(i,2);
      fill(pA(pS:pE,1),pA(pS:pE,2),'r');
  end
  %hold('off');








    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63221>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]