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

Failed assert with multiple circles #10

Open
thquinn opened this issue Jun 19, 2019 · 1 comment
Open

Failed assert with multiple circles #10

thquinn opened this issue Jun 19, 2019 · 1 comment

Comments

@thquinn
Copy link

thquinn commented Jun 19, 2019

With declarations as simple as:

from geosolver.solver.variable_handler import VariableHandler
from geosolver.solver.numeric_solver import NumericSolver

vh = VariableHandler()
A = vh.point('A')
B = vh.point('B')
AO = vh.circle(A)
BO = vh.circle(B)

I'm getting a failed assert:

Traceback (most recent call last):
  File "geosolve.py", line 8, in <module>
    BO = vh.circle(B)
  File ".../geosolver/solver/variable_handler.py", line 52, in circle
    r = self.number(r_name, init=init)
  File ".../geosolver/solver/variable_handler.py", line 17, in number
    assert name not in self.variables
AssertionError

If I comment out the second circle declaration, it works fine. I'm not having trouble with lines or anything else.

@thquinn
Copy link
Author

thquinn commented Jun 19, 2019

To work around this, I change this line in variable_handler.py:

r_name = "%s_r" % center.signature.id

to

r_name = "r_%s" % len(self.variables)

since it seems like the former always evaluates to something like "Point_r". This prevents the newly defined radius from always having the same name.

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

1 participant