I like to type mathematics (using LaTeX) and want to add diagrams to the documents that I create. I am trying to learn Inkscape (version 0.48) (mainly because typing latex directly is fantastic, and I no longer have access to Illustrator)
Back in my artworker days I was a dab-hand with illustrator 8-CS2, and three of the things I desperately miss are
1) the ability to position an object relative to any of reference points on its bounding box (upper left, mid left, bottom left, ..., centre)
2) The ability to update data fields with simple arithmetic (for example I might wish to create two contiguous arcs with the following start/end line rotations: [0, r1], [r1, r1+r2]), currently to do this I have to switch windows, calculate the results I require and then reswitch windows and paste the results - this is quite slow!
3) The ability to repeat a transform (for example I might specify that the transformation of an object be a duplication and a translation - I would then specify the number of times I wish to apply the same transformation (which would act on the last object moved)
Is it the case that it is possible to get this behaviour in my current version and I simply don't know it well enough?, or otherwise are there any stable plugins I should be aware of?
I know that i can use guides, grids, etc... but it doesn't really marry up well with the way I work (when I have the time I will delve into postscript - but not yet)
inkscape arithmetic and transforms
Re: inkscape arithmetic and transforms
Welcome aboard!
Here is a nice collection of tutorials by Brynn, that may show you something new: http://forum.inkscapecommunity.com/index.php
- For that, use the align and distribute panel (Ctrl+Shift+A).
It can be handy in several other things as well. - Not sure what are you after with this.
You can use dynamic offsetting for example on both arches, and type in the radius value at the xml editor panel (Shift+Ctrl+X)
-actually it's not so precise if the resulting path's radius is small-
I do wish for the ability to create "dynamic blocks", but that doesn't exist right now. - There is a tiled clone panel that can cover this under edit>clones>create tiled clones.
Here is a nice collection of tutorials by Brynn, that may show you something new: http://forum.inkscapecommunity.com/index.php
-
- Posts: 12
- Joined: Fri Sep 20, 2013 6:16 am
Re: inkscape arithmetic and transforms
i, thanks for answers and the welcome.
For answer (1), can you suggest a better way of doing this than my own method, since this one is a bit fiddly for positioning relative to object centre. In particular, I use an dummy box positioned at (0,0) of width/height equal to the x and y ordinates I'm interested in, and then align left/right/top/or bottom as required. As for centre though (since I don't care about the stationary dummy object's centre) I find myself having to add or subtract half width/height to put my object where I want it (and the "problem" of calculating and evaluating this leads me on to (2)) ...
As for what I'm after with (2) (and my apologies for such wrong notation! - the r in r1 was meant to denote rotation - not radius), Imagine you're trying to construct a pie chart. Setting the first segment is straight forward enough, (for an internal angle theta_1, the start and end rotations of its defining radial lines, relative to the x-axis, will be 0 and theta_1 respectively). As for the second segment with internal angle theta_2, its start rotation will be theta_1, and its end rotation will be theta_1 + theta_2 (and in most cases the sum is too unwieldy to do in my head) - I would like to be able to evaluate the expression "theta_1 + theta_2" in the "End" field as opposed to calculating it elsewhere and pasting in the result.
As for the xml editor (and for some reason, the xml representation of angle is in radians whilst in the gui it is degrees), I don't have much luck using the UI (since I can only click on things and change their labels (as opposed to values)), I can only do actual edits in the svg text file itself (which is slow) - What am I missing?
Regarding solution (3) I never knew about that functionality (thanks for that), however for transforms that include rotations this one doesn't work so well since it seems to use the coordinate system of the parent (as opposed to the last clone whose coordinate system has been rotated)
Thankyou for the tutorials, I shall certainly have a look at them!
For answer (1), can you suggest a better way of doing this than my own method, since this one is a bit fiddly for positioning relative to object centre. In particular, I use an dummy box positioned at (0,0) of width/height equal to the x and y ordinates I'm interested in, and then align left/right/top/or bottom as required. As for centre though (since I don't care about the stationary dummy object's centre) I find myself having to add or subtract half width/height to put my object where I want it (and the "problem" of calculating and evaluating this leads me on to (2)) ...
As for what I'm after with (2) (and my apologies for such wrong notation! - the r in r1 was meant to denote rotation - not radius), Imagine you're trying to construct a pie chart. Setting the first segment is straight forward enough, (for an internal angle theta_1, the start and end rotations of its defining radial lines, relative to the x-axis, will be 0 and theta_1 respectively). As for the second segment with internal angle theta_2, its start rotation will be theta_1, and its end rotation will be theta_1 + theta_2 (and in most cases the sum is too unwieldy to do in my head) - I would like to be able to evaluate the expression "theta_1 + theta_2" in the "End" field as opposed to calculating it elsewhere and pasting in the result.
As for the xml editor (and for some reason, the xml representation of angle is in radians whilst in the gui it is degrees), I don't have much luck using the UI (since I can only click on things and change their labels (as opposed to values)), I can only do actual edits in the svg text file itself (which is slow) - What am I missing?
Regarding solution (3) I never knew about that functionality (thanks for that), however for transforms that include rotations this one doesn't work so well since it seems to use the coordinate system of the parent (as opposed to the last clone whose coordinate system has been rotated)
Thankyou for the tutorials, I shall certainly have a look at them!
Re: inkscape arithmetic and transforms
I usually use that align and distribute panel for constructions, and the snapping option where possible.
Some cases I use a "spacer object".
Like in your example, if you duplicate the original object (Ctrl+D), you can resize it proportionally by a % value at the top,
and use it as an object that you can align the other objects next to it.
Works the same as if there was a guide line through the centre of the original object, and you don't have to calculate the right size manually.
For the second one, creating pie charts -if there will be a dynamic block feature...- is a hard one with a "live way".
There is the possibility to write an extension to render a pie chart but that won't be live that you could later modify its values.
What else to try:
the transformation panel (Shift+Ctrl+M), if you rotate an object marking the start/endpoint of arches, may help creating a seemingly good result.
By rotating it manually to a starting point, you can type in the rotation value to the panel and rotate the object with it,
and place the arch's end node to position manually. Approximate solution, but can work well for most cases.
Another thing, is the "bend" live path effect that I haven't experienced with, so it's just my theory:
if you represent the arches by rectangles next to eachother, with that effect you could bend them into a circular shape,
where you could modify the original rectangle's rations, appearing in the circular chart.
Some cases I use a "spacer object".
Like in your example, if you duplicate the original object (Ctrl+D), you can resize it proportionally by a % value at the top,
and use it as an object that you can align the other objects next to it.
Works the same as if there was a guide line through the centre of the original object, and you don't have to calculate the right size manually.
For the second one, creating pie charts -if there will be a dynamic block feature...- is a hard one with a "live way".
There is the possibility to write an extension to render a pie chart but that won't be live that you could later modify its values.
What else to try:
the transformation panel (Shift+Ctrl+M), if you rotate an object marking the start/endpoint of arches, may help creating a seemingly good result.
By rotating it manually to a starting point, you can type in the rotation value to the panel and rotate the object with it,
and place the arch's end node to position manually. Approximate solution, but can work well for most cases.
Another thing, is the "bend" live path effect that I haven't experienced with, so it's just my theory:
if you represent the arches by rectangles next to eachother, with that effect you could bend them into a circular shape,
where you could modify the original rectangle's rations, appearing in the circular chart.
-
- Posts: 2344
- Joined: Sun Apr 14, 2013 12:04 pm
- Location: Michigan, USA
Re: inkscape arithmetic and transforms
I'm not sure if this is useful, but it might be worth noting that LibreOffice Calc (spreadsheet) generates vector charts.
I occasionally copy charts I make in Calc and paste them into Inkscape for tweaking.
I occasionally copy charts I make in Calc and paste them into Inkscape for tweaking.
Have a nice day.
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
- shawnhcorey
- Posts: 149
- Joined: Mon Jan 07, 2008 12:17 pm
Re: inkscape arithmetic and transforms
Wouldn't Object -> Transform... give precise positioning and rotations?
Re: inkscape arithmetic and transforms
Hi.
For your line of work have a look at VEUSZ. http://home.gna.org/veusz/
The learning curve is a little steep but the results is really worth the effort!
RGDS
Ragnar
For your line of work have a look at VEUSZ. http://home.gna.org/veusz/
The learning curve is a little steep but the results is really worth the effort!
RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar
( ͡° ͜ʖ ͡°)
RGDS
Ragnar
-
- Posts: 12
- Joined: Fri Sep 20, 2013 6:16 am
Re: inkscape arithmetic and transforms
Thanks for the responses all - I will respond to them all within the same post ...
Lazur URH
---------
As for your first suggestion, though I agree that the spacer object would acheive the desired result (position centre), the amount of operations I would need to perform is comparible to the number of ops in manually calculating the new position. I believe this can be scripted though (At some point (not yet) I might see if I'd be allowed to fix some easy bugs to familiarise myself with the codebase)
For your second, it's a clever idea, but I think I'm still left in the same situation that I am doing too much work (and in general, I can think of many other situations where a field's value relies on the computation of some arithmetic expression where this solution would not apply)
Finally the bend suggestion is interesting, but it doesn't really suit the way I work in general - if an object has a simple geomtrical description then I prefer to remain faithful to that.
All that said, actually considering and discussing your suggestions has equipped me with some useful tricks, and a better direction on how I ought to script these features myself (if that's possible, I haven't really looked into the scripting capabilities yet) - so thanks again for that.
tylerdurden
-----------
The libre-office suggestion is interesting - and I'm sure there are a number of easy wins in there (though with the exception of those times people ask me to send them .doc files instead of pdfs, I tend to leave it well alone)
shawnhcorey
-----------
It would for simple transforms, but for creating new objects in terms of compound transforms things don't seem so trivial (it's doable - but not effortless).
ragstian
--------
Thanks for that, another mathematical tool to play with is always good! (and if you are similarly inclined to use this sort of software for producing drawings or graphics, may I recommend you look at maxima http://maxima.sourceforge.net/(it's plots can be saved as ps files), and is almost as fully-featured as mathematica))
Lazur URH
---------
As for your first suggestion, though I agree that the spacer object would acheive the desired result (position centre), the amount of operations I would need to perform is comparible to the number of ops in manually calculating the new position. I believe this can be scripted though (At some point (not yet) I might see if I'd be allowed to fix some easy bugs to familiarise myself with the codebase)
For your second, it's a clever idea, but I think I'm still left in the same situation that I am doing too much work (and in general, I can think of many other situations where a field's value relies on the computation of some arithmetic expression where this solution would not apply)
Finally the bend suggestion is interesting, but it doesn't really suit the way I work in general - if an object has a simple geomtrical description then I prefer to remain faithful to that.
All that said, actually considering and discussing your suggestions has equipped me with some useful tricks, and a better direction on how I ought to script these features myself (if that's possible, I haven't really looked into the scripting capabilities yet) - so thanks again for that.
tylerdurden
-----------
The libre-office suggestion is interesting - and I'm sure there are a number of easy wins in there (though with the exception of those times people ask me to send them .doc files instead of pdfs, I tend to leave it well alone)
shawnhcorey
-----------
It would for simple transforms, but for creating new objects in terms of compound transforms things don't seem so trivial (it's doable - but not effortless).
ragstian
--------
Thanks for that, another mathematical tool to play with is always good! (and if you are similarly inclined to use this sort of software for producing drawings or graphics, may I recommend you look at maxima http://maxima.sourceforge.net/(it's plots can be saved as ps files), and is almost as fully-featured as mathematica))
Re: inkscape arithmetic and transforms
Hi
TheHappyHexagon, if you are into MATLAB® or Mathematica® you might be interested in another free alternative - matplotlib for Python.
Check this out; http://matplotlib.org/
Good Luck.
Please post examples of your work!
Thanks for the Maxima "pointer" - will check it out!
RGDS
Ragnar
TheHappyHexagon, if you are into MATLAB® or Mathematica® you might be interested in another free alternative - matplotlib for Python.
Check this out; http://matplotlib.org/
Good Luck.
Please post examples of your work!
Thanks for the Maxima "pointer" - will check it out!
RGDS
Ragnar
Good Luck!
( ͡° ͜ʖ ͡°)
RGDS
Ragnar
( ͡° ͜ʖ ͡°)
RGDS
Ragnar
Re: inkscape arithmetic and transforms
TheHappyHexagon wrote:I would like to be able to evaluate the expression "theta_1 + theta_2" in the "End" field as opposed to calculating it elsewhere and pasting in the result.
I wonder if the use of "theta", "r", "expression" and so on is making this sound like a more complex question than it really is. Is your issue really as simple as this: "I would like to type 5.3+12.6 into a field, and have it automatically turn into 17.9". If you just want to use simple mathematical expressions like that then the good news is that it's on the roadmap for Inkscape 0.49, and is already present in development builds:
http://wiki.inkscape.org/wiki/index.php ... _spinboxes
What you can't do, however, is have the "end" value of an arc automatically pick up the "start" value. I.e. if your start angle is 22.5 then you can't enter "start + 10.5" or anything similar, you would have to type "22.5 + 10.5". But it should still be less work than switching windows to do the maths somewhere else.
-
- Posts: 12
- Joined: Fri Sep 20, 2013 6:16 am
Re: inkscape arithmetic and transforms
Xav
----
That's precisely what I'm after! Yeah perhaps I need to simplify my posts (and yes I think I shall grab the latest dev build because this feature is vital)
ragstian
----------
Thanks for that, as for examples of my work - it is a long time since I did anything that would qualify as being creative - for what its worth though, my current project has been to take an old statitistics book out of copyright (poorly scanned) and rewrite it in latex (almost done - need to auto-generate some tables - and fix spelling and typos) - my main task is to create the diagrams and then I shall post it somewhere to be adopted by others. I'll post a link when done
----
That's precisely what I'm after! Yeah perhaps I need to simplify my posts (and yes I think I shall grab the latest dev build because this feature is vital)
ragstian
----------
Thanks for that, as for examples of my work - it is a long time since I did anything that would qualify as being creative - for what its worth though, my current project has been to take an old statitistics book out of copyright (poorly scanned) and rewrite it in latex (almost done - need to auto-generate some tables - and fix spelling and typos) - my main task is to create the diagrams and then I shall post it somewhere to be adopted by others. I'll post a link when done