Apply Multiple Constraints to the Same Part
See original GitHub issueI’ve got a single servo that I’m trying to fully constrain in place in relation to a chassis. I’m not sure how to apply multiple constraints at once to a single part. If I do the following, only the first coincident constraint seems to be respected.
def make_constraints(self):
return [
Fixed(self.components['chassis'].mate_origin, CoordSystem()),
Coincident(
self.components['servo1'].mate_top,
self.components['chassis'].mate_back
),
Coincident(
self.components['servo1'].mate_wings,
self.components['chassis'].mate_left,
)
]
Am I going about the constraints wrong? Is the constraints solver set up to handle more than one constraint on a single part? The toy car example doesn’t seem to address this.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
sql - Add multiple constraints in one statement - Stack Overflow
This DDL will work: ALTER TABLE MEMBER ADD CONSTRAINT U_MEMBERID UNIQUE(MEMBER_ID), primary key ( ...
Read more >Adding multiple constraints in a single table - GeeksforGeeks
We can create a table with more than one constraint in its columns. Following example shows how we can define different constraints on...
Read more >Examples: Applying Multiple Constraints to Features - 2021
You can define multiple constraints as primary, secondary, or tertiary. For example, an assembly could require you to mate a feature with more...
Read more >Multiple Constraint - an overview | ScienceDirect Topics
One way to tackle the problem is to evaluate both m 1 and m 2 for each member of the population, assign the...
Read more >How can I apply multiple constraints or loads in a subcase?
1. Put multiple loads in one load collector, and include that one load collector in the subcase. The same method can be used...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m using the direction Nth selectors on the robot, and they work pretty well. Have a look at line 41 in the file here. Notice the
[2]
string selector syntax. That selects the 3rd face away from the minimum X. 0 being the same as<X
(I think).@fragmuffin
Selecting geometry is a key and difficult challenge I have thought a LOT about. It is actually why cadquery got it’s name… From the ability to query the model as the basis for future operations.
Imo, the most important feature that can lacks is the ability to select geometry by operation ID, and modification status (created, modified). In many cases I have encountered, the easiest way to select features is to tag a given operation, select faces it created, and then subselect on those.
I know this because I use OnShape a lot, and though they do not have a lot of the selectors cq has, they have operation Id selecting, and It works very very well.
I have been pushing for a cq 2.0 to be based on OCC directly, because it’s only at the OCC layer that it is possible to ask the cad kernel what it did to the model, rather than only give you the result. This is where the cq direct API comes in. At the direct API level , you can programmatically select the modified, created, and deletied bodies.
It might be possible for us to bolt some operation selection into 1.0, though. We could allow tagging workplanes, and passing a tag into all operations, which is stored on the stack. Then, at least you could target features that were created at a particular step maybe?