简体   繁体   中英

"numpy.linspace" for second time after excluding some point by first "linspace"

I am building a model and I need to get the positions of some points inside a box (known volume). I am thinking on using a) numpy.linspace(start,stop,30) b) numpy.linspace(start,stop,3000) from the same box, I think I need a tool to exclude the points from a) process.

Example as [2D] say that we have a line of length 20, and we need to distribute two types of lines: 1)10 pieces of 1 length, 2) 4 pieces of 2 length. -The space between piece(small line)from type 1 and any neighbors is equal whatever the neighbor is type 1 or 2. -The number of small pieces are equally distributed around type 2 piece.

This solution is the only one that worked for me:

  1. get the xyz file, by any other software like jmole.
  2. you have the orientations of the model. I wrote the orientations into my program to avoid overlapping.

Does

filtered_b = np.setdiff1d(np.linspace(start, stop, 3000), np.linspace(start, stop, 30))

This chooces points that are b that are not in a.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM