4 ms·
Could we use this for arbitrary constraints like for mechanical modeling, or 3d animation?
by all2 7y ago
Could we use this for arbitrary constraints like for mechanical modeling, or 3d animation?
- wikunia 7y agoCan you give me an example of how this would look like? This is an ongoing series so at the moment my solver can't solve much :D
- all2 7y agoI think this is a good example of mechanical constraints. https://cad.onshape.com/help/Content/constraints.htm https://cad.onshape.com/help/Content/constraints.htm Onshape is free to demo, so give it a whirl?
- throwaway_bad 7y agoI am not sure if it's what the OP meant, but g9.js has a lot of neat interactive examples: http://omrelli.ug/g9/gallery/ http://omrelli.ug/g9/gallery/ Basically you write a renderer for some data and have a constraint solver (just backprop I think for g9) to solve for the best data that will render something that fits the user input.
- joe_the_user 7y agoI think the idea of a constraint solver is you begin with a constraint; Test(X), where X is in some large space S and Test is some expression yielding true or false. Then the solver uses some magic to parse Test so that it can search S more efficiently than just loop over it. So if the solver is small enough, it seems like 3d animation could be done but the might need to be somewhat aware of that use. See: https://en.wikipedia.org/wiki/Constraint_programming https://en.wikipedia.org/wiki/Constraint_programming
- ausbah 7y agoIt isn't magic! To the best of my knowledge it's all about framing the problem as a graph, then performing a search on the graph to find solutions with some heuristics.
- joe_the_user 7y ago"Magic" is just jargon for a complicated algorithm.
- deleted 7y ago[deleted]
- jefft255 7y agoFrom a quick glance, this and most software doing “constraint programming” deal with discrete problems. Not saying those are useless for mechanical modeling or 3D animation, but those areas typically deal with continuous constraints which require different solvers. My experience in this is limited to a single class in CP 3 years ago so take this with a grain of salt!!
- deleted 7y ago[deleted]
- kdmccormick 7y agoWhat about mechanical constraints that are expressed in terms of integer ratios? Could constraint programming be useful for that subset of mechanical constraints?
- tobmlt 7y agoUsing interval arithmetic and interval analysis, constraint solving can be extended to continuous problems. This seems first to have been done in the 80s by extending Prolog. As you say, most constraint software does not do this, but I vouch that it both exists and works! I wrote a relational interval constraint solver for automated CAD design. It used constraints to eliminate infeasible regions of a design space before a nonlinear solver would generate the actual geometry. It was pretty fun puzzling out how to build this thing!
- tobmlt 7y agoAs part of my PhD dissertation, I wrote an "interval valued" constraint solver and a Python internal DSL based originally on miniKanren, that ran it. The intervals handle the floating point in interval chunks, allowing for set-like reasoning and relational constraint programming atop floating point. I used it to operate on a design space as a single entity, or sliced into finite chunks, and to cut out sub-spaces of infeasible designs by constraint propagation. I think interval valued relational constraint programming could be extended (and probably already has) for mechanical modeling, and 3D animation, yes. But the utility of a purely discrete constraint solver, such as the one posted here, is maybe less for these types of cases. Interval systems methods (for solving nonlinear equations) have a long history in optimization and motion planning. No reason a constraint solver couldn't be applied there. Similarly, if you have a specific use case, I could try and offer more about constraint solving for it. I should also note that constraint solving with real or and especially interval data goes back to at least the 80s. I just made use of some low hanging fruit!