Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AddEdgeToGraph Python Implementation #90

Open
coliem opened this issue Jan 23, 2025 · 1 comment
Open

AddEdgeToGraph Python Implementation #90

coliem opened this issue Jan 23, 2025 · 1 comment

Comments

@coliem
Copy link

coliem commented Jan 23, 2025

def AddEdgeToGraph(
self,
parent: Union[Tuple[float, float, float], NodeStruct, int],
child: Union[Tuple[float, float, float], NodeStruct, int],
cost: float,
cost_type: str = ""
) -> None:

It's possible to pass in NodeStruct data structures as parent and child, yet there is no support for this in the native functions. The pipeline goes from the else statement in

if isinstance(parent, int) and isinstance(child, int):
spatial_structures_native_functions.C_AddEdgeFromNodeIDs(
self.graph_ptr, parent, child, cost, cost_type
)
else:
spatial_structures_native_functions.C_AddEdgeFromNodes(
self.graph_ptr, parent, child, cost, cost_type
)

to

def C_AddEdgeFromNodes(
graph_ptr: c_void_p,
parent: Tuple[float, float, float],
child: Tuple[float, float, float],
score: float,
cost_type: str,
) -> None:

where the only allowed data type for the parent and child is Tuple[float,float,float]. This results in an error when calling

parent_ptr = ConvertPointsToArray(parent)
child_ptr = ConvertPointsToArray(child)

which relies on the parent and child being passed in by their xyz coordinates.

@cadop
Copy link
Owner

cadop commented Jan 28, 2025

Seems related to #65 ?

@coliem coliem mentioned this issue Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants