Reimplementing constraint solver

Discussion about the development of the Assembly workbench.
User avatar
DeepSOIC
Posts: 7810
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Reimplementing constraint solver

Postby DeepSOIC » Mon Mar 23, 2020 7:49 pm

abdullah wrote:
Mon Mar 23, 2020 1:58 pm
I have tried to commit stuff without asking, but Github rejected ... ahh! wise GitHub!!
It looks like I've done everything correctly. It says you should have got an email with an invitation, and once you accept it, you should get write access.
github help wrote:The user will receive an email inviting them to the repository. Once they accept your invitation, they will have collaborator access to your repository.

Collaborators on a personal repository can:
Push to (write), pull from (read), and fork (copy) the repository
Create, apply, and delete labels and milestones
Open, close, re-open, and assign issues
Edit and delete comments on commits, pull requests, and issues
Mark an issue or pull request as a duplicate. For more information, see "About duplicate issues and pull requests."
Open, merge and close pull requests
Apply suggested changes to pull requests. For more information, see "Incorporating feedback in your pull request."
Send pull requests from forks of the repository
Publish, view, and install packages. For more information, see "Publishing and managing packages."
Create and edit Wikis
Create and edit releases. For more information, see "Managing releases in a repository.
Remove themselves as collaborators on the repository
Submit a review on a pull request that will affect its mergeability
Act as a designated code owner for the repository. For more information, see "About code owners."
Lock a conversation. For more information, see "Locking conversations."
Report abusive content to GitHub Support or GitHub Premium Support. For more information, see "Reporting abuse or spam."
Transfer an issue to a different repository. For more information, see "Transferring an issue to another repository."
User avatar
DeepSOIC
Posts: 7810
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Reimplementing constraint solver

Postby DeepSOIC » Tue Mar 24, 2020 12:23 am

I rebased ConstraintSolver1 to be up to date with FreeCAD master.
abdullah
Posts: 3534
Joined: Sun May 04, 2014 3:16 pm

Re: Reimplementing constraint solver

Postby abdullah » Tue Mar 24, 2020 1:49 pm

DeepSOIC wrote:
Mon Mar 23, 2020 7:49 pm
abdullah wrote:
Mon Mar 23, 2020 1:58 pm
I have tried to commit stuff without asking, but Github rejected ... ahh! wise GitHub!!
It looks like I've done everything correctly. It says you should have got an email with an invitation, and once you accept it, you should get write access.
You did. The email was buried among the tens of emails I receive from GitHub daily.
User avatar
DeepSOIC
Posts: 7810
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Reimplementing constraint solver

Postby DeepSOIC » Tue Mar 24, 2020 2:40 pm

I'm now working on G2D/ConstraintLength, and then plan on adding more constraints and implementing more geometry.
Open areas that can be approached right now are:
* implement more geometry.
Point, line and circle/arc are up. Pending are ellipse, parabola, hyperbola and bsplines. The files and classes for some of them are already created, but the implementation is a copy of ParaLine, waiting to be changed.
* implement SolverFrontEnd, diagnose routine in particular
* extend and test 2d placement support. Solve issue of ParaShapes not having mirrors for geometry methods that apply the placement implicitly.
* 3d geometry
* implement something useful based on existing stuff, as a demo. For example, 2d fillet.
abdullah
Posts: 3534
Joined: Sun May 04, 2014 3:16 pm

Re: Reimplementing constraint solver

Postby abdullah » Tue Mar 24, 2020 4:23 pm

DeepSOIC wrote:
Tue Mar 24, 2020 2:40 pm
I'm now working on G2D/ConstraintLength, and then plan on adding more constraints and implementing more geometry.
I am taking a look to the ParaObject and its rich hierarchy of classes.

I take the opportunity to annoy you with another PR, a generalisation of self() to make it more versatile and avoid having to downcast after creation. I have not merged it yet. There are other self that I have not touch yet just in case you object.
User avatar
DeepSOIC
Posts: 7810
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Reimplementing constraint solver

Postby DeepSOIC » Tue Mar 24, 2020 7:18 pm

abdullah wrote:
Tue Mar 24, 2020 4:23 pm
a generalisation of self()
??
I was just about to consider deleting it :shock: :shock: :shock: On ParaObject in particular, not just everywhere.
User avatar
DeepSOIC
Posts: 7810
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Reimplementing constraint solver

Postby DeepSOIC » Tue Mar 24, 2020 7:35 pm

OK, I see the PR, looks good...
User avatar
DeepSOIC
Posts: 7810
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Reimplementing constraint solver

Postby DeepSOIC » Wed Mar 25, 2020 12:59 am

Length constraint is working.
To the example above, add this:

Code: Select all

constraints.append(
    FCS.G2D.ConstraintLength(
        Edges= solver_geoms,
        length= ps.addOne("length", 100.0, fixed= True)
    )
)
This constrains the perimeter of the slot to equal 100 mm. This constraint is useful for designing belt-and-pulley systems. Sketcher doesn't have such a constraint yet!
C_h_o_p_i_n
Posts: 150
Joined: Fri Apr 26, 2019 3:14 pm

Re: Reimplementing constraint solver

Postby C_h_o_p_i_n » Wed Mar 25, 2020 11:30 am

DeepSOIC wrote:
Wed Mar 25, 2020 12:59 am
Length constraint is working.
To the example above, add this:

Code: Select all

constraints.append(
    FCS.G2D.ConstraintLength(
        Edges= solver_geoms,
        length= ps.addOne("length", 100.0, fixed= True)
    )
)
This constrains the perimeter of the slot to equal 100 mm. This constraint is useful for designing belt-and-pulley systems. Sketcher doesn't have such a constraint yet!
Will it work with non-straigt elements e.g. arc's too ?
User avatar
DeepSOIC
Posts: 7810
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Reimplementing constraint solver

Postby DeepSOIC » Wed Mar 25, 2020 11:40 am

C_h_o_p_i_n wrote:
Wed Mar 25, 2020 11:30 am
Will it work with non-straigt elements e.g. arc's too ?
works already, I constrained a slot-like shape to the length, made of two lines and two arcs of circle.

Other curves may not get this support, calculating lengths of these is slow/complicated. it's at low priority for now.