Curves

Chris Goedde cgoedde at condor.depaul.edu
Wed Jan 18 08:05:42 PST 2006


On Jan 17, 2006, at 6:14 PM, david wrote:

> I need to draw graphs like 
> <http://upload.wikimedia.org/wikipedia/en/7/73/Indifference_curve.png> 
> but neither the arc-shape or the bezier-tool seems to let me draw 
> _symmetric_ curves with an angle less than 90° (actually ¼/2).
>
> I am sure this can be accomplished, I guess I just need some hints in 
> the right direction:-)

I don't think there is any simple way to do what (I believe) you want 
to do. OG's drawing tools still lack a lot of features.

However, with a little persistence and knowledge, it's possible to 
create new shapes in OG. If you search the archives of this mailing 
list for "graffleshapes tutorial" you will find a message saying how to 
do it.

As an example, I modified the existing quarter arc shape to make it 
more like the shape you are looking for. To use this shape in OG, copy 
everything between the "SNIP HERE" lines below and save them in a text 
file. It doesn't matter the name you give the file, but the extension 
MUST be .graffleshapes. I used "test.graffleshapes". Save the file in 
your home directory in the folder ~/Library/Application 
Support/OmniGraffle/Shapes (you may need to create this folder). Then, 
the next time you open OG, you should see a new shape next to the arc 
shape in the Shape Tool inspector. You can now use this shape just like 
any other shape.

I based this shape on the existing arc shape, just changing the control 
points for the bezier curves. If you look at the shape definition, you 
see lines like:

control1 = "{.052284, -0.4}";
control2 = "{.40, -.052284}";

These were originally

control1 = "{.052284, -0.5}";
control2 = "{.50, -.052284}";

I just changed the .5 to .4. You can play around with these numbers to 
get different shapes. All you have to do is quit and restart OG after 
changing the .graffleshapes file to pick up the changes.

You can add as many new shapes as you like. I would suggest duplicating 
the file for each new shape, and changing the InspectorGroup number and 
the ShapeName for each shape (the InspectorGroup number determines 
where the shape appears in the shape inspector). Note that OG is very, 
very particular about the format of these files, if you have one 
semicolon or parentheses out of place, it won't work, so I don't 
recommend changing anything except the numbers unless you really know 
what you are doing.

Hope this helps.

Chris Goedde

------SNIP HERE, DON'T INCLUDE THIS LINE-----
{
     shapes = (
         {
             InspectorGroup = 26.5;
             ShapeName = TestArc;
             FillPath = {
                 elements = (
                     {element = MOVETO; point = "{-.5, 0.5}"; },
                     {element = LINETO; point = "{-.5, -0.5}"; },
                     {
                         control1 = "{.052284, -0.4}";
                         control2 = "{.40, -.052284}";
                         element = CURVETO;
                         point = "{.50, 0.5}";
                     },
                     {element = LINETO; point = "{-.50, 0.5}"; }
                 );
             };
             StrokePath = {
                 elements = (
                     {element = MOVETO; point = "{-.5, -0.5}"; },
                     {
                         control1 = "{.052284, -0.4}";
                         control2 = "{.40, -.052284}";
                         element = CURVETO;
                         point = "{.50, 0.5}";
                     }
                 );
             };
             TextBounds = "{{0.1, .3}, {.8, .7}}";
         }
     );
}
------SNIP HERE, DON'T INCLUDE THIS LINE-----




More information about the OmniGraffle-Users mailing list