hlorus / CAD_Sketcher

Constraint-based geometry sketcher for blender
GNU General Public License v3.0
2.69k stars 129 forks source link

Angle Constraint Bug - $50 #261

Open hlorus opened 2 years ago

hlorus commented 2 years ago

The angle constraint fails to solve in some scenarios, see: https://www.youtube.com/watch?v=yHC8NQG2A2Y&t=4s @01:23

amrsoll commented 2 years ago

Managed to recreate a minimal example. When trying to set the angle to for example 50 degrees, it breaks.

https://nextcloud.soll.xyz/index.php/s/C86ZiMD5y7jxzR4

image

amrsoll commented 2 years ago

Uncaught exception happens when solving the system

uncaught exception

Pointing to this particular line

Compared to the upstream solvesystem repo, the one we use with the python bindings is 1100 commits behind. I think the realthunder/solvespace repo desperatly needs an update from upstream.

It might be worth trying this version instead: https://github.com/KmolYuan/solvespace

https://pypi.org/project/python-solvespace/

But I think @hlorus knows best about the different python ports of solvespace.

amrsoll commented 2 years ago

Even more minimal example using 2 lines, vertical or horizontal constraint + vertical / horizontal Distance constraint

image

hlorus commented 2 years ago

Compared to the upstream solvesystem repo, the one we use with the python bindings is 1100 commits behind. I think the realthunder/solvespace repo desperatly needs an update from upstream.

Absolutely agree with that, we should probably reach out to realthunder.

It might be worth trying this version instead: https://github.com/KmolYuan/solvespace https://pypi.org/project/python-solvespace/

That's actually what i used to start with but i've decided to switch to the version that is used now back because it didn't seem to be maintained iirc.

But I think @hlorus knows best about the different python ports of solvespace.

I don't really know alot about the differences. There's just no available python package of the official solvespace solver as far as i know.

amrsoll commented 2 years ago

it didn't seem to be maintained iirc.

The https://github.com/KmolYuan/python-solvespace is archived, but he also has https://github.com/KmolYuan/solvespace which is maintained and a lot closer to upstream. I'm trying to use it atm, but there are quite a few differences (obvi)

therealjacobbrauer commented 2 years ago

Uncaught exception happens when solving the system

uncaught exception

Pointing to this particular line

Compared to the upstream solvesystem repo, the one we use with the python bindings is 1100 commits behind. I think the realthunder/solvespace repo desperatly needs an update from upstream.

It might be worth trying this version instead: https://github.com/KmolYuan/solvespace

https://pypi.org/project/python-solvespace/

But I think @hlorus knows best about the different python ports of solvespace.

in your code shown here, how are you running the solver.py script? Do you run the solver.py from your python IDE? Sorry for the basic question, I really appreciate your input on these GitHub pages amrsoll.

amrsoll commented 2 years ago

@therealjacobbrauer

in your code shown here, how are you running the solver.py script? Do you run the solver.py from your python IDE? Sorry for the basic question, I really appreciate your input on these GitHub pages amrsoll

No worries :) I created a vscode file that runs a debug server and connects to the vscode debug client. It should happen before right after all the imports in the addons are done.

If using VSCode / Codium you should be able to press F5 to run the selected debugger

See #206

vespakoen commented 1 year ago

I git bisected this issue because it seemed to work at some point in the past. This bug (at least with the first example (https://github.com/hlorus/CAD_Sketcher/issues/261#issuecomment-1222798814, angle_break.blend) seems to be broken by this commit:

https://github.com/hlorus/CAD_Sketcher/commit/4caa0fcd87c4eaf7475adb90a8e0116c4a2106d9#diff-116ba881a2b88b2046ed43e0ccf5660900385cdfd8bb3beea1a41a7cc6c49f83

Here is the corrosponding PR:

https://github.com/hlorus/CAD_Sketcher/pull/272