Python 更改findAt()函数的容差

Python 更改findAt()函数的容差,python,abaqus,Python,Abaqus,我在Abaqus中使用findAt()函数,但它经常找不到元素,即使参考位置很近。这是因为它用于查找对象的公差默认为1e-6 () 我想放松/改变这种容忍度。有人知道这是否可能吗 mdb.models['Model-1'].parts['x'].Set(faces=/mdb.models['Model1'].parts['x'].faces.findAt(..... 如果要按较大公差查找面,应使用getByBoundingBox。在这里,您可以指定公差范围。e、 g point = (x,y,

我在
Abaqus
中使用
findAt()
函数,但它经常找不到元素,即使参考位置很近。这是因为它用于查找对象的公差默认为
1e-6

()

我想放松/改变这种容忍度。有人知道这是否可能吗

mdb.models['Model-1'].parts['x'].Set(faces=/mdb.models['Model1'].parts['x'].faces.findAt(.....

如果要按较大公差查找面,应使用
getByBoundingBox
。在这里,您可以指定公差范围。e、 g

point = (x,y,z) # your coordinates
tol = 1e-5 # your tolerance
faces = mdb.models['Model1'].parts['x'].faces.getByBoundingBox(xMin = point[0]-tol, xMax = point[0]+tol,yMin = point[1]-tol, yMax = point[1]+tol,zMin = point[2]-tol, zMax = point[2]+tol,) # faces on the coordinates within your tolerance
此外,您还可以通过创建一个函数来实现这一点,以便在坐标列表上应用与
findAt
方法相同的过程

编辑:

或者更好的
getByBoundingSphere
。在这种情况下更容易:

point = (x,y,z) # your coordinates
tol = 1e-5 # your tolerance
faces = mdb.models['Model1'].parts['x'].faces.getByBoundingSphere(center = point, radius=tol) # faces on the coordinates within your tolerance
编辑2: 忘掉上面的。使用
getClosest
。在那里,您可以指定坐标列表和公差,这样行为就像是带有自定义公差的
findAt

point = (x,y,z) # your coordinates
point2 = (x2,y2,z2) # your coordinates
tol = 1e-5 # your tolerance
faces = mdb.models['Model1'].parts['x'].faces.getClosest(coordinates =(point,point2), searchTolerance=tol) # faces on the coordinates within your tolerance

如果要按较大公差查找面,应使用
getByBoundingBox
。在这里,您可以指定公差范围。e、 g

point = (x,y,z) # your coordinates
tol = 1e-5 # your tolerance
faces = mdb.models['Model1'].parts['x'].faces.getByBoundingBox(xMin = point[0]-tol, xMax = point[0]+tol,yMin = point[1]-tol, yMax = point[1]+tol,zMin = point[2]-tol, zMax = point[2]+tol,) # faces on the coordinates within your tolerance
此外,您还可以通过创建一个函数来实现这一点,以便在坐标列表上应用与
findAt
方法相同的过程

编辑:

或者更好的
getByBoundingSphere
。在这种情况下更容易:

point = (x,y,z) # your coordinates
tol = 1e-5 # your tolerance
faces = mdb.models['Model1'].parts['x'].faces.getByBoundingSphere(center = point, radius=tol) # faces on the coordinates within your tolerance
编辑2: 忘掉上面的。使用
getClosest
。在那里,您可以指定坐标列表和公差,这样行为就像是带有自定义公差的
findAt

point = (x,y,z) # your coordinates
point2 = (x2,y2,z2) # your coordinates
tol = 1e-5 # your tolerance
faces = mdb.models['Model1'].parts['x'].faces.getClosest(coordinates =(point,point2), searchTolerance=tol) # faces on the coordinates within your tolerance

谢谢你的回答,其他使用它的人请注意:1。边界框要求整个面位于其内部,因此很难指定所有几何体而不意外地指定两次。getClosest似乎不适用于面,它旨在创建边组3。我最终使用了球体方法,虽然它也有外壳问题(根据第1点),但我的脸有相当标准的大小,因此works@LuTze,而您对长方体和球体的看法是正确的,因为面必须包含在其中。GetRealy的工作正如人们所期望的那样。您在手册中链接了一个错误的位置。谢谢你的回答,其他使用它的人请注意:1。边界框要求整个面位于其内部,因此很难指定所有几何体而不意外地指定两次。getClosest似乎不适用于面,它旨在创建边组3。我最终使用了球体方法,虽然它也有外壳问题(根据第1点),但我的脸有相当标准的大小,因此works@LuTze,而您对长方体和球体的看法是正确的,因为面必须包含在其中。GetRealy的工作正如人们所期望的那样。您在手册中链接了一个错误的位置。看