bugpyFormex - Bugs: bug #41134, closest points from the same set...

 
 

bug #41134: closest points from the same set of points

Submitted by:  gianluca de santis <gianlucadesi>
Submitted on:  Tue 07 Jan 2014 03:25:09 PM UTC  
 
Category: CoreSeverity: 1 - Wish
Item Group: Feature requestStatus: Fixed
Privacy: PublicAssigned to: Benedict Verhegghe <bverheg>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Tue 07 Jan 2014 07:58:02 PM UTC, comment #3:

And here is some code that performs the same functionality as the connect2closest in the original submission:

Hint: the connect() function transforms all items in the first argument to Formices. Thus it also works directly with Coords objects.

This has been added to pyFormex in example ConnectClosest.

Benedict Verhegghe <bverheg>
Project AdministratorIn charge of this item.
Tue 07 Jan 2014 06:14:09 PM UTC, comment #2:

In commit c08cda7, the geomtools.closest function makes the second argument optional. If only one Coords is specified, the closest point inside the same set is returned.

Benedict Verhegghe <bverheg>
Project AdministratorIn charge of this item.
Tue 07 Jan 2014 04:29:29 PM UTC, comment #1:

I am not inclined to include this, for a number of reasons:

We have already Coords.closestPoint, geomtools.closest and geomtools.closestPair. It is already difficult for the user to know what to use when. Another closest function would only make it more complicated. This functionality should be combined with or attained by the existing functions. E.g. we could make closest(X,Y) work with two identical sets as well?

We should in general try to reduce the number of functions, and make them work in a consistent way.

The connect2closest is something that can easily be (and should be) performed by Mesh0.connect(Mesh2).

I fail to see the practical use of the functions. Esp. connect2closest generates very different geometry upon very small changes in data.

With some cleanup however (and use of already available functions) this could become a nice example. And since functions defined in examples can be imported in apps, the functionality would be available after all ;)

Benedict Verhegghe <bverheg>
Project AdministratorIn charge of this item.
Tue 07 Jan 2014 03:25:09 PM UTC, original submission:

It would be nice to have these two functions implemented in the attached script (with example):

closestOne(X, return_dist=True)

It finds the closest point for each point of a set of points.

connect2Closest(X)

It creates the a line2 connectivity of closest points without duplicate elems.

Could these 2 functions be added to geomtools.py or be coords methods?

Thanks

gianluca de santis <gianlucadesi>
Project Member

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #30212:  closestPoints.py added by gianlucadesi (2KiB - text/x-python)

 

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 gianlucadesi (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 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 07 Jan 2014 07:58:02 PM UTCbverhegOpen/ClosedOpen=>Closed
    Tue 07 Jan 2014 06:14:09 PM UTCbverhegStatusNone=>Fixed
      Assigned toNone=>bverheg
    Tue 07 Jan 2014 04:29:29 PM UTCbverhegCategoryNone=>Core
      Severity2 - Minor=>1 - Wish
      Item GroupNone=>Feature request
    Tue 07 Jan 2014 03:25:09 PM UTCgianlucadesiAttached File-=>Added closestPoints.py, #30212

    Back to the top


    Powered by Savane 3.1-cleanup1