## Re: [brlcad-devel] Summary from yesterday's discussions re: parametrics/constraints

 Re: [brlcad-devel] Summary from yesterday's discussions re: parametrics/constraints From: Bryan Bishop - 2009-03-23 14:19:37 ```On Thu, Mar 19, 2009 at 4:41 PM, Christopher Sean Morrison wrote: > On Thursday, March 19, 2009, at 03:12PM, "Bryan Bishop" wrote: >>Can someone help clarify the following section? >>""" >>Implicit : Constraints implicit in the definition of a primitive : >>Tangency or perpendicularity of Vectors, Equality of scalars etc. >>Explicit : Constraints explicitly expressed between two or more primitives. >> >>One of the intricate parts of the work is the actual integration of >>libpc with librt. Associated work going on with libpc involves the >>creation of a Math Virtual Machine for parsing and evaluating (math) >>expressions which would be used for stating the constraints, along >>with the grammar. >>""" > > Dawn can explain it in better detail, but consider a simple sphere that > is simply stored as a point and two vectors.  To be "a sphere", there is > an implicit constraint that the vectors are equal in magnitude (equal to > the radius of the sphere) and for orientation purposes, they should be > perpendicular to each other.  Now take two spheres and you might want to > guarantee that they are always perfectly tangent to each other -- that'd be > an explicit constraint.  Or consider just the one sphere and say that you > want to require that the sphere always have a radius between 1 meter and > 12 meters -- another explicit constraint.  Those constraints, whether implicit > or explicit are a series of expressions that associate with and refer to geometric > entities.  The MVM he refers to there is a system for evaluation those > expressions and constraints. I see. I need to think some more about how to represent the difference between explicit and implicit constraints if something like GraphSynth were to be used. Implicit constraints seem to be attached to objects, while explicit constraints seem to be externally imposed- either a constant, or related to another variable and how that other variable changes. An MVM does sound useful, and I think it would be even more appropriate, rather than just having a small data structure for the expression of these types of constraints that would be converted into the GraphSynth GXML format directly. Actually, since it's still raw data it can conceptually be converted, but I don't know if I want to write a compiler grammar for doing that :-) and an MVM might be more useful. So that's something to take into account. > This is pretty common in most CAD systems where you can > fully/under/over constrain a given model.  Some even give you > a convenient little red light / green light to let you know when you're > fully constrained. Yes, I've seen something like that before, and actually I was wondering- at the time when I saw a conflict of constraints in a commercial CAD environment- why they didn't just give me a list of possible solutions or a list of possible things that I did that foobar'd the model, which seems like something BRLCAD definitely wants to implement if it gets a constraints solver (or even constraints representation as a first step?). >>GraphSynth >>http://graphsynth.com/ > > Interesting project, assuming it could be made available under some compatible license. LGPL? Okay. I'll look into it. > Practical integration and portability issues given it was implemented in C#, though. Hrm, well, luckily the code base is well-separated, and it would be possible to rewrite chunks of it into, say, C++, since it's mostly the Representation module that's interesting here, plus another module which contains the search-and-replace backend code, which if I recall doesn't require too heavily on C# features, but I could be wrong and I agree this does make it less appealing- especially if Dawn is still working on another implementation of all this :-). >>Example, re: gears >>http://heybryan.org/~bbishop/docs/gears/gears.html > > The registered name servers for heybryan.org (afraid.org) seem to be dead.  Might want > to consider managing your own DNS via something like zoneedit.com or figuring out why > afraid.org's DNS is down.  Anything that works is very likely just giving a cached result > from before they went down but that should eventually time out. Gaah, I still have to get around to doing this. :-) Thanks for the hints. >>** Relevant diagrams- ** >> [ snip ] > > All interesting and food for thought, but where were you going with that (all those > situational diagrams) again? :)  Otherwise, I'd need a concrete use-case example before > I could say much of value other than "ok". Ah, well, I was reading the BRLCAD wiki and there was a plea for diagrams when proposals are typed up, so those are some diagrams of the backend system of GraphSynth. For instance, a few of those were explaining how a subgraph is found and replaced such that no dangling arcs or edges are left over, among other things. Now, if GraphSynth was to be implemented- which it seems increasingly like it shouldn't- for BRLCAD, MVM or some data structure would be passed over, it would be converted into a graph, there'd be a set of rules (search-and-replace rules, essentially) that find constraints and then give a possible solution to that subgraph of the larger graph (the entire problem); at the end you'd get back a list set of graphs that would represent solutions, possibly with numerical values, of the solutions to the constraints problem. > Concur that a few test cases are really required. Yep, should I bug Dawn about this? >>So, if I can get some feedback on those issues, that would be great, >>and maybe also whether or not anyone would be interested in my working >>on this for GSoC? I have to admit that I'm a little sketchy on some of > > There is definitely the potential for some conflict here given it was a GSoC > project last year.  I'd hate to see us lose a capable developer just because > two capable guys only applied to the same idea.  Are there other projects that > interest you or is this the only one? Hrm. Yes, I remember there being something about a web-based solid geometry model repository? http://brlcad.org/wiki/Google_Summer_of_Code/Project_Ideas#Web-based_solid_geometry_model_repository I have been wanting to do something like this for a while now, *but* I've been eyeing doing it with parametrically constrained models, so I don't know how I feel about heavy integration with BRLCAD shell utilities. Any thoughts on this? - Bryan http://heybryan.org/ 1 512 203 0507 ```

 Re: [brlcad-devel] Summary from yesterday's discussions re: parametrics/constraints From: Christopher Sean Morrison - 2009-03-19 21:41:58 ```Dios mio! Maybe try one question at a time next time... :-) On Thursday, March 19, 2009, at 03:12PM, "Bryan Bishop" wrote: >I enjoyed our conversation yesterday in the channel. I was wondering >about a few things, and also figure some of the thoughts should be >documented if I'm going to seriously consider GSoC 2009 with BRLCAD >:-). First, some links. (And for the record, I don't know if this >should be counted as an official GSoC application, since I am more >interested in getting feedback at this point.) They can't be counted as official GSoC applications, not how it works. You actually post your application directly through the sochop GSoC site to the BRL-CAD project when the time comes. For now, it's all just discussion. >Can someone help clarify the following section? >""" >Implicit : Constraints implicit in the definition of a primitive : >Tangency or perpendicularity of Vectors, Equality of scalars etc. >Explicit : Constraints explicitly expressed between two or more primitives. > >One of the intricate parts of the work is the actual integration of >libpc with librt. Associated work going on with libpc involves the >creation of a Math Virtual Machine for parsing and evaluating (math) >expressions which would be used for stating the constraints, along >with the grammar. >""" Dawn can explain it in better detail, but consider a simple sphere that is simply stored as a point and two vectors. To be "a sphere", there is an implicit constraint that the vectors are equal in magnitude (equal to the radius of the sphere) and for orientation purposes, they should be perpendicular to each other. Now take two spheres and you might want to guarantee that they are always perfectly tangent to each other -- that'd be an explicit constraint. Or consider just the one sphere and say that you want to require that the sphere always have a radius between 1 meter and 12 meters -- another explicit constraint. Those constraints, whether implicit or explicit are a series of expressions that associate with and refer to geometric entities. The MVM he refers to there is a system for evaluation those expressions and constraints. This is pretty common in most CAD systems where you can fully/under/over constrain a given model. Some even give you a convenient little red light / green light to let you know when you're fully constrained. >GraphSynth >http://graphsynth.com/ Interesting project, assuming it could be made available under some compatible license. Practical integration and portability issues given it was implemented in C#, though. >Example, re: gears >http://heybryan.org/~bbishop/docs/gears/gears.html The registered name servers for heybryan.org (afraid.org) seem to be dead. Might want to consider managing your own DNS via something like zoneedit.com or figuring out why afraid.org's DNS is down. Anything that works is very likely just giving a cached result from before they went down but that should eventually time out. >** Relevant diagrams- ** > [ snip ] All interesting and food for thought, but where were you going with that (all those situational diagrams) again? :) Otherwise, I'd need a concrete use-case example before I could say much of value other than "ok". >constraints problem when resizing, or something?) How about some user >case stories? That would be amazingly helpful. I suspect this code >would be implemented and integrated as the backend constraints >solution engine, but I'm also open to the idea of gluing it together >with shell or command line utilities depending on how exactly it's >supposed to work when seamlessly integrated (just to make sure I >understand completely). Concur that a few test cases are really required. Dawn has worked on a few test cases as part of the low-level work done to date, but there's not yet a high-level set of test cases or use cases of how it will become exposed to a user. >So, if I can get some feedback on those issues, that would be great, >and maybe also whether or not anyone would be interested in my working >on this for GSoC? I have to admit that I'm a little sketchy on some of There is definitely the potential for some conflict here given it was a GSoC project last year. I'd hate to see us lose a capable developer just because two capable guys only applied to the same idea. Are there other projects that interest you or is this the only one? >however has expressed an interest in throwing it up as GPL (or >possibly LGPL), but I feel this is a minor detail and something that >can be fixed. GPL would be a non-starter. LGPL would be okay. BSD is the easiest and most flexible for dependency management. It's only a minor issue if it's not an issue. :-) There are other concerns, though, about the fact that it's implemented in C# that would have to be considered. > [snip] >intense fellow. Hi. Please don't make me list all past programming >projects :-). More stuff on my website for the "about me" aspects- >feel free to email me off-list if this isn't detailed enough, so that >I don't clog the mailing list with "me me me" :-). No need. You could say just about anything and it may or may not be fully correlated with a reasonable representation of you. What I've found to be much more effective is to actually see how folks code. That's why one of our application requirements is that folks provide a patch of some sort. It's a means to evaluate whether students can communicate effectively, productively, have actually worked with our code, can get stuff done, etc. >After looking at Manuel's application, maybe I've gone a bit overboard >here with details? *Waaay* overboard. Fortunately, it's not an application, it's just an e-mail. Try to aim for some clarify of thought, though. ;-) Pleasure to meet you Bryan and welcome! Look forward to seeing how your idea(s) and submission(s) develop. Cheers! Sean ```
 Re: [brlcad-devel] Summary from yesterday's discussions re: parametrics/constraints From: Christopher Sean Morrison - 2009-03-24 17:39:03 ``` On Monday, March 23, 2009, at 10:19AM, "Bryan Bishop" wrote: >I see. I need to think some more about how to represent the difference >between explicit and implicit constraints if something like GraphSynth >were to be used. Implicit constraints seem to be attached to objects, >while explicit constraints seem to be externally imposed- either a >constant, or related to another variable and how that other variable >changes. An MVM does sound useful, and I think it would be even more >appropriate, rather than just having a small data structure for the >expression of these types of constraints that would be converted into >the GraphSynth GXML format directly. Actually, since it's still raw >data it can conceptually be converted, but I don't know if I want to >write a compiler grammar for doing that :-) and an MVM might be more >useful. So that's something to take into account. There's not really any need to distinguish between an implicit and explicit constraint. The same solving system works for either as they're just series of expressions. Moreover, the implicit ones are going to be hard-wired into the source code for the primitives themselves as an intrinsic property so there isn't going to be a way for users to change those expressions. The primitives just declare their set of (implicit) requirements and will validate their internal consistency when requested (some sort of validate() routine and/or during ray-trace prep()). >Yes, I've seen something like that before, and actually I was >wondering- at the time when I saw a conflict of constraints in a >commercial CAD environment- why they didn't just give me a list of >possible solutions or a list of possible things that I did that >foobar'd the model, which seems like something BRLCAD definitely wants >to implement if it gets a constraints solver (or even constraints >representation as a first step?). You've not seen possible solutions probably because their are infinite numbers of solutions. You can fully constrain any object's position, for example, by adding a constraint that their position is equal to some given absolute xyz coordinate. >LGPL? Okay. I'll look into it. It being LGPL doesn't mean we would use it or even want to use it, but not having license means it's not even something to consider. From the other discussion, it sounds like something that is a little more domain-aware would be more beneficial regardless. >Gaah, I still have to get around to doing this. :-) Thanks for the hints. Noticed that it was working from a different network a couple days ago which could mean that afraid.org may have simply gotten themselves on one of the master blacklists. Given its purpose of providing dynamic DNS, I wouldn't be surprised in the least if someone uses/used the service for some abusive purpose and got it blacklisted. >Ah, well, I was reading the BRLCAD wiki and there was a plea for >diagrams when proposals are typed up, so those are some diagrams of >the backend system of GraphSynth. For instance, a few of those were >explaining how a subgraph is found and replaced such that no dangling >arcs or edges are left over, among other things. Now, if GraphSynth >was to be implemented- which it seems increasingly like it shouldn't- >for BRLCAD, MVM or some data structure would be passed over, it would >be converted into a graph, there'd be a set of rules >(search-and-replace rules, essentially) that find constraints and then >give a possible solution to that subgraph of the larger graph (the >entire problem); at the end you'd get back a list set of graphs that >would represent solutions, possibly with numerical values, of the >solutions to the constraints problem. Diagrams aren't necessary, just very helpful if they are done well. :-) >Yep, should I bug Dawn about this? Absolutely. :) >Hrm. Yes, I remember there being something about a web-based solid >geometry model repository? > >http://brlcad.org/wiki/Google_Summer_of_Code/Project_Ideas#Web-based_solid_geometry_model_repository > >I have been wanting to do something like this for a while now, *but* >I've been eyeing doing it with parametrically constrained models, so I >don't know how I feel about heavy integration with BRLCAD shell >utilities. Any thoughts on this? Lots of thoughts on this one, and it seems to be exceptionally popular. It was the most popular submission last year, yet not selected (there were several "good" proposals, but none outstanding and none that integrated well. This is probably better discussed as a separate thread. Perhaps share what you think is meant by heavy integration and what the concerns are. Cheers! Sean ```
 Re: [brlcad-devel] Summary from yesterday's discussions re: parametrics/constraints From: Bryan Bishop - 2009-03-23 14:19:37 ```On Thu, Mar 19, 2009 at 4:41 PM, Christopher Sean Morrison wrote: > On Thursday, March 19, 2009, at 03:12PM, "Bryan Bishop" wrote: >>Can someone help clarify the following section? >>""" >>Implicit : Constraints implicit in the definition of a primitive : >>Tangency or perpendicularity of Vectors, Equality of scalars etc. >>Explicit : Constraints explicitly expressed between two or more primitives. >> >>One of the intricate parts of the work is the actual integration of >>libpc with librt. Associated work going on with libpc involves the >>creation of a Math Virtual Machine for parsing and evaluating (math) >>expressions which would be used for stating the constraints, along >>with the grammar. >>""" > > Dawn can explain it in better detail, but consider a simple sphere that > is simply stored as a point and two vectors.  To be "a sphere", there is > an implicit constraint that the vectors are equal in magnitude (equal to > the radius of the sphere) and for orientation purposes, they should be > perpendicular to each other.  Now take two spheres and you might want to > guarantee that they are always perfectly tangent to each other -- that'd be > an explicit constraint.  Or consider just the one sphere and say that you > want to require that the sphere always have a radius between 1 meter and > 12 meters -- another explicit constraint.  Those constraints, whether implicit > or explicit are a series of expressions that associate with and refer to geometric > entities.  The MVM he refers to there is a system for evaluation those > expressions and constraints. I see. I need to think some more about how to represent the difference between explicit and implicit constraints if something like GraphSynth were to be used. Implicit constraints seem to be attached to objects, while explicit constraints seem to be externally imposed- either a constant, or related to another variable and how that other variable changes. An MVM does sound useful, and I think it would be even more appropriate, rather than just having a small data structure for the expression of these types of constraints that would be converted into the GraphSynth GXML format directly. Actually, since it's still raw data it can conceptually be converted, but I don't know if I want to write a compiler grammar for doing that :-) and an MVM might be more useful. So that's something to take into account. > This is pretty common in most CAD systems where you can > fully/under/over constrain a given model.  Some even give you > a convenient little red light / green light to let you know when you're > fully constrained. Yes, I've seen something like that before, and actually I was wondering- at the time when I saw a conflict of constraints in a commercial CAD environment- why they didn't just give me a list of possible solutions or a list of possible things that I did that foobar'd the model, which seems like something BRLCAD definitely wants to implement if it gets a constraints solver (or even constraints representation as a first step?). >>GraphSynth >>http://graphsynth.com/ > > Interesting project, assuming it could be made available under some compatible license. LGPL? Okay. I'll look into it. > Practical integration and portability issues given it was implemented in C#, though. Hrm, well, luckily the code base is well-separated, and it would be possible to rewrite chunks of it into, say, C++, since it's mostly the Representation module that's interesting here, plus another module which contains the search-and-replace backend code, which if I recall doesn't require too heavily on C# features, but I could be wrong and I agree this does make it less appealing- especially if Dawn is still working on another implementation of all this :-). >>Example, re: gears >>http://heybryan.org/~bbishop/docs/gears/gears.html > > The registered name servers for heybryan.org (afraid.org) seem to be dead.  Might want > to consider managing your own DNS via something like zoneedit.com or figuring out why > afraid.org's DNS is down.  Anything that works is very likely just giving a cached result > from before they went down but that should eventually time out. Gaah, I still have to get around to doing this. :-) Thanks for the hints. >>** Relevant diagrams- ** >> [ snip ] > > All interesting and food for thought, but where were you going with that (all those > situational diagrams) again? :)  Otherwise, I'd need a concrete use-case example before > I could say much of value other than "ok". Ah, well, I was reading the BRLCAD wiki and there was a plea for diagrams when proposals are typed up, so those are some diagrams of the backend system of GraphSynth. For instance, a few of those were explaining how a subgraph is found and replaced such that no dangling arcs or edges are left over, among other things. Now, if GraphSynth was to be implemented- which it seems increasingly like it shouldn't- for BRLCAD, MVM or some data structure would be passed over, it would be converted into a graph, there'd be a set of rules (search-and-replace rules, essentially) that find constraints and then give a possible solution to that subgraph of the larger graph (the entire problem); at the end you'd get back a list set of graphs that would represent solutions, possibly with numerical values, of the solutions to the constraints problem. > Concur that a few test cases are really required. Yep, should I bug Dawn about this? >>So, if I can get some feedback on those issues, that would be great, >>and maybe also whether or not anyone would be interested in my working >>on this for GSoC? I have to admit that I'm a little sketchy on some of > > There is definitely the potential for some conflict here given it was a GSoC > project last year.  I'd hate to see us lose a capable developer just because > two capable guys only applied to the same idea.  Are there other projects that > interest you or is this the only one? Hrm. Yes, I remember there being something about a web-based solid geometry model repository? http://brlcad.org/wiki/Google_Summer_of_Code/Project_Ideas#Web-based_solid_geometry_model_repository I have been wanting to do something like this for a while now, *but* I've been eyeing doing it with parametrically constrained models, so I don't know how I feel about heavy integration with BRLCAD shell utilities. Any thoughts on this? - Bryan http://heybryan.org/ 1 512 203 0507 ```