CAD_Sketcher icon indicating copy to clipboard operation
CAD_Sketcher copied to clipboard

Refactor for python_solvespace API.

Open amrsoll opened this issue 3 years ago • 8 comments

Why?

The PR is currently a draft to feel the temperature of the water and talk about it.

The python_solvespace repo is much closer to the upstream solvespace repo. This means that some bugs might already be solved there, such as https://github.com/hlorus/CAD_Sketcher/issues/261 (not confirmed if this can fix it)

A side effect of this refactor is that a lot of abstraction is already done by the python wrapper :smile: and saves a lot of lines.

History

@hlorus used to base CAD sketcher on an other solvespace repo . As it got archived it seemed to be abandonned, but an other fork was maintained by the same user.

TODO

  • [ ] Fix updating entity properties post-solving
  • [ ] Fix dragging entities
  • [ ] Work out how to use the groups with this API (I pretty much deleted everything related to groups)
  • [ ] Update docs
  • [ ] Fix vertical / horizontal constraints
  • [ ] A lot more

amrsoll avatar Aug 23 '22 23:08 amrsoll

You said "same user" but I don't see any sign of it on realthunder's page. Can you link to the python_solvespace repo you're using?

exegetor avatar Aug 23 '22 23:08 exegetor

Here :)

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

amrsoll avatar Aug 23 '22 23:08 amrsoll

Definitely intresting to explore this direction. My main question here is if we would have to drop support for the current python port "py_slvs".

Some people also pointed completely different solvers out. Maybe we could start thinking about having it somewhat generic to allow plugging in any solver we want in the future.

hlorus avatar Aug 24 '22 07:08 hlorus

My main question here is if we would have to drop support for the current python port "py_slvs".

There doesn't immediately seem like there is any advantage of using py_slvs over python_solvespace (god I hate when python packages put py/python in their name :joy: )

Maybe we could start thinking about having it somewhat generic to allow plugging in any solver we want in the future.

Oh the nightmare :joy: given how differently some solvers and their API might work (imagine something acting as weirdly as bpy) it will be integration hell to have support for multiple solvers, and I don't think they can be easily abstracted.

amrsoll avatar Aug 24 '22 09:08 amrsoll

Oh the nightmare :joy: given how differently some solvers and their API might work (imagine something acting as weirdly as bpy) it will be integration hell to have support for multiple solvers, and I don't think they can be easily abstracted.

Hmm yeah, might not be worth the hassle to support multiple solvers.

hlorus avatar Aug 25 '22 06:08 hlorus

Interestingly i'm already failing at installing the solver... pip_error.txt

At least for the latest version, it worked with version 3.0.0.post7

hlorus avatar Sep 06 '22 06:09 hlorus

This will likely need alot of testing so i would recommend making this an official branch, getting it to a testable stage and then collect feedback by testers.

hlorus avatar Sep 13 '22 08:09 hlorus

Well i am happy not to be the only one to want this tested out, see if it works better :)

amrsoll avatar Sep 15 '22 06:09 amrsoll