Explain geometric constraints solver for CAD to a newbie

In summary, OpenSCAD knows, in some sense, because it drew it. But inside my OpenSCAD script, I don't, and I have to calculate the geometry in my code.
  • #1
cave_cat
41
0
I have seen the following said on a forum:
suppose I've got a triangle-shaped part, and stick the flat side of it on a square part. What's the distance from the tip of triangle to the opposite flat side of the square? OpenSCAD knows, in some sense, because it drew it. But inside my OpenSCAD script, I don't, and I have to calculate the geometry in my code.
This makes good sense to me. To me, as a programmer, this sounds like he is asking for a better API to look up the coordinate at runtime; perhaps that would force the engine to evaluate expressions in a particular order, but then that's what functional programming is all about. But, in reply people talked about "constraints solver" for this purpose, e.g.:
This is usually done by a constraint solver. The most popular one in the industry is D-Cubed 3D DCM by Siemens.
Can somebody give a simple, toy example based explanation of what this "constraint solver" is about and how it is better than using a better object oriented API to access info about rendered 3d components?
 
Engineering news on Phys.org
  • #2
cave_cat said:
Can somebody give a simple, toy example based explanation of what this "constraint solver" is about

What[/PLAIN] is a constraint solver

cave_cat said:
how it is better than using a better object oriented API to access info about rendered 3d components?

http://www.plm.automation.siemens.com/en_us/products/open/d-cubed/animations/3ddcm/video_3d_spline_constraints.shtml
http://www.plm.automation.siemens.com/en_us/products/open/d-cubed/animations/3ddcm/video_3d_support_cones_tori.shtml

But if it is only for the simple problem presented in the OP, it is like using a 1000 hp engine in a scooter.
 
Last edited by a moderator:
  • #3
jack action, thank you for the examples. I guess I still don't fully see the "constraint" aspect in them -- these look to me more like propagation of variable change in a functional program. But, for one thing, maybe that's just what they call it in the CAD space, i.e. "constraints" instead of "functional"; and for another, maybe some of this stuff really does go beyond what is normally doable with functional programming and I am simply too clueless in geometry to appreciate that.
 
  • #4
There is a Wikipedia page about this type of constraint.

The «constraint» aspect is based on the theory of the kinematic pairs in the study of machines:

https://upload.wikimedia.org/wikipedia/en/thumb/3/31/06112014035310LowerKinematicPairs.jpg/512px-06112014035310LowerKinematicPairs.jpg​
 
Last edited by a moderator:
  • #5
My master's thesis was on CAD software design, so I understand your frustration with CAD APIs in general. The "constraint solver" is simply a numerical method that solves a series of constraints in a CAD assembly model. For example, the human elbow is constrained to a hinge-type motion but only for a certain range of angles. If you were to model the bones in the arm, you would have to constrain the motion of the humerus and the radius/ulna to rotate about the elbow in one axis and only in a certain range. To do that, they create a system of equations and solve it to get the positions of the bones. This helps when trying to flesh out a design for a machine to know what the range of motions are of the parts in the assembly.

The constraint solver is basically a class that uses numerical methods, so you get into the classic problem of properly integrating OOP into scientific computing. I haven't used OpenSCAD, so I don't know about how the API is, but I know that for other CAD systems such as Siemens NX, Dassault Systemes CATIA, and PTC Creo, they're horrible to work with. Those were designed a long time ago and they are often unintuitive and hard to work with.
 

What is a geometric constraints solver for CAD?

A geometric constraints solver for CAD is a computer program or algorithm that is used to automatically apply mathematical constraints to the elements in a CAD drawing. These constraints ensure that the design remains accurate and consistent throughout the editing process.

How does a geometric constraints solver work?

A geometric constraints solver works by analyzing the geometric relationships between the elements in a CAD drawing. It then applies mathematical principles and formulas to determine the necessary constraints that must be applied to maintain the desired design integrity. The solver then automatically adjusts the elements in the drawing to satisfy these constraints.

What are the benefits of using a geometric constraints solver?

The use of a geometric constraints solver in CAD can greatly increase efficiency and accuracy in the design process. It eliminates the need for manual adjustments and ensures that the design remains consistent and error-free. Additionally, it allows for easy modifications and updates to the design without compromising its integrity.

Are there any limitations to using a geometric constraints solver?

While a geometric constraints solver can greatly improve the design process, it does have some limitations. It may not be able to handle complex or non-standard designs, and may also have difficulty with large or highly detailed drawings. It is important for designers to have a good understanding of the principles behind the solver in order to use it effectively.

Can a geometric constraints solver be used in all types of CAD software?

Most CAD software programs have some form of geometric constraints solver built-in. However, the specific features and capabilities may vary between different software. It is important to research and understand the capabilities of the solver in the specific CAD software being used.

Similar threads

  • Beyond the Standard Models
Replies
0
Views
1K
Replies
9
Views
6K
  • Other Physics Topics
Replies
6
Views
2K
  • Astronomy and Astrophysics
Replies
22
Views
2K
  • General Math
Replies
7
Views
2K
Replies
1
Views
1K
  • Linear and Abstract Algebra
Replies
2
Views
3K
Replies
35
Views
9K
Replies
14
Views
4K
Replies
26
Views
17K
Back
Top