This project is read-only.

Making transformed figures independent, Extend and Trim Behavior

Apr 20, 2010 at 6:18 PM

I'm posting a copy of an email exchange I had with Max.  Perhaps others would like to offer ideas.

----------- Max's Email ------------------------------

Hello David,

I'm very interested in Dynamic geometry project. I have added nothing so far, but I'm going to improve some parts, if Kirill agree with me, then I will share my code. By the way, I see that you have contributed significant improvement to code and you of course understand code good. Could you explain me two things. First is I don't need to keep dependencies during translation object, other words how can I clone object and make new one as separated copy (stand alone). The other question, I need to implement "extend" and "trim" command for all linear objects (probably for circles and arcs too in future). I'm sure you know, but just in case to avoid misunderstandings. "Extend" - is command which allows you to prolong selected line to another one which is not parallel to first. "Trim" - is command which allows you to cut line with using another lines or figures. AutoCAD can give you probably the best example of these CAD tools.

I very appreciate for any help and advices.  Thank you for cooperation.


------------- My response ---------------------------------------

I'm new to Live Geometry but I'm also very interested in it.  Glad to learn that you are thinking of contributing.  My interest is in using the code to help implement a cross-platform version of a geometry program I created called Tabula.  Right now it's a MacOS only destop app.  Here's the website if you are interested.
Creating independent objects with transformations is a great idea.  I'd also like to see this functionality.  One way to get this done is to have the user check a "transform a copy" checkbox in the properties grid (the box that shows up when one starts a transformation).  Then in each creator (TranslationCreator for example) the CreateAndAddFigure method would look to the checkbox and either create a FreePoint or a TranslationPoint.
Would it be okay with you if I created a discussion at the live geometry codeplex site?  Kirill or another developer might have a suggestion or two.  Kirill and I have been considering ways to change a point from one class to another (like a FreePoint to an IntersectionPoint).  This is related to your ideas on having a transformed point become a free point.
As far as extend and trim, I'd suggest looking at the SquareCreator.  You could make new behaviors for the toolbar, perhaps called "Extend" and "Trim", that perform hidden constructions just like SquareCreator does.  For example, extend could construct a line on top of the first segment, constuct a point at the intersection of the line and the second segment or figure, create a new segment that goes to the intersection point and hides all but the last segment. Again, Kirill, who is a much more experienced programmer than I am, may have some ideas.
Good luck,
Apr 27, 2010 at 8:39 AM

Hi all,

check out my latest changeset. It has an ability to convert between different figure types at runtime. For example, click a Segment and you'll be able to convert it to a Ray or a Line.

Hope this helps!


Apr 27, 2010 at 7:15 PM


So glad you added that.  I'll follow your example and add some more conversions.  This will also be the model I'll follow in Tabula.