Explain geometric constraints solver for CAD to a newbie

Click For Summary

Discussion Overview

The discussion revolves around the concept of a geometric constraints solver in CAD (Computer-Aided Design) software, particularly in relation to how it can be utilized for positioning and manipulating 3D components. Participants explore the differences between using a constraints solver and a more traditional object-oriented API for accessing geometric information.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant describes a scenario involving a triangle-shaped part and a square part, questioning how to calculate the distance from the tip of the triangle to the flat side of the square, suggesting a need for a better API.
  • Another participant mentions that such geometric calculations are typically handled by a constraint solver, specifically referencing D-Cubed 3D DCM by Siemens.
  • There is a request for a simple explanation of what a constraint solver is and how it compares to using an object-oriented API.
  • One participant expresses skepticism about the necessity of a constraint solver for simple problems, likening it to using an overly powerful engine for a small vehicle.
  • A participant questions the "constraint" aspect of the examples provided, suggesting they resemble variable change propagation in functional programming, and speculates on the terminology used in the CAD field.
  • Another participant references the theory of kinematic pairs in machines to explain the constraint aspect, linking it to a Wikipedia page for further context.
  • A participant with a background in CAD software design explains that a constraint solver uses numerical methods to solve a series of constraints in a CAD assembly model, providing an example involving the human elbow's motion constraints.
  • This participant also critiques the usability of CAD APIs, noting that many are outdated and unintuitive.

Areas of Agreement / Disagreement

Participants express varying levels of understanding and skepticism regarding the necessity and functionality of constraint solvers versus object-oriented APIs. There is no consensus on the best approach or the clarity of the concept of constraints in this context.

Contextual Notes

Some participants highlight limitations in their understanding of geometry and the terminology used in CAD, indicating that the discussion may benefit from clearer definitions and examples.

cave_cat
Messages
40
Reaction score
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
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:
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.
 
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.
 

Similar threads

  • · Replies 0 ·
Replies
0
Views
4K
Replies
9
Views
7K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 22 ·
Replies
22
Views
4K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 35 ·
2
Replies
35
Views
11K
  • · Replies 14 ·
Replies
14
Views
5K
  • · Replies 25 ·
Replies
25
Views
6K