Reimplementing constraint solver

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Reimplementing constraint solver

Post by DeepSOIC »

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
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Reimplementing constraint solver

Post by DeepSOIC »

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

Re: Reimplementing constraint solver

Post by abdullah »

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
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Reimplementing constraint solver

Post by DeepSOIC »

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
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: Reimplementing constraint solver

Post by abdullah »

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
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Reimplementing constraint solver

Post by DeepSOIC »

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
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Reimplementing constraint solver

Post by DeepSOIC »

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

Re: Reimplementing constraint solver

Post by DeepSOIC »

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: 225
Joined: Fri Apr 26, 2019 3:14 pm

Re: Reimplementing constraint solver

Post by C_h_o_p_i_n »

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
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Reimplementing constraint solver

Post by DeepSOIC »

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.
Post Reply