EEVblog Electronics Community Forum
General => General Technical Chat => Topic started by: axero on August 08, 2014, 05:20:30 pm
-
I prefer to use vector based software such as Inkscape or Adobe Illustrator when drawing diagrams. However, the most difficult symbol to draw when it comes to diagrams is the coil. In the past I used ellipses stacked on top of each other to create the illusion of a coil. Now, I've learned how to do it properly using Bezier curves, so I decided to share that knowledge with you.
The instructions on how to do it is found in the supplied image below. A Bezier curve consists of curved line segments glued together with what is called "anchor points". An anchor point contains information about the location of the point (coordinates) and the curvature, or slope if you will, which is represented by the length and orientation (in degrees) of each anchor point's so called "handles". Each anchor point has two handles that are connected together. If you decide to break the connection between these two handles, the line will no longer be smooth at that anchor point, instead it will be kinked.
The easiest way to draw such a coil is to decide upon the location and direction of the anchor point handles for the first wind of the coil and then numerically input the values plus an offset (the long red help line) times n for each wind after the first one. The three first anchor points are located at the endpoints of the two red help lines. Anchor point D is essentially the same as anchor point B with the same distance as between anchor points A and B. The handle of the first anchor point could be drawn vertically downwards or have the same slope and length as the left black arrow.
I hope this makes things easier.
-
Nice.
I like one even further: draw a gap in one curve, so that it looks even more like a pile of coils. (I also leave a gap at line intersections, so it looks like one leaves a shadow on the other line. Rather than lazily running lines over each other, or using the ugly and archaic semicircle crossing.) Fortunately, that's done in a library where I only have to do it once...
Tim
-
You can even do this in the drawing editor of Microsoft Word:
(https://www.eevblog.com/forum/chat/how-to-draw-nice-coils-using-bezier-curves/?action=dlattach;attach=104937;image)
The advantage of this is you can have your drawings integrated with your technical documents and descriptions all in the same file.
-
Nice.
I like one even further: draw a gap in one curve, so that it looks even more like a pile of coils. ...
I'm having a hard time visualizing what you are trying to achieve here. I cannot see how a gap in a curve would make it look like a pile of coils. Making gaps in lines if one wants to do so is actually pretty easy in vector illustration software. All you have to do is to add two anchor points and then delete the line segment between those two points with the direct selection tool.
(http://images.wisegeek.com/pile-of-metal-coils.jpg)
I cannot find that coil in the drawing editor of Microsoft Word. When talking about Microsoft word, there is a Bezier curve tool in the editor but it is pretty crappy. When you first draw the Bezier curved line you have no control over the anchor points handles. There is an "Edit shape -> Edit points" tool that you can use once the curve is drawn which gives you more control and ability to edit the handles. However, the problem with this tool is that when you try to edit one handle, you will also affect the handles of adjacent anchor points for some strange reason and you have no control over this.
-
I cannot find that coil in the drawing editor of Microsoft Word. When talking about Microsoft word, there is a Bezier curve tool in the editor but it is pretty crappy. When you first draw the Bezier curved line you have no control over the anchor points handles. There is an "Edit shape -> Edit points" tool that you can use once the curve is drawn which gives you more control and ability to edit the handles. However, the problem with this tool is that when you try to edit one handle, you will also affect the handles of adjacent anchor points for some strange reason and you have no control over this.
Yes, I drew the coil using the Bezier curve tool. I have not found that adjusting the control handles of one control point affects any other control handles, but if you change the type of a control point it will reset the handles of adjacent control points. So the best work flow is to set each control point to the right type, and then go back and move the control handles to get the shape looking as desired.
For anyone not familiar with this tool, here is the walkthrough:
(https://www.eevblog.com/forum/chat/how-to-draw-nice-coils-using-bezier-curves/?action=dlattach;attach=105002;image)
(https://www.eevblog.com/forum/chat/how-to-draw-nice-coils-using-bezier-curves/?action=dlattach;attach=105004;image)
-
You can even do this in the drawing editor of Microsoft Word:
(https://www.eevblog.com/forum/chat/how-to-draw-nice-coils-using-bezier-curves/?action=dlattach;attach=104937;image)
The advantage of this is you can have your drawings integrated with your technical documents and descriptions all in the same file.
Like that ^ ;)
Though usually with a bit more gap. Last time I did it, was rather limited on drawing options unfortunately (Altium has three line sizes and grids ranging from 'normal' to 'blocky'..).
Tim
-
When I made a bigger gap I didn't like the appearance so much, so I reduced it.
-
I like finer and tighter coils, so the gap was still on the order of the line width, but the loops were much smaller, so the gaps seemed relatively large. That, and whatever limitations the grid caused. I also made the ends as special case, so they match with the wire ends better.
Just personal preference. Either way is head and shoulders above the standard crappy stacked-semicircles method. ;)
Tim
-
When I made a bigger gap I didn't like the appearance so much, so I reduced it.
Yeah, but try reducing the symbol to schematic size - the gap becomes almost invisible. Often you've got to draw different versions of things with different proportions for large and small sizes!
-
... I have not found that adjusting the control handles of one control point affects any other control handles, but if you change the type of a control point it will reset the handles of adjacent control points. So the best work flow is to set each control point to the right type, and then go back and move the control handles to get the shape looking as desired. ...
Well, then I recommend you to try Word 2013, making those shapes in that program will not yield those nice results that you have demonstrated. I don't like Word very much, although I find myself using it a lot.
Btw, that anchor point at the top of each loop is not necessary, it will save you a few bytes if you skip them.
For an example of a diagram that I drew using this technique, look at the picture of this post:
https://www.eevblog.com/forum/beginners/ups-batteries-questions/msg493177/#msg493177 (https://www.eevblog.com/forum/beginners/ups-batteries-questions/msg493177/#msg493177)
Too bad the eevblog forum doesn't accept '.svg' files as attachment. Another pet peeve of mine is that they don't support MathJax, only a few lines of code on each page is necessary to achieve that, i.e. it is not difficult at all to implement.
-
Well, then I recommend you to try Word 2013, making those shapes in that program will not yield those nice results that you have demonstrated. I don't like Word very much, although I find myself using it a lot.
Microsoft seems to have an unfortunate way of downgrading applications with each new release :(
I think Word 2007 was about the best in terms of usability, although it does have some annoying bugs that can lose your work. PowerPoint also went downhill. The best version of that was also 2007 (or even 2003!).
I don't have Office 2013 on my home computer to try this out, and I surely don't want it there :--
I have Office 2013 at work, so I'll check out how badly it is broken next time I fire it up.
Btw, that anchor point at the top of each loop is not necessary, it will save you a few bytes if you skip them.
Good point. There are only two curved segments, so I only need three control points: start, middle and end. It makes a nicer looking curve if I do it that way.
-
Good point. There are only two curved segments, so I only need three control points: start, middle and end. It makes a nicer looking curve if I do it that way.
For example, like this:
(https://www.eevblog.com/forum/chat/how-to-draw-nice-coils-using-bezier-curves/?action=dlattach;attach=105019;image)
-
Congratulations, it looks nice! I'm sorely tempted to send this thread to my former teacher in Network analysis and microelectronic circuits.
As for MS Word I find it hard to compare them like that. Admittedly 2007 was an advancement with rather nice looking diagrams, predefined layouts and better control over color selection, and I assume that 2010 and 13 provide even more nice looking templates for diagrams and page layout.
But when you start to write something more serious with chapters, sections and cross-references, then MS Word turns into a nightmare. Building tables or writing equations in Word is just a mess, and it behaves like it has a mind of its own. I have learned to use MathType now which is a plug-in to MS Word that you buy separately, and once you learn the hotkeys, typing equations is just as fast as writing text, or even faster.
But still, no other computer software out there holds a candle to LaTeX when it comes to typesetting math. It's simply the best in the world. It's been around for decades and is now as mature as a perfectly ripe strawberry or a nice vintage wine. And with MathJax support you can typeset math in a web page using a LaTeX engine.
-
FWIW,
"There's a Package For That!"
I mean, for drawing electronic circuits in LaTeX. If you're the kind of person who likes writing in LaTeX, that is. :)
Tim
-
Congratulations, it looks nice! I'm sorely tempted to send this thread to my former teacher in Network analysis and microelectronic circuits.
Thanks :)
As for MS Word I find it hard to compare them like that. Admittedly 2007 was an advancement with rather nice looking diagrams, predefined layouts and better control over color selection, and I assume that 2010 and 13 provide even more nice looking templates for diagrams and page layout.
With 2013 they tried to make it "easier to use", so they took many of the commands off the menus to make them "simpler". As a result you have to dig deeper to find the features that were on the surface before. One thing they broke in recent versions was the snap to grid feature in free form shapes. The net is full of people complaining about that, but MS shows no sign of fixing it. They did add various predefined templates, but in some ways that limits precise control over appearance unless you can find how to customize the templates.
I think it is a running joke that MS Word is aimed at people whose ambitions end at writing one page letters :P
But when you start to write something more serious with chapters, sections and cross-references, then MS Word turns into a nightmare. Building tables or writing equations in Word is just a mess, and it behaves like it has a mind of its own. I have learned to use MathType now which is a plug-in to MS Word that you buy separately, and once you learn the hotkeys, typing equations is just as fast as writing text, or even faster.
See the comment above about writing letters. But you can gain control over Word and stop it having a mind of its own if you take care to avoid all the "easy to use" features like automatic style creation. If you instead predefine your styles with names and then apply them directly to each heading and paragraph things work out much better.
But still, no other computer software out there holds a candle to LaTeX when it comes to typesetting math. It's simply the best in the world. It's been around for decades and is now as mature as a perfectly ripe strawberry or a nice vintage wine. And with MathJax support you can typeset math in a web page using a LaTeX engine.
For equations I really do like the new equation feature that was added since Word 2007 with its LaTeX-like markup language. It is a vast improvement over the old equation editor.
-
FWIW,
"There's a Package For That!"
I mean, for drawing electronic circuits in LaTeX. If you're the kind of person who likes writing in LaTeX, that is. :)
Tim
I wear latex all the time when writing.
-
The nice thing about the way Word does equations since 2007 is that equations are not embedded objects but are native document text. This allows you to create documents like this, where the same typography is used in the drawing labels, in the equations, and in the body text:
(https://www.eevblog.com/forum/chat/how-to-draw-nice-coils-using-bezier-curves/?action=dlattach;attach=105171;image)
-
Well, then I recommend you to try Word 2013, making those shapes in that program will not yield those nice results that you have demonstrated.
OK, I fired up Word 2013 and had a go. It's still possible to produce the same results as it was with Word 2007, but it's harder work now. Sadly.
Luckily I have a choice between Office 2007, Office 2010 and Office 2013 at work. I remain settled on Office 2007. Maybe one or two nice features were added to later versions of Office, but the 2007 version remains the most usable overall. It's one of those situations where once the basic feature set is complete (as it was in 2007) the only thing left to do is to add fluff.
-
Geez... They're SCHEMATIC REPRESENTATIONS. They don't need to be elegantly styled works of art!
-
So, schematics aren't art? PCBs are functional only?
You must be a terrible engineer (if at all), huh? >:D
Still one of my favorites; http://seventransistorlabs.com/tmoranwms/Elec_TubeFF.gif (http://seventransistorlabs.com/tmoranwms/Elec_TubeFF.gif)
Tim