Re: Geometry pkg Octave bug

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Geometry pkg Octave bug

Juan Pablo Carbajal-2
On Tue, Jun 11, 2019 at 9:04 PM Rodrigo Eguíluz
<[hidden email]> wrote:

>
> Dear Juan Pablo,
>
> First of all I would like to thank you for the geometry pkg you guys developed. It’s really nice to find some open source alternatives like this.
>
> The reason why I am typing you is because I have recently encountered an issue with the “clipPolygon” function.
>
>
>
> Some background info: I wrote a script, using octave 4.4.1, that uses “clipPolygon” to obtain the intersection between 2 polygons. The code was working great, no complaints. However, I have recently updated my Octave installation to 5.1.0, and an error arose. I tried installing back Octave 4.4.1 and the script runs perfectly fine again, which makes me think that maybe something was changed in the main Octave code that messes up your pkg compatibility.
>
> Attached is a screenshot of the error I am getting:
>
>
>
> I am not sure if this info is enough for you guys to address this issue (assuming it’s not something on my end, which could be), so let me know if you would need some more data ( like the XY coordinates of the 2 polygons).
> For now I can get around with Octave 4.4.1. Just wanted to bring this up in case you guys have not been notified about this.
>
Dear Rodrigo,

Thanks for reporting this. In the future use the help or maintainers
mailing list, or the bug tracker
https://savannah.gnu.org/bugs/?group=octave
This way your report doesn't get lost in my inbox.

Is it possible that you provide a minimum version of your code that
reproduces the failure? It might be a simplified version of your
script.
If we can't reproduce it is very hard to search for the issue.

Btw, what OS are you working on? If you are in windows by installing a
nw version of Octave you get a new version of the package, so it might
well be that we have introduced a bug.

Regards,

Reply | Threaded
Open this post in threaded view
|

RE: Geometry pkg Octave bug

Rodrigo Eguíluz

Dear Juan Pablo and others,

Thanks for the quick answer. I apologize for not using the maintainers mailing list. I will in the future.

I have attached small script with the set of XY points of the 2 polygons and how  clipPolygon is being called. At the current timestep, these 2 polygons are not intersecting as you will see, but that has not caused this error in the past.

 

Answering your question about the OS, I am using Windows 10.

Once again, thank you.

Regards,
Rodrigo

 

-----Original Message-----
From: Juan Pablo Carbajal [mailto:ajuanpi+[hidden email]]
Sent: Thursday, June 13, 2019 08:52
To: Rodrigo Eguíluz <[hidden email]>; Maintainers GNU Octave <[hidden email]>; Philip Nienhuis <[hidden email]>
Subject: Re: Geometry pkg Octave bug

 

On Tue, Jun 11, 2019 at 9:04 PM Rodrigo Eguíluz <[hidden email]> wrote:

> 

> Dear Juan Pablo,

> 

> First of all I would like to thank you for the geometry pkg you guys developed. It’s really nice to find some open source alternatives like this.

> 

> The reason why I am typing you is because I have recently encountered an issue with the “clipPolygon” function.

> 

> 

> 

> Some background info: I wrote a script, using octave 4.4.1, that uses “clipPolygon” to obtain the intersection between 2 polygons. The code was working great, no complaints. However, I have recently updated my Octave installation to 5.1.0, and an error arose. I tried installing back Octave 4.4.1 and the script runs perfectly fine again, which makes me think that maybe something was changed in the main Octave code that messes up your pkg compatibility.

> 

> Attached is a screenshot of the error I am getting:

> 

> 

> 

> I am not sure if this info is enough for you guys to address this issue (assuming it’s not something on my end, which could be), so let me know if you would need some more data ( like the XY coordinates of the 2 polygons).

> For now I can get around with Octave 4.4.1. Just wanted to bring this up in case you guys have not been notified about this.

> 

Dear Rodrigo,

 

Thanks for reporting this. In the future use the help or maintainers mailing list, or the bug tracker https://savannah.gnu.org/bugs/?group=octave

This way your report doesn't get lost in my inbox.

 

Is it possible that you provide a minimum version of your code that reproduces the failure? It might be a simplified version of your script.

If we can't reproduce it is very hard to search for the issue.

 

Btw, what OS are you working on? If you are in windows by installing a nw version of Octave you get a new version of the package, so it might well be that we have introduced a bug.

 

Regards,


Error_Generator_ClipPoligon.m (26K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: Geometry pkg Octave bug

PhilipNienhuis
Rodrigo:

1. please do not top-post, answer below the message

2. for my answer, see below


Rodrigo Eguíluz wrote

> Dear Juan Pablo and others,
>
> Thanks for the quick answer. I apologize for not using the maintainers
> mailing list. I will in the future.
>
>
> I have attached small script with the set of XY points of the 2 polygons
> and how  clipPolygon is being called. At the current timestep, these 2
> polygons are not intersecting as you will see, but that has not caused
> this error in the past.
>
> [cid:image001.png@01D52214.38763960]
>
>
>
> Answering your question about the OS, I am using Windows 10.
>
> Once again, thank you.
>
> Regards,
> Rodrigo
>
> -----Original Message-----
> From: Juan Pablo Carbajal [mailto:

> ajuanpi+dev@

> ]
> Sent: Thursday, June 13, 2019 08:52
> To: Rodrigo Eguíluz &lt;

> REguiluz@

> &gt;; Maintainers GNU Octave &lt;

> octave-maintainers@

> &gt;; Philip Nienhuis &lt;

> pr.nienhuis@

> &gt;
> Subject: Re: Geometry pkg Octave bug

When I run it in a self-compiled Octave-5.1.1, I get:

>> [outpol , ~] = clipPolygon(jet,Rotora,1)
error: zeros: conversion of 2.5 to int64_t value failed
error: called from
    __dbl2int64__ at line 40 column 8
    clipPolygon_clipper at line 96 column 29
    clipPolygon at line 93 column 15

and that is a bug I fixed quite a while ago. Since then no new geometry
package has been released, so I wonder how you can get any meaningful
result.

In a self-compiled octave-6.0.0 from early June, using development versions
of the geometry and matgeom packages, I get:

>> help clipPolygon
'clipPolygon' is a function from the file
C:\Programs\Octave\OCTAVE~2.0_2\mingw64\share\octave\packages\matgeom-1.0.0\polygons2d\clipPolygon.m

====================================================
CLIPPOLYGON Clip a polygon with a rectangular box

   POLY2 = clipPolygon(POLY, BOX);
   POLY is [Nx2] array of points
   BOX has the form: [XMIN XMAX YMIN YMAX].
   Returns the polygon created by the itnersection of the polygon POLY and
   the bounding box BOX.

   Note: Works only for convex polygons at the moment.
====================================================

so it turns out that the clipPolygon I wrote as wrapper for the geometry
package is shadowed by a primitive one in the matgeom package.
To access that shadowed one I did
pkg unload geometry
pkg load geometry, an then:

====================================================
>> [outpol , ~] = clipPolygon(jet,Rotora,1)
outpol = [](0x2)
====================================================

-or-

====================================================
>> [outpol , ~] = clipPolygon_clipper(jet,Rotora,1)
outpol = [](0x2)
====================================================

which is the correct result,
-but-

====================================================
>> [outpol , ~] = clipPolygon_mrf(jet,Rotora,1)
error: out of memory or dimension too large for Octave's index type
error: called from
    clipPolygon_mrf at line 104 column 16
====================================================

which implies the mrf method doesn't get built properly or is incompatible
with Octave-6.0.0.

That's as far as I have time right now.

@JuanPi  I suppose the issues are:
- matgeom now shadows functions in the geometry package with quite inferior
stuff;
- the mrf polygon clipping functions doesn't work.

Philip




--
Sent from: http://octave.1599824.n4.nabble.com/Octave-Maintainers-f1638794.html

Reply | Threaded
Open this post in threaded view
|

RE: Geometry pkg Octave bug

PhilipNienhuis
PhilipNienhuis wrote

> :
> <long snip>
> :
>
> ====================================================
>>> [outpol , ~] = clipPolygon_mrf(jet,Rotora,1)
> error: out of memory or dimension too large for Octave's index type
> error: called from
>     clipPolygon_mrf at line 104 column 16
> ====================================================
>
> which implies the mrf method doesn't get built properly or is incompatible
> with Octave-6.0.0.
>
> That's as far as I have time right now.
>
> @JuanPi  I suppose the issues are:
> - matgeom now shadows functions in the geometry package with quite
> inferior
> stuff;
> - the mrf polygon clipping functions doesn't work.

I filed bug #56506 for the polybool_mrf bug.

Philip




--
Sent from: http://octave.1599824.n4.nabble.com/Octave-Maintainers-f1638794.html