How to draw nice coils using Bezier curves - Page 1
Forum section: electronics / general

author: axero
author_rank: Regular Contributor
timestamp: August 08, 2014, 05:20:30 pm
content: 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) timesnfor 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.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 09, 2014, 02:42:27 am
content: 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

author: IanB
author_rank: Super Contributor
timestamp: August 09, 2014, 03:28:16 am
content: You can even do this in the drawing editor of Microsoft Word:The advantage of this is you can have your drawings integrated with your technical documents and descriptions all in the same file.

author: axero
author_rank: Regular Contributor
timestamp: August 09, 2014, 11:07:32 am
content: Quote from: T3sl4co1l on August 09, 2014, 02:42:27 amI'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.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.

author: IanB
author_rank: Super Contributor
timestamp: August 09, 2014, 04:15:45 pm
content: Quote from: axero on August 09, 2014, 11:07:32 amYes, 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:

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 09, 2014, 04:20:05 pm
content: Quote from: IanB on August 09, 2014, 03:28:16 amLike 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

author: IanB
author_rank: Super Contributor
timestamp: August 09, 2014, 04:21:32 pm
content: When I made a bigger gap I didn't like the appearance so much, so I reduced it.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 09, 2014, 04:28:53 pm
content: 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

author: c4757p
author_rank: Super Contributor
timestamp: August 09, 2014, 04:29:27 pm
content: Quote from: IanB on August 09, 2014, 04:21:32 pmYeah, 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!

author: axero
author_rank: Regular Contributor
timestamp: August 09, 2014, 07:43:48 pm
content: Quote from: IanB on August 09, 2014, 04:15:45 pmWell, 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/#msg493177Too 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.

author: IanB
author_rank: Super Contributor
timestamp: August 09, 2014, 08:19:49 pm
content: Quote from: axero on August 09, 2014, 07:43:48 pmMicrosoft seems to have an unfortunate way of downgrading applications with each new releaseI 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 thereI have Office 2013 at work, so I'll check out how badly it is broken next time I fire it up.QuoteGood 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.

author: IanB
author_rank: Super Contributor
timestamp: August 09, 2014, 09:13:53 pm
content: Quote from: IanB on August 09, 2014, 08:19:49 pmFor example, like this:

author: axero
author_rank: Regular Contributor
timestamp: August 10, 2014, 09:55:48 pm
content: 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.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 10, 2014, 10:05:41 pm
content: 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

author: IanB
author_rank: Super Contributor
timestamp: August 10, 2014, 11:04:13 pm
content: Quote from: axero on August 10, 2014, 09:55:48 pmThanksQuoteWith 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 lettersQuoteSee 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.QuoteFor 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.

author: XOIIO
author_rank: Super Contributor
timestamp: August 10, 2014, 11:33:19 pm
content: Quote from: T3sl4co1l on August 10, 2014, 10:05:41 pmI wear latex all the time when writing.

author: IanB
author_rank: Super Contributor
timestamp: August 11, 2014, 01:55:39 am
content: 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:

author: IanB
author_rank: Super Contributor
timestamp: August 12, 2014, 01:13:44 am
content: Quote from: axero on August 09, 2014, 07:43:48 pmOK, 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.

author: westfw
author_rank: Super Contributor
timestamp: August 12, 2014, 09:47:23 am
content: Geez... They're SCHEMATIC REPRESENTATIONS. They don't need to be elegantly styled works of art!

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 12, 2014, 08:36:14 pm
content: So, schematics aren't art? PCBs are functional only?You must be a terrible engineer (if at all), huh?Still one of my favorites;http://seventransistorlabs.com/tmoranwms/Elec_TubeFF.gifTim