Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

See original GitHub issue

Create constraints that allow more freedom of placement.

Implementation: non-linear Optimisation `scipy` offers a range of optimisation methods. https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.optimize.minimize.html

Optimisation methods could be defaulted, then optionally fine-tuned by advanced users, all through one common interface (`scipy`).

Inspiration for constraints… naming observed from official OnShape and Solidworks tutorials:

Solidworks

• angle, coincident, concentric, distance, lock, parallel, perpendicular, and tangent mates
• limit, linear/linear coupler, path, symmetry, and width
• cam-follower, gear, hinge, rack and pinion, screw, and universal joint

OnShape

• Fastened
• Revolute
• Slider
• Planar
• Cylindrical
• Pin Slot
• Ball

### Issue Analytics

• State:
• Created 6 years ago

2reactions
everlanescommented, Oct 6, 2019

Hi, I have a proof of concept for a flexible solver using the scipy least square root solver. It is working quite nicely and I can apply multiple constriants to any part.

For now I have to following constraints working:

• Origin: constrains origin and direction of a part to a CoordinateSystem()
• OriginDir: constrains only the orientation of a part to a CoordinateSystem()
• Position: constrains position and direction of two mates
• Direction: constrains only the direction of two mates
• Plane: constrains one mates position to be located in a plane parall to the seconds mate plane

Next steps would be to clean it up and integrate it into the cqparts code. This would mean to replace the current solver.solve method the Assembly.build function and to add new constraint classes.

My questions:

1. is it desired that I work on this?
2. is anyone else currently working on this?
3. can I modify the Assembly.build function or is anyone else currently working on this?
4. which branch should I fork to minimize merge conflicts?
0reactions
everlanescommented, Oct 11, 2019

I have uploaded a first draft for a numeric solver with flexible constraints in #158

All tests are passing in my development environment, but sadly not with AppVeyor - OCC dependency is missing and scipy dependency should be added. I’m just not sure, where to add these dependencies.

#### Top Results From Across the Web

Advanced constraints — Calliope 0.6.8 documentation
Group constraints are applied to named sets of locations and techs, called “constraint groups”, specified through a top-level group_constraints key (sitting ...
Capabilities, constraints, and settings - Web APIs | MDN
So-called advanced constraints are created by adding an advanced property to the constraint set; this property's value is an array of additional ...
Advanced Table Constraints ... concerned with generalized arc consistency, i.e. dealing with constraints that cover more than two variables.
Advanced Constraints ; Grazing Angle, Describes how high one object appears above the edge of the Earth (or limb) relative to the satellite....
Creating Constraints Using the Advanced Constraint Template
The Advanced Constraint template is similar to the Assisted Advanced Constraint Template. You can create constraints using Rule Assembly Language with ...

#### Troubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free