@@ -266,7 +266,7 @@ def from_compas_lines(cls, lines, element_model="BeamElement", section=None, nam
266266 # nodes = [Node(n) for n in set([list(p) for l in lines for p in list(l)])]
267267 for line in lines :
268268 #FIXME change tolerance
269- nodes = [prt .find_nodes_by_location (list (p ), 1 , single = True ) or Node (list (p )) for p in list (line )]
269+ nodes = [prt .find_nodes_around_point (list (p ), 1 , single = True ) or Node (list (p )) for p in list (line )]
270270 prt .add_nodes (nodes )
271271 element = getattr (compas_fea2 .model , element_model )(nodes = nodes , section = section )
272272 if not isinstance (element , _Element1D ):
@@ -568,7 +568,7 @@ def find_nodes_by_name(self, name):
568568 """
569569 return [node for node in self .nodes if node .name == name ]
570570
571- def find_nodes_by_location (self , point , distance , plane = None , report = False , single = False , ** kwargs ):
571+ def find_nodes_around_point (self , point , distance , plane = None , report = False , single = False , ** kwargs ):
572572 # type: (Point, float, Plane, bool, bool, bool) -> list[Node]
573573 """Find all nodes within a distance of a given geometrical location.
574574
@@ -623,7 +623,7 @@ def find_closest_nodes_to_point(self, point, distance, number_of_nodes=1, plane=
623623 list[:class:`compas_fea2.model.Node`]
624624
625625 """
626- nodes = self .find_nodes_by_location (point , distance , plane , report = True )
626+ nodes = self .find_nodes_around_point (point , distance , plane , report = True )
627627 if number_of_nodes > len (nodes ):
628628 number_of_nodes = len (nodes )
629629 return [k for k , v in sorted (nodes .items (), key = lambda item : item [1 ])][:number_of_nodes ]
@@ -647,7 +647,7 @@ def find_nodes_around_node(self, node, distance, plane=None):
647647 The nodes around the given node
648648
649649 """
650- nodes = self .find_nodes_by_location (node .xyz , distance , plane , report = True )
650+ nodes = self .find_nodes_around_point (node .xyz , distance , plane , report = True )
651651 if node in nodes :
652652 del nodes [node ]
653653 return nodes
@@ -672,7 +672,7 @@ def find_closest_nodes_to_node(self, node, distance, number_of_nodes=1, plane=No
672672 list[:class:`compas_fea2.model.Node`]
673673
674674 """
675- nodes = self .find_nodes_by_location (node .xyz , distance , plane , report = True )
675+ nodes = self .find_nodes_around_point (node .xyz , distance , plane , report = True )
676676 if number_of_nodes > len (nodes ):
677677 number_of_nodes = len (nodes )
678678 return [k for k , v in sorted (nodes .items (), key = lambda item : item [1 ])][:number_of_nodes ]
@@ -832,7 +832,7 @@ def add_node(self, node):
832832 return
833833
834834 if not compas_fea2 .POINT_OVERLAP :
835- if self .find_nodes_by_location (node .xyz , distance = compas_fea2 .GLOBAL_TOLERANCE ):
835+ if self .find_nodes_around_point (node .xyz , distance = compas_fea2 .GLOBAL_TOLERANCE ):
836836 if compas_fea2 .VERBOSE :
837837 print ("NODE SKIPPED: Part {!r} has already a node at {}." .format (self , node .xyz ))
838838 return
@@ -1339,7 +1339,7 @@ def get_average_displacement_at_point(self, problem, point, distance, step=None,
13391339
13401340 """
13411341 step = step or problem ._steps_order [- 1 ]
1342- nodes = self .find_nodes_by_location (point = point , distance = distance , report = True )
1342+ nodes = self .find_nodes_around_point (point = point , distance = distance , report = True )
13431343 if nodes :
13441344 displacements = [getattr (Vector (* node .results [problem ][step ].get ("U" , None )), component ) for node in nodes ]
13451345 return point , sum (displacements ) / len (displacements )
0 commit comments