bugpyFormex - Bugs: bug #40427, plugins.curve.Arc() construction...

 
 

bug #40427: plugins.curve.Arc() construction from 3 points

Submitted by:  Sander De Bock <sdebock>
Submitted on:  Wed 30 Oct 2013 12:22:15 PM UTC  
 
Category: PluginsSeverity: 3 - Normal
Item Group: Functionality errorStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 30 Oct 2013 03:07:34 PM UTC, comment #3:

In commit cca56c3 this is fixed: A[t] or B[t] gets chosen depending on which has the largest number of vectors.
This also fixes the problem with the Arc initialisation.

Benedict Verhegghe <bverheg>
Project Administrator
Wed 30 Oct 2013 02:55:00 PM UTC, comment #2:

Because of the automatic broadcasting in numpy, it is no problem if one of A or B is a single vector, while the other one is a set of vectors. In this case the single A vector will be broadcasted to both vectors of B.
Otherwise, a=Arc([[3,0,0],[4,0,0],[4,1,0]]) would also not work.

Now it looks like for the Arc([[4,1,0],[4,0,0],[3,0,0]]), because of the specific data, one of the vector angles can not be computed. We should find out why, and fix it. There should not be a problem to compute both, since they are vectors in the x,y plane and even the same as in the working example.

We still should fix the n[t] = anyPerpendicularVector(A[t]), for cases where it would be needed. If A has only 1 vector, and B has more, B should be used instead of A.

Benedict Verhegghe <bverheg>
Project Administrator
Wed 30 Oct 2013 01:45:56 PM UTC, comment #1:

The error is raised because rotationAngle calculates pairwise rotation angles between vectors of A and vectors of B. This means A and B should have the same shape. So maybe it is better to change the input in Arc so that A has shape (2,3)?

Sofie Van Cauter <svcauter>
Project Member
Wed 30 Oct 2013 12:22:15 PM UTC, original submission:

a=Arc([[4,1,0],[4,0,0],[3,0,0]])
gives:
/geomtools.py", line 470, in rotationAngle
n[t] = anyPerpendicularVector(A[t])
IndexError: index (1) out of range (0<=index<0) in dimension 0

a=Arc([[3,0,0],[4,0,0],[4,1,0]])
works

The reason is that in geomtools def rotationAngle()

if t.any():
n[t] = anyPerpendicularVector(A[t])

A (in this case) has shape (1,3), while B has shape (2,3) and t has shape (1,2), and if t == [False True], it gives the above error.

A solution might be to check the size of both A & B and do A[t] or B[t] respectively? This works for some examples I've tried.

Sander De Bock <sdebock>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bverheg (Posted a comment)
  • -unavailable- added by svcauter (Posted a comment)
  • -unavailable- added by sdebock (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 07 Nov 2013 02:48:10 PM UTCbverhegOpen/ClosedOpen=>Closed
    Wed 30 Oct 2013 03:07:34 PM UTCbverhegItem GroupNone=>Functionality error
      StatusNone=>Fixed

    Back to the top


    Powered by Savane 3.1-cleanup1