×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Selecting features NEAR a location with python

Selecting features NEAR a location with python

Selecting features NEAR a location with python

(OP)
Hi,

I am writing parametric studies for some abaqus designs via python. Most of this has went pretty smoothly but I have reached a frustrating problem for selecting edges (from python) for a particular structure as the geometry changes. I typically use the findAt() commands and write basic algebra equations so the features are continuously selected as the geometry changes, but now the points I need to determine are slightly inexact. Is there a command where I specify points NEAR to the desired feature I wish to select rather than the EXACT location?

In other words, errors emerge in selecting the feature with findAt because the points are off by about 1E-6 (very small for the system I'm working with) as the geometry changes after a certain amount. Rather than rewriting my model so it has this inaccuracy corrected, I would rather find a python command or algorithm that just selects points within a 1E-6 to 1E-5 range of the desired feature. Is there a command for this?? If not, do any of you guys have an idea on an algorithm I could write to achieve this?

Thanks!

RE: Selecting features NEAR a location with python

(OP)
Any ideas on this?
Sill Struggle and this seems like a problem other people have probably ran into before.

thanks

RE: Selecting features NEAR a location with python

from numpy import * # this works in 6.12
p = point
q = array of points
d = asarray(q)-asarray(p)
d = asarray(sqrt(sum(d*d,-1)))
d.argmin() or d[d<1e-5] for the closest point or the points within the tolerance

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources