Author Topic: How to draw "vectors" used in physics with Inkscape?  (Read 3802 times)

December 13, 2017, 12:04:09 AM
Read 3802 times

Chemist116

  • Sr. Newbie

  • Offline
  • **

  • 4
  • Gender
    Male

    Male
  • Personal Text
    Freelance scientist
I'm wondering if is there is any way to "speed up" the process of drawing the arrows used as vectors in classical mechanics diagrams.

I'm stuck at trying to recreate the image which is below. Can somebody help me with this?

The problem I have are these:

Is there any way to ensure that all arrows have the same distance?

How can I put a grid behind the picture as a background so the arrows match with the grid from its starting point to end as it appears in most textbooks?

Can this process be simplified or do I have to draw all over again for each arrow?

What I'm doing already is to use the cloning tool Crtl+D but I wonder if there is a better method?
  • 0.92.2 Portable
  • Windows 7 Starter

December 13, 2017, 11:15:31 AM
Reply #1

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
File > Document properties > Grid tab (for a grid that you can snap to)

Extensions > Render > Grid (for a grid that will be visible outside Inkscape)

Object > Align and Distribute or Object > Arrange

As the angles and lengths are all different, I'm not sure how cloning helps you. Those are just 5 arrows, I don't see a problem in recreating this manually... (make sure to use 'markers' for the arrow heads, and a dash pattern for the dashed strokes). For drawing strictly horizontally/vertically, use the corresponding setting of the Bézier tool.

December 13, 2017, 10:41:37 PM
Reply #2

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Welcome to the forum!

As we often find with Inkscape, there may be several different ways to reach a particular goal.  And also, everyone develops their own preferences.

So I think cloning is a reasonable approach.  Then you just need to rotate them to the proper angle.  However, you should make sure to always use the same object as the parent for the clones.  Files with many objects which are Clone of clone of clone of clone of etc. can become problematic.  Also, if you don't need the main feature which cloning provides, which is the ability to change the style (fill, stroke, color, opacity, etc.) of all the clones at once (by editing the parent object).  If you don't need that, then Duplicating is sufficient, and you don't need to always worry about finding the parent object, like you do with clones.

Oh....actually I'm not sure if you're using clone or duplicate.  You reported using Ctrl D, which is duplicate.  Clone is Alt D.

Is there any way to ensure that all arrows have the same distance?

Cloning, duplicating and copying all results in arrows of the same length.  So I'm thinking that I don't understand your question.  Do you mean you want the arrow objects to all be the same width, no matter at which angle they lie?  Oh, or do you mean the same distance apart?

How can I put a grid behind the picture as a background so the arrows match with the grid from its starting point to end as it appears in most textbooks?

I'm not familiar such books.  Can you show an example?
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

December 14, 2017, 06:09:20 AM
Reply #3

Chemist116

  • Sr. Newbie

  • Offline
  • **

  • 4
  • Gender
    Male

    Male
  • Personal Text
    Freelance scientist
File > Document properties > Grid tab (for a grid that you can snap to)

Extensions > Render > Grid (for a grid that will be visible outside Inkscape)

Object > Align and Distribute or Object > Arrange

Thanks for the tip.

As the angles and lengths are all different, I'm not sure how cloning helps you. Those are just 5 arrows, I don't see a problem in recreating this manually... (make sure to use 'markers' for the arrow heads, and a dash pattern for the dashed strokes). For drawing strictly horizontally/vertically, use the corresponding setting of the Bézier tool.

Regarding the dash pattern I am not sure how to do it "the best way". Drawing a straight line and then selecting stroke as dashed is good but the separation between each segment is given by default. How about if i want to make the distance bigger?.

Welcome to the forum!

Thanks!. Although I felt shy to post questions I look forward to learn more.

Welcome to the forum!

As we often find with Inkscape, there may be several different ways to reach a particular goal.  And also, everyone develops their own preferences..

Oh....actually I'm not sure if you're using clone or duplicate.  You reported using Ctrl D, which is duplicate.  Clone is Alt D.

Cloning, duplicating and copying all results in arrows of the same length.  So I'm thinking that I don't understand your question.  Do you mean you want the arrow objects to all be the same width, no matter at which angle they lie?  Oh, or do you mean the same distance apart?

Regarding what you mentioned about cloning I had a mistake, it was duplicate the tool I was using.

Actually my question was about arrows lenght, but since I'm using duplicate there shouldn't be matter of concern.

How can I put a grid behind the picture as a background so the arrows match with the grid from its starting point to end as it appears in most textbooks?

I'm not familiar such books.  Can you show an example?

I'm attaching some examples taken from Tipler's Physics and Jearl Walker's, which are kind of well known.

As you can see the blue arrow begins at one corner from the square in the grid right off O and ends at the tip of the triangle next to the letter b (the opposite corner of the last square).

In the second example there is a cube. But I don't know how to draw the dashed cube and the axis. I can draw the arrow but how do I make sure goes from one corner to the other?

Although it is not included in the drawing how do i add a grid in all axis?

Is latex supported on Inkscape?. I had a problem writting the characters visible in the examples, and as such I had to add the tildes manually using pen tool.

Regarding the forum how do I log off?. I couldn't find the button for doing so.
  • 0.92.2 Portable
  • Windows 7 Starter

December 14, 2017, 11:23:05 AM
Reply #4

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Regarding the dash pattern I am not sure how to do it "the best way". Drawing a straight line and then selecting stroke as dashed is good but the separation between each segment is given by default. How about if i want to make the distance bigger?.

It's a little tricky using dashed lines, especially in your examples, where it will look better if each line starts and ends with a whole dash.  Doing this easily is something which is lacking in Inkscape, in my opinion.  (I think there may be a new LPE coming sometime in the next few new versions, which will help with this.  If it's already available, I'm not aware.)

After you draw a path, go to Object menu > Fill and Stroke > Stroke Style tab > Dashes.  There is a pretty large menu with all different types of dash patterns (different spacing, different dash size, etc.).  Also notice the spinbox just to the right of the menu.  It looks like they took away the label for that, but it's for adjusting the offset.  So if both ends of the path don't end with a whole dash, you can adjust that offset.

Even with that control, it still can be hard to get it right.  Maybe someone else knows some tricks?

I can draw the arrow but how do I make sure goes from one corner to the other?

You can drag the nodes, just like with a regular path.  After you draw with Bezier tool, switch to the Node tool, and you'll see the nodes.  You can just grab them and drag.  Of course you'll want to learn about Snapping.  With snapping, you can precisely position the nodes.  http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Snapping.html  I once made a screenshot of my snap control bar, showing how I keep mine configured for general use.  It still might be necessary to change the settings for certain things.  But if I can't find it, it will be a good place to start while you're learning.

Although it is not included in the drawing how do i add a grid in all axis?

I'm not sure what you mean "in all axis".  To get a grid for snapping and for organizing the drawing, Shift 3 will toggle the default rectangular grid, on and off.  If you want something other than the default, go to Document Properties > Grid tab to configure it.  But it will not be part of the drawing.  You can make rectangular or axonomic (isometric).

If you want a grid that will be part of the drawing, you'll need to draw one, using either Extension menu > Render > Grids (makes a few different kinds of grids), or Path menu > Path Effects > Construct Grid (this one only makes rectangular grids).  Note that this kind of grid can quickly lead to performance issues, if it's very large or detailed.

If "in all axis" means that you want a grid that represents x, y and z......hhmmm, I'm not sure how much is possible.  I'll have to investigate.  For sure, there's the axonomic or isometric grid.  But I'm not sure if you want that kind of "angle".  Looking at the Grid tab of Document Properties, it looks like you should be able to configure a grid for all the axis.  But unless you really know what you're doing, or someone here does (I don't) I don't think it would be easy.  I know I'd get confused, haha.

Is latex supported on Inkscape?

I just came across this extension earlier today.  I think it's providing either Latex or some similar features:  https://github.com/virrapax/XeTexText.  Oh, I just now found this.  It might be similar:  https://github.com/wanglongqi/WriteTeX  Oh, and....well, this one is said to be installed in version 0.91, but I can't seem to find in 0.92.  So here's the link:  https://github.com/julienvitard/eqtexsvg

Here's instructions for installing new extensions:  https://inkscape.org/en/learn/faq/#how-install-new-extensions-palettes-document-templates-symbol-sets-icon-sets-etc

To log off of the forum, the tab on the far right should be Logout.  If you have a small screen, the row of tabs  might have wrapped itself around into a 2nd row of tabs.  And if that happened, it will look like a row of shadows, under the top row of tabs.  You can't see the text on those wrapped around tabs unless you put the mouse on them.  And even then, it's still hard to see.  But it will be the last tab on the right, of the last row of tabs if you have more than 1 row.

If  missed any of your questions, just ask it again  :)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

December 14, 2017, 01:18:43 PM
Reply #5

Moini

  • IC Mentor

  • Offline
  • ******

  • 1,568
    • VektorRascheln
Quote (selected)
Regarding the dash pattern I am not sure how to do it "the best way". Drawing a straight line and then selecting stroke as dashed is good but the separation between each segment is given by default. How about if i want to make the distance bigger?

You can either choose a different dash pattern from the list, or, if you cannot find one that suits your needs, you keep the object selected, then open the XML editor, and edit the values for the 'stroke-dasharray' in the style attribute. Don't forget to click on 'Set' when you're done, to check the result.

Only very recently someone added a new TeX extension for Inkscape (https://inkscape.org/en/~seebk/%E2%98%85latextext-render-latex-in-inkscape), and someone else fixed the LaTeX pdf export, for a future Inkscape version. As I've never used it, I cannot tell you how well, or if, it works, though.

December 17, 2017, 05:09:30 AM
Reply #6

Chemist116

  • Sr. Newbie

  • Offline
  • **

  • 4
  • Gender
    Male

    Male
  • Personal Text
    Freelance scientist
To Brynn
I found that probably the best way to draw the dash pattern the way I wanted was to go by the method of drawing a straight line and using the dashed pattern in stroke style menu. The grid shit plus three also comes in handy thus to make sure that the line that I'm drawing is straight (180 degrees) and not tilted to some angle (oblique?). But I'm having some issues on how do I make sure the figure I'm drawing snaps to the intersection of both lines in the grid?. Do I just place over them?. From reading at the article you mentioned I made sure that the configuration is set to always snap to grid, thus Should that be enough?

When I was referring to "in all axis" I was implying the use of axonometric grid, but before going into details of this I have a question. Each time I want to change from one grid to another I end up going back to document properties removing the grid and adding a new one. Is there any shortcut for this?

Now going back to what I meant in my question it was about of making a grid that represents x, y and z which is part of the drawing. I tried first by just drawing a simple grid from the extensions menu however as you mentioned it has causes issues in performance. There is also another issue as the resulting grid occupies the whole document. I tried to "cut" the grid by performing the boolean operations (difference) but combining all paths does not work. I don't know how create one at the desired width and lenght.

In the example regarding the cube which features a blue arrow an axonomic grid would not work well because it is not possible to distinguish between two corners of the resulting cube so an arrow such as the example cannot be drawn in this case. But if the angle between two axis is not 120 then the "figure is possible".

Before continuing on latex I must say my version of Inkscape is portable. I'm not running the "installed" version. Therefore Do I need to have Inkscape installed to use those extensions? Or could be that there exists already a portable inkscape which does have latex already part of the package?

Thanks for the screenshot of the snap controls by the way.

To Moini thanks for the link but I'm still awaiting to know if extensions can be installed to portable version of inkscape.

Regarding the button for logging out I finally found it but to have a small screen is also a limitation from my side.
  • 0.92.2 Portable
  • Windows 7 Starter

December 17, 2017, 07:47:46 AM
Reply #7

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
From reading at the article you mentioned I made sure that the configuration is set to always snap to grid, thus Should that be enough?

No, you also need to set the snap control bar, which is usually along the right edge of the window.  It looks like the image I attached.  Sometimes you might have hidden it.  If you can't find it, try View menu > Show/Hide and make sure there's a check beside Snap Control Bar.  Or it might be in a horizontal position.  It can be moved using the bottom part of the View menu, by choosing either Default, Custom or Wide

Each time I want to change from one grid to another I end up going back to document properties removing the grid and adding a new one. Is there any shortcut for this?

Well you don't have to create a new grid every time.  If you notice there for each grid (which are displayed in tabs in document Properties), there are 3 options in the top-left corner.  So you can use those to avoid making another new one each time.  Then you're just switching between them.  I wish there was a way to switch from the canvas, so you don't have to call up Document Properties.  Possibly there is, but I've never heard of it??

For the record, this is the kind of grid which doesn't stay in the finished image.  It's only a helper tool.

I tried first by just drawing a simple grid from the extensions menu however as you mentioned it has causes issues in performance. There is also another issue as the resulting grid occupies the whole document.

Maybe this has changed, but the last time I used an extension to make a grid, I started with a rectangle of the size I wanted, and I had it selected when I ran the extension.  Hhm, I see it doesn't seem to work like that anymore....  So for a grid where you can control the size, use the LPE Construct Grid.  Or if it's very small, like a 1 x 2 inch rectangle, it would be easy enough to draw your own grid.

Or could be that there exists already a portable inkscape which does have latex already part of the package?

As far as I know, every version of Inkscape, for a given release has all the same extensions.  So if it's 0.92.2 (the current stable release) I don't think it has a latex extension installed.  If you have 0.91, or....actually you might have to go back to 0.48.x to get latex extension already installed in Inkscape.

I don't know why you wouldn't be able to install an extension to the portable version.  I've never used a portable version, but I've also never heard such a complaint.

Regarding the button for logging out I finally found it but to have a small screen is also a limitation from my side.

There used to be some mods for the forum software which would allow me to fix this.  But they've gone extinct, and developers so far haven't wanted to update them.  I keep my eyes open for new ones, and as soon as they are updated, I'll install them.  SMF (the forum software) is open source (like Inkscape) so anyone who knows the right code can do it.  (I think the right code is php.)  Perhaps it's because wide screens and high def screens are becoming more popular, that they think these aren't needed anymore??  I don't know.

But I do see it as a problem for the forum, and I'm on the lookout for solutions :)
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

December 19, 2017, 12:03:26 PM
Reply #8

Chemist116

  • Sr. Newbie

  • Offline
  • **

  • 4
  • Gender
    Male

    Male
  • Personal Text
    Freelance scientist
Regarding snap controls, I have identified them. But which buttons are supposed to be "active"? so that the line I'm drawing snaps to the intersection of both lines.

About switching from one grid to another it seems that to do so I have to go to document properties each time. I don't mind it but I thought there was some shortcut for that.

Regarding to make the grid. Can you take a screenshot of an example of how does it look like the menu you were referring to?. The one which I'm using fills the whole document. The LPE construction grid you mention how many options does it has? Can you post a screenshot of that window?

I'm currently using Inkscape 0.91 r13725 (running on Windows 7) and on extension menu there is no latex also my problem is I don't know how to install an extension which would run on portable Inkscape. I haven't found instructions for that. Maybe you know something about this?

Regarding screensize mine is 7-inches as I'm on a toshiba netbook and it can be some difficult to use inkscape at times specially as when the menus are not shown entirely. See the example.

Hope you can help me to clear up those questions.  :wave:
  • 0.92.2 Portable
  • Windows 7 Starter

December 19, 2017, 01:27:52 PM
Reply #9

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Regarding snap controls, I have identified them. But which buttons are supposed to be "active"? so that the line I'm drawing snaps to the intersection of both lines.

In my screenshot, the lighter colored buttons are the ones which need to be enabled (and they are enabled in the screenshot).  I know, I have a strange system theme color.  I'm not sure how other systems and themes show enabled buttons.

About switching from one grid to another it seems that to do so I have to go to document properties each time. I don't mind it but I thought there was some shortcut for that.

Hhm, I guess people rarely use both types of grids in one document.  I wonder if you really need both?  If the customized axonomic/isometric grid is only needed for drawing the 3d boxes, maybe you could use Guides for those, instead?  Like for example....well, I'll make a video to show you what I mean, rather than  try to write everything out.  Give me a few minutes, and I'll add it to this message.

Regarding to make the grid. Can you take a screenshot of an example of how does it look like the menu you were referring to?. The one which I'm using fills the whole document. The LPE construction grid you mention how many options does it has? Can you post a screenshot of that window?

This is an SVG file, so you can actually download an open it, to see the settings in the dialog.  Click the small blue text "grid-w-lpe.svg" just below the image, to download it.

grid-w-lpe.svg
*grid-w-lpe.svg
(6.68 kB . 640x682)
(viewed 2028 times)


I'm currently using Inkscape 0.91 r13725 (running on Windows 7) and on extension menu there is no latex also my problem is I don't know how to install an extension which would run on portable Inkscape. I haven't found instructions for that. Maybe you know something about this?

I gave you instructions up above.  Here again:  https://inkscape.org/en/learn/faq/#how-install-new-extensions-palettes-document-templates-symbol-sets-icon-sets-etc

Regarding screensize mine is 7-inches as I'm on a toshiba netbook and it can be some difficult to use inkscape at times specially as when the menus are not shown entirely. See the example.

I'm not sure if this is a question.  If all the buttons on a toolbar can't be shown entirely, there will be a tiny triangle (arrow) which....I'm not sure if they work by hover or click, but they will produce a menu with the missing buttons.  Although I think they are shown as text and not graphic icons.

Yes, I can see how a 7 inch screen would be hard to use Inkscape.  I'm not sure if I've actually heard of using Inkscape on such a small screen.

I'll get the video ready shortly.

Edit
Ok, here's the video showing one way to make a 3d box manually, using guides.  I don't think it's the best way for you, but my main goal is to show you how to use guides.  I can show you another way to make a 3d box, where the box is sort of rotate around a little bit, like in your examples.  But if you know physics and stuff, I suspect you'll soon learn Inkscape's power for geometrical drawing.

For creating a guide, you place the mouse over a ruler, press the mouse button, and drag, while still holding the mouse button.  When the guide is where you want, just release the mouse button.

If you start in the middle of the vertical ruler, you make a vertical guide.  In the middle of the horizontal ruler, you make a horizontal guide.  If you start dragging in the top-left, or bottom-left corner of the rulers, it will drag out a ruler at an angle.

At the part where you see the pointer change from the finger to something which looks like 2 rotating arrows, which allows you to rotate the guide, you have to press the Shift key.

If you have any other questions, just ask  :)


« Last Edit: December 19, 2017, 02:21:20 PM by brynn »
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann