Coil Around A Rectangle

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Phil White
Posts: 10
Joined: Fri Jul 29, 2022 1:56 pm

Coil Around A Rectangle

Post by Phil White »

I've been trying to find an automatic way of making a model of wrapping a wire in the form of a helix around an arbitrary object such as a cube. There is a way to wrap a helix around circular objects, but, as far as I can tell, there is no way of wrapping a wire (using a sweep) around an arbitrary object. If this feature was available, it would be very useful. It seems to me, it would not be too difficult to implement. I am, for example, trying to model the wrapping of wire around a retangular object to simulate one winding of a transformer. I think I can do this manually using the Draft Workbench, but it would be much easier if this could be done automatically.
Last edited by Phil White on Sun Jul 31, 2022 11:36 pm, edited 1 time in total.
freedman
Veteran
Posts: 3441
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Suggestion for Improvement

Post by freedman »

To do an oddly shaped form, that would need to be a Sweep. I made this macro to make Sweeps easier to do.
https://forum.freecadweb.org/viewtopic. ... 63#p599468
Phil White
Posts: 10
Joined: Fri Jul 29, 2022 1:56 pm

Re: Suggestion for Improvement

Post by Phil White »

Yes, I realize it would be a helical type sweep but around an object of any shape not just a cylinder or circular shape.
drmacro
Veteran
Posts: 8872
Joined: Sun Mar 02, 2014 4:35 pm

Re: Suggestion for Improvement

Post by drmacro »

You might have a look at the techniques bugman uses in his YouTube videos:
bugmansprings.png
bugmansprings.png (67.3 KiB) Viewed 1633 times
bugman_spring.png
bugman_spring.png (322.36 KiB) Viewed 1633 times
bugman_torroid.png
bugman_torroid.png (209.68 KiB) Viewed 1633 times
https://youtu.be/Y716n_Xe-CM
https://youtu.be/ou92FEz1lT0
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
freedman
Veteran
Posts: 3441
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Suggestion for Improvement

Post by freedman »

but it would be much easier if this could be done automatically.
There is no automatic way that I know of in FreeCAD. I guess you could write a feature request or if you write code then try your hand. It would be nice to know exactly how the helix code works, after-all it's a 3D object and we can sweep it, that makes it very unique. This makes me wonder how hard it would be to make a 3D sketch.
Phil White
Posts: 10
Joined: Fri Jul 29, 2022 1:56 pm

Re: Suggestion for Improvement

Post by Phil White »

I've seen bugman's videos, but they are hard for me to follow. I'm new to FreeCAD - any CAD for that matter - and I do not have the skills to add code. I've learned the most from the videos by Mads Leth Danielsen about the Draft Workbench https://www.youtube.com/watch?v=0AXm6Our05I , and I think I should be able to create a path around the object I want to wind a coil around and do a sweep as he shows. I still need to learn a little more.
drmacro
Veteran
Posts: 8872
Joined: Sun Mar 02, 2014 4:35 pm

Re: Suggestion for Improvement

Post by drmacro »

Phil White wrote: Fri Jul 29, 2022 8:08 pm I've seen bugman's videos, but they are hard for me to follow. I'm new to FreeCAD - any CAD for that matter - and I do not have the skills to add code. I've learned the most from the videos by Mads Leth Danielsen about the Draft Workbench https://www.youtube.com/watch?v=0AXm6Our05I , and I think I should be able to create a path around the object I want to wind a coil around and do a sweep as he shows. I still need to learn a little more.
The newer workbenches are arguably easier to use. Even Mads says he spent 4 years exclusively learning Draft workbench.

Most consider Draft workbench for general drawing to be cumbersome. It has some advanced tools that are very useful, but are not general drawing tools (such as the array tools). Sketcher is far easier. But for creating 3D paths, Draft polyline is useable, though, IMO, clumsy. Curves workbench Freehand spline is somewhat better, but, takes some effort to get comfortable.

Bugman uses, what appears to be tricky or advanced techniques, but, he really bends FreeCAD tools in unique ways to accomplish his goals.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
onekk
Veteran
Posts: 6149
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Suggestion for Improvement

Post by onekk »

Similar shapes could be achieved mapping a geom2d line to something like a torus or a cone or a cylinder made offsetting the original shape.

It is not impossible to obtain, but with GUI I don't kniw how it could be achieved, with Scripting is not too hard and there are some examples around asa I return near a computer I think I have recorded some links to other forum posts where similar things are done.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
mario52
Veteran
Posts: 4674
Joined: Wed May 16, 2012 2:13 pm

Re: Suggestion for Improvement

Post by mario52 »

Hi

tray this macro Macro_D_Un_Jour_Rotation_D_Un_Fil_Sur_Un_Fil

examples use:

Image

Image

by drmacro Sweep helix along a path

Image

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
Phil White
Posts: 10
Joined: Fri Jul 29, 2022 1:56 pm

Re: Suggestion for Improvement

Post by Phil White »

If you look at an end view of the coils previously posted here, you will see that they are either cicular or square. However, if you look at the end view of the coils of most real transformers, they are not square or circular but a rectangle where two sides are longer than the other two sides. I want to create a coil that wraps around that kind of rectangular shape. There may already exist some way to do this, but I am just learning FreeCAD and learning it seems very difficult because there are so many Workbenches and Macros.
Post Reply