yonayaha / geometry

0 stars 0 forks source link

obstacle metric example doesn't work #1

Open ssoobboobb opened 11 months ago

ssoobboobb commented 11 months ago

Hey yonayaha, I'm very interested in your obstacle metric code. Unfortunatly the example you posted doesn't work at my computer. The Error says:

Traceback (most recent call last): File "D:/PythonRepo/geometry-master/obstacle_metric_example.py", line 61, in om._build_visibility_graph() File "D:\PythonRepo\geometry-master\obstacle_metric.py", line 262, in _build_visibility_graph self.visibility_graph.add_edges_from((segment.points() for segment in self._segments())) File "D:\PythonRepo\geometry-master\spatial_graph.py", line 40, in add_edges_from self.add_edge(*edge, **attr) File "D:\PythonRepo\geometry-master\spatial_graph.py", line 29, in add_edge segment = SpatialGraph.Segment(point0, point1) TypeError: new() takes from 1 to 2 positional arguments but 3 were given

The Error occurs in spatial_graph.py in that line:

def add_edge(self, point0, point1, **attr): segment = SpatialGraph.Segment(point0, point1)

I couldn't find the problem. I would be glad if you could have a look at it.

Thanks a lot! Sonja

ssoobboobb commented 11 months ago

I've found the problem. It has to be

segment = SpatialGraph.Segment((point0, point1))