bugGNU Octave - Bugs: bug #65362, patch may not produce a polygon

 
 

bug #65362: patch may not produce a polygon

Submitter:  Liang Tang <lt1234>
Submitted:  Sat 24 Feb 2024 10:42:19 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  None Assigned to:  None
Originator Name:  lt1234 Open/Closed:  * Open
Release:  * 8.2.0 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 24 Feb 2024 10:42:19 PM UTC, original submission:  

Hi,

patch may not display a polygon.  Pls see the attached figure files.  Thanks,


The small example demonstrates a compatibility issue, or an error.

% CCW order, P0 is estimated from plane_1=@(x) [1 2 3 ]*x-06; 

P0=[6  4 -4
    0 -2 -4
    0 -6  6
    6 -6  3];
 

The P0 patch display, two triangles with one point intersection, is not a polygon and is incompatible with matlab, i.e., two triangles with line 1-3 intersection.   It does not matter if the intersection is line 1-3 or line 2-4, the output is a polygon.  

figure;   hold on;
for ii=1:size(P0,1), text(P0(ii,1), P0(ii,2), P0(ii,3), num2str(ii), 'fontsize', 20); end ;
patch(P0(:,1), P0(:,2), P0(:,3), 'r', 'facealpha', 0.1);  xlabel('x'); ylabel('y');
saveas(gcf, 'patch_P0.ofig');
%view([235 30]) 

A minor modification to P0(1,2) (y=3, instead y=4) change the display completely.  
   
figure;  
subplot(1,2,1); hold on;
for ii=1:size(P0,1), text(P0(ii,1), P0(ii,2), P0(ii,3), num2str(ii), 'fontsize', 20); end
patch(P0(:,1), P0(:,2), P0(:,3), 'r', 'facealpha', 0.1); hold on; xlabel('x'); ylabel('y');
subplot(1,2,2); hold on;
P0(1,2)=3;
for ii=1:size(P0,1), text(P0(ii,1), P0(ii,2), P0(ii,3), num2str(ii), 'fontsize', 20); end
patch(P0(:,1), P0(:,2), P0(:,3), 'r', 'facealpha', 0.1); hold on; xlabel('x'); ylabel('y'); title('Modified P0(1,2)')

saveas(gcf, 'patch_P0_update.ofig');

Liang Tang <lt1234>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #55743:  patch_p0.zip added by lt1234 (14KiB - application/x-zip-compressed)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by lt1234 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-02-24 lt1234 Attached File- Added patch_p0.zip, #55743

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code