bugGNU Octave - Bugs: bug #63704, isosurface returns incorrect...

 
 

bug #63704: isosurface returns incorrect results for data bigger than small

Submitter:  None
Submitted:  Wed 25 Jan 2023 02:17:51 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Ladislav Hanyk Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 7.3.0
Operating System:  * Any Fixed Release:  None
Planned Release:  8.1.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 31 Jan 2023 02:30:01 PM UTC, comment #3: 

I can confirm the initial bug and that Markus' patch fixes the issue. Closing report as fixed

Pantxo Diribarne <pantxo>
Group Member
Mon 30 Jan 2023 05:38:35 PM UTC, comment #2: 

In Octave 6 and before, entering hexadecimal integers resulted in a double precision floating point number. Since Octave 7, the result in unsigned integer types matching the number of entered digits.

Many mixed operations between integer type values and double precision floating point numbers result in integer type values.
Those exhibit saturation behavior when they exceed their respective limits.
That led to the observed issues when isosurfaces with many vertices where created in Octave version 7 or later.

I pushed the following change to the stable branch of Octave to cast a matrix with hexadecimal input to "double" to revert to the behavior of that function in version 6 and before:
https://hg.savannah.gnu.org/hgweb/octave/rev/17d568574e1c

This should be part of the upcoming Octave 8.

Marking as ready for test.

Markus Mützel <mmuetzel>
Group administrator
Wed 25 Jan 2023 03:48:46 PM UTC, comment #1: 

I can confirm with Octave 8.0.90.
It also renders incorrectly when I change to `graphics_toolkit('fltk')` before the test. So not much more information from that test.

Looking at the data of the patch graphics object:

>> hkids = get(gca, 'Children');
>> get(hkids, 'Type')
ans =
{
  [1,1] = light
  [2,1] = patch
}

>> hpatch = hkids(2);
>> vert = get(hpatch, 'Vertices');
>> magn = sqrt(sum(vert.^2,2));
>> find(max(abs(magn-1)) == abs(magn-1), 1, 'first')
ans = 29048
>> sqrt(sum(vert(29048,:).^2))
ans = 2.3583
>>


That's pretty far off from `1`...

There might be something wrong with the algorithm that calculates the vertices for the isosurface (only if there are many edges?). But there haven't been many changes to the involved functions between Octave 6 and Octave 7 afaict...

Markus Mützel <mmuetzel>
Group administrator
Wed 25 Jan 2023 02:17:51 PM UTC, original submission:  

Matlab and Octave v6 can compute and display isosurfaces that Octave v7 cannot.

Second example from help isosurface works with N=15 but not with N=60.

Following example works for nx=40 but not for nx=50.

% Spherical shell
xmax=0.9; nx=50;
vec=linspace(-xmax,xmax,nx);
[x,y,z]=meshgrid(vec,vec,vec);
s=sqrt(x.^2+y.^2+z.^2);
isosurface(x,y,z,s,1);

Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by None (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.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-31 pantxo CategoryOctave Function Plotting
        StatusReady For Test Fixed
        Open/ClosedOpen Closed
        Operating SystemMicrosoft Windows Any
    2023-01-30 mmuetzel StatusConfirmed Ready For Test
        Planned ReleaseNone 8.1.0
    2023-01-25 mmuetzel StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code